Class: Umwelt::CLI::Commands::Example

Inherits:
Hanami::CLI::Command
  • Object
show all
Defined in:
lib/umwelt/cli/commands/example.rb

Instance Method Summary collapse

Instance Method Details

#call(**options) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/umwelt/cli/commands/example.rb', line 12

def call(**options)
  FileUtils.cp_r(
    examples_dir,
    target_dir(options.fetch(:target)),
    verbose: true
  )
end

#examples_dirObject



20
21
22
# File 'lib/umwelt/cli/commands/example.rb', line 20

def examples_dir
  Pathname.new(__dir__) / '../../../../spec/examples/.'
end

#target_dir(target) ⇒ Object



24
25
26
# File 'lib/umwelt/cli/commands/example.rb', line 24

def target_dir(target)
  Pathname.pwd / target
end