Class: RSGem::Tasks::CleanGemfile
- Defined in:
- lib/rsgem/tasks/clean_gemfile.rb
Overview
Gemfile should only have the gemspec directive. An exception is when you need to develop against a gem that hasn’t yet been released, in this case you can declare that dependency in the Gemfile:
gem 'rack', github: 'rack/rack'
gemspec is the place to declare dependencies.
Constant Summary collapse
- OUTPUT =
OutputStruct.new(name: 'Clean gemfile')
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Methods included from Output
Constructor Details
This class inherits a constructor from RSGem::Tasks::Base
Instance Method Details
#perform ⇒ Object
19 20 21 22 23 |
# File 'lib/rsgem/tasks/clean_gemfile.rb', line 19 def perform gemfile.gsub!(/gem .+\n/, '') # Remove all gem definitions gemfile.sub!(/\n\z/, '') # Remove last new line character write_to_gemfile end |