Class: Evergreen::Suite
- Inherits:
-
Object
- Object
- Evergreen::Suite
- Defined in:
- lib/evergreen/suite.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
readonly
Returns the value of attribute application.
-
#driver ⇒ Object
readonly
Returns the value of attribute driver.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
- #get_spec(name) ⇒ Object
-
#initialize(root) ⇒ Suite
constructor
A new instance of Suite.
- #run ⇒ Object
- #serve ⇒ Object
- #specs ⇒ Object
- #templates ⇒ Object
Constructor Details
#initialize(root) ⇒ Suite
Returns a new instance of Suite.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/evergreen/suite.rb', line 5 def initialize(root) @root = root paths = [ File.("config/evergreen.rb", root), File.(".evergreen", root), "#{ENV["HOME"]}/.evergreen" ] paths.each { |path| load(path) if File.exist?(path) } @runner = Runner.new(self) @server = Server.new(self) @application = Evergreen.application(self) end |
Instance Attribute Details
#application ⇒ Object (readonly)
Returns the value of attribute application.
3 4 5 |
# File 'lib/evergreen/suite.rb', line 3 def application @application end |
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
3 4 5 |
# File 'lib/evergreen/suite.rb', line 3 def driver @driver end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
3 4 5 |
# File 'lib/evergreen/suite.rb', line 3 def root @root end |
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
3 4 5 |
# File 'lib/evergreen/suite.rb', line 3 def runner @runner end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
3 4 5 |
# File 'lib/evergreen/suite.rb', line 3 def server @server end |
Instance Method Details
#get_spec(name) ⇒ Object
28 29 30 |
# File 'lib/evergreen/suite.rb', line 28 def get_spec(name) Spec.new(self, name) end |
#run ⇒ Object
20 21 22 |
# File 'lib/evergreen/suite.rb', line 20 def run runner.run end |
#serve ⇒ Object
24 25 26 |
# File 'lib/evergreen/suite.rb', line 24 def serve server.serve end |
#specs ⇒ Object
32 33 34 35 36 |
# File 'lib/evergreen/suite.rb', line 32 def specs Dir.glob(File.join(root, Evergreen.spec_dir, '**/*_spec.{js,coffee}')).map do |path| Spec.new(self, path.gsub(File.join(root, Evergreen.spec_dir, ''), '')) end end |
#templates ⇒ Object
38 39 40 41 42 |
# File 'lib/evergreen/suite.rb', line 38 def templates Dir.glob(File.join(root, Evergreen.template_dir, '*')).map do |path| Template.new(self, File.basename(path)) end end |