How to Create a Ruby GemNovember 10, 2014 |
Here is the most modern approach to gem crafting:
bundle gem gemname
cd gemname
edit your_gem.gemspec and add description, summary, required gems and optional website. Add required gems for development such as rspec, rails or minitest to the Gemfile.
rspec --init
touch spec/your_gem_spec.rb
# Rakefile
Setting up MiniTest for a Rails 4 AppOctober 03, 2014 |
Gemfile
gem "minitest-rails", github: "blowmage/minitest-rails"
gem "minitest-reporters"
application.rb
config.generators do |g|
g.test_framework :minitest, spec: true, fixture: true
g.helper false
g.view_specs false
end
$>
rails g minitest:install
test_helper.rb
Rails.env = "test"