Class: LcpRuby::CLI::ExamplesCommand

Inherits:
Thor
  • Object
show all
Defined in:
lib/lcp_ruby/cli/examples_command.rb

Overview

‘lcp examples path` / `lcp examples copy DIR` — locate or copy the bundled example-app source. `path` returns the examples directory so every bundled app is discoverable; `lcp run NAME` boots one. Rails-free.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/lcp_ruby/cli/examples_command.rb', line 13

def self.exit_on_failure?
  true
end

Instance Method Details

#copy(dir) ⇒ Object



23
24
25
26
# File 'lib/lcp_ruby/cli/examples_command.rb', line 23

def copy(dir)
  copied = LcpRuby::AssetCopier.copy(LcpRuby::GemPaths.examples, dir)
  say "Copied #{copied.size} example file(s) into #{File.expand_path(dir)}", :green
end

#pathObject



18
19
20
# File 'lib/lcp_ruby/cli/examples_command.rb', line 18

def path
  say LcpRuby::GemPaths.examples
end