Class: BundlerDiff::CLI
- Inherits:
-
Object
- Object
- BundlerDiff::CLI
- Defined in:
- lib/bundler_diff/cli.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ commit: 'HEAD', format: :default }.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args = []) ⇒ CLI
constructor
A new instance of CLI.
- #invoke ⇒ Object
Constructor Details
#initialize(args = []) ⇒ CLI
Returns a new instance of CLI.
20 21 22 |
# File 'lib/bundler_diff/cli.rb', line 20 def initialize(args = []) @args = args end |
Class Method Details
.invoke(args = ARGV) ⇒ Object
16 17 18 |
# File 'lib/bundler_diff/cli.rb', line 16 def self.invoke(args = ARGV) new(args).invoke end |
Instance Method Details
#invoke ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/bundler_diff/cli.rb', line 24 def invoke set_access_token! gems = GemsComparator.compare(before_lockfile, after_lockfile) output = formatter.new.render(gems) output = JSON.dump(output) if [:escape_json] puts output rescue StandardError => e puts e.inspect end |