Class: Grub::CLI
- Inherits:
-
Object
- Object
- Grub::CLI
- Defined in:
- lib/grub/cli.rb
Instance Method Summary collapse
- #run(args) ⇒ Object
- #run_for_gem(gem_name, options = {}) ⇒ Object
- #run_for_gemfile(options = {}) ⇒ Object
Instance Method Details
#run(args) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/grub/cli.rb', line 5 def run(args) = Options.new.parse!(args) if args.empty? run_for_gemfile() else run_for_gem(args.pop, ) end end |
#run_for_gem(gem_name, options = {}) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/grub/cli.rb', line 24 def run_for_gem(gem_name, = {}) gem_line = GemLine.new(name: gem_name, options: ) SpecFinder.find_specs_for(gem_line, &self.method(:print_progress)) info = gem_line.info info = "No information to show" if info.strip.empty? puts info end |
#run_for_gemfile(options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/grub/cli.rb', line 14 def run_for_gemfile( = {}) Bundler.configure gemfile = Gemfile.new(Bundler.default_gemfile, ) gemfile.parse unless gemfile.gem_lines.empty? SpecFinder.find_specs_for(gemfile.gem_lines, &self.method(:print_progress)) gemfile.write_comments end end |