Class: DepsGrapher::Command::Init
- Inherits:
-
Object
- Object
- DepsGrapher::Command::Init
- Includes:
- Logging
- Defined in:
- lib/deps_grapher/command/init.rb
Instance Method Summary collapse
-
#initialize(context) ⇒ Init
constructor
A new instance of Init.
- #run! ⇒ Object
Methods included from Logging
#error, #info, #verbose, #warn
Constructor Details
#initialize(context) ⇒ Init
Returns a new instance of Init.
11 12 13 |
# File 'lib/deps_grapher/command/init.rb', line 11 def initialize(context) @context = context end |
Instance Method Details
#run! ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/deps_grapher/command/init.rb', line 15 def run! dest = File.("graphile.rb") return if File.exist?(dest) && !ask_yes_no("Overwrite `#{dest}`?") context.generate_graphile dest info { "\n`#{dest}` was created." } info { "Please edit the configuration file." } info { "Run `bundle exec deps_grapher -c #{File.basename(dest)}`." } end |