Class: Runner
Class Attribute Summary collapse
-
.app_name ⇒ Object
Returns the value of attribute app_name.
-
.base ⇒ Object
Returns the value of attribute base.
-
.facets_source ⇒ Object
Returns the value of attribute facets_source.
-
.runfile ⇒ Object
Returns the value of attribute runfile.
-
.sources(sourcefolder) ⇒ Object
Returns the value of attribute sources.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(app_name, runfile = "~/.suprails/config") ⇒ Runner
constructor
A new instance of Runner.
- #methods ⇒ Object
- #run ⇒ Object
Methods included from SuprailsHelper
#debug, #delete, #file, #folder, #frozen_rails, #generate, #git, #gpl, #new_file, #plugin, #rails, #rake, #runinside, #save, #svn
Constructor Details
#initialize(app_name, runfile = "~/.suprails/config") ⇒ Runner
Returns a new instance of Runner.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/runner.rb', line 47 def initialize(app_name, runfile = "~/.suprails/config") Runner.init_variables(app_name, runfile) Dir["#{Runner.facets_source}/*.rb"].each{|x| load x } Facet.registered_facets.each do |name, facet| self.class.send(:define_method, name) {} instance_eval do self.class.send(:define_method, name) do |*args| args.unshift(Runner.app_name) facet.go *args end end end end |
Class Attribute Details
.app_name ⇒ Object
Returns the value of attribute app_name.
28 29 30 |
# File 'lib/runner.rb', line 28 def app_name @app_name end |
.base ⇒ Object
Returns the value of attribute base.
32 33 34 |
# File 'lib/runner.rb', line 32 def base @base end |
.facets_source ⇒ Object
Returns the value of attribute facets_source.
31 32 33 |
# File 'lib/runner.rb', line 31 def facets_source @facets_source end |
.runfile ⇒ Object
Returns the value of attribute runfile.
29 30 31 |
# File 'lib/runner.rb', line 29 def runfile @runfile end |
.sources(sourcefolder) ⇒ Object
Returns the value of attribute sources.
30 31 32 |
# File 'lib/runner.rb', line 30 def sources @sources end |
Class Method Details
.init_variables(app_name, runfile) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/runner.rb', line 38 def init_variables(app_name, runfile) @app_name = app_name @runfile = File.(runfile) @sources = File.('~/.suprails/sources/') @facets_source = File.('~/.suprails/facets/') @base = File. "./#{@app_name}" end |
Instance Method Details
#methods ⇒ Object
62 63 64 |
# File 'lib/runner.rb', line 62 def methods super.each{|x| puts x} end |