Class: Tweezer::CLI
- Inherits:
-
Thor
- Object
- Thor
- Tweezer::CLI
- Defined in:
- lib/tweezer/cli.rb
Instance Method Summary collapse
- #add(name) ⇒ Object
- #alter(name) ⇒ Object
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/tweezer/cli.rb', line 6 def initialize(*) super custom_gemfile = [:gemfile] || Bundler.settings[:gemfile] if custom_gemfile && !custom_gemfile.empty? ENV['BUNDLE_GEMFILE'] = File.(custom_gemfile) end @gemfile = Tweezer::Gemfile.load end |
Instance Method Details
#add(name) ⇒ Object
23 24 25 26 |
# File 'lib/tweezer/cli.rb', line 23 def add(name) @gemfile.add_gem(name, **gem_opts) @gemfile.save! end |
#alter(name) ⇒ Object
36 37 38 39 |
# File 'lib/tweezer/cli.rb', line 36 def alter(name) @gemfile.alter_gem(name, **gem_opts) @gemfile.save! end |