Class: Bindle::Commands::Base
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Bindle::Commands::Base
- Includes:
- Thor::Actions
- Defined in:
- lib/bindle/commands/base.rb
Direct Known Subclasses
Class Method Summary collapse
- .banner ⇒ Object
- .default_command_root ⇒ Object
- .default_source_root ⇒ Object
- .display_name ⇒ Object
- .source_root ⇒ Object
Class Method Details
.banner ⇒ Object
31 32 33 34 35 |
# File 'lib/bindle/commands/base.rb', line 31 def = "bindle #{display_name}" << " #{self.arguments.map(&:usage).join(' ')}" if self.arguments.length > 0 << " [options]" end |
.default_command_root ⇒ Object
23 24 25 |
# File 'lib/bindle/commands/base.rb', line 23 def default_command_root File.dirname(__FILE__) end |
.default_source_root ⇒ Object
27 28 29 |
# File 'lib/bindle/commands/base.rb', line 27 def default_source_root File.join(default_command_root, "..", "templates") end |
.display_name ⇒ Object
37 38 39 40 41 42 |
# File 'lib/bindle/commands/base.rb', line 37 def display_name self.to_s.split("::") .reject { |item| ["Bindle", "Commands"].include?(item) } .map(&:underscore) .join(" ") end |
.source_root ⇒ Object
19 20 21 |
# File 'lib/bindle/commands/base.rb', line 19 def source_root default_source_root end |