Class: Stic::CLI::Command
- Inherits:
-
Opt::Command
- Object
- Opt::Command
- Stic::CLI::Command
- Defined in:
- lib/stic/cli/command.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
Instance Method Details
#run(_result) ⇒ Object
5 6 7 8 |
# File 'lib/stic/cli/command.rb', line 5 def run(_result) raise NotImplementedError.new "Subclass #{self.class.name} to " \ 'implement custom command.' end |
#site ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/stic/cli/command.rb', line 10 def site @site ||= begin Stic::Site.lookup.tap do |site| unless site puts 'Not in a stic site. You need to run the ' \ '`stic` command within a stic site.' exit 1 end end end end |
#to_help ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/stic/cli/command.rb', line 22 def to_help <<-EOF.gsub(/^ {4}/, '') build Build current side ot given output path. --target, -t Output path the side will be written to. Existing files will be overriden and/or deleted. Defaults to `site` in project root. (Not yet supported) EOF end |