Class: Tabby::Runner
- Inherits:
-
Object
- Object
- Tabby::Runner
- Defined in:
- lib/tabby/runner.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #dasherize ⇒ Object
-
#initialize(project) ⇒ Runner
constructor
A new instance of Runner.
- #klass ⇒ Object
- #run! ⇒ Object
Constructor Details
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
3 4 5 |
# File 'lib/tabby/runner.rb', line 3 def project @project end |
Instance Method Details
#dasherize ⇒ Object
10 11 12 |
# File 'lib/tabby/runner.rb', line 10 def dasherize @project.gsub("_", "-") end |
#klass ⇒ Object
14 15 16 |
# File 'lib/tabby/runner.rb', line 14 def klass @project.split(/_|-/).map { |p| p.capitalize }.join.to_sym end |
#run! ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/tabby/runner.rb', line 18 def run! if @path..exist? require TABBYDIR.join("#{@project}.rb") ObjectSpace.class.const_get(klass).new.call else puts ">> Project '#{@project}' does not exist." end end |