Class: Degem::Cli
- Inherits:
-
Object
- Object
- Degem::Cli
- Defined in:
- lib/degem/cli.rb
Constant Summary collapse
- GEMFILE =
"Gemfile"
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(stderr) ⇒ Cli
constructor
A new instance of Cli.
Constructor Details
#initialize(stderr) ⇒ Cli
11 12 13 |
# File 'lib/degem/cli.rb', line 11 def initialize(stderr) Degem.stderr = stderr end |
Class Method Details
.call ⇒ Object
7 8 9 |
# File 'lib/degem/cli.rb', line 7 def self.call exit new($stderr).call end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/degem/cli.rb', line 15 def call unless gemfile_exists? Degem.stderr.puts "Gemfile not found in the current directory" return 1 end unused = find_unused.call decorated = decorate_rubygems.call(unused) Report.new.call(decorated) 0 end |