Class: CIJoe::Server
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- CIJoe::Server
- Defined in:
- lib/cijoe/server.rb
Instance Attribute Summary collapse
-
#joe ⇒ Object
readonly
Returns the value of attribute joe.
Class Method Summary collapse
Instance Method Summary collapse
- #check_project ⇒ Object
-
#initialize(*args) ⇒ Server
constructor
A new instance of Server.
Constructor Details
#initialize(*args) ⇒ Server
Returns a new instance of Server.
73 74 75 76 77 78 79 |
# File 'lib/cijoe/server.rb', line 73 def initialize(*args) super check_project @joe = CIJoe.new(.project_path) CIJoe::Campfire.activate end |
Instance Attribute Details
#joe ⇒ Object (readonly)
Returns the value of attribute joe.
7 8 9 |
# File 'lib/cijoe/server.rb', line 7 def joe @joe end |
Class Method Details
.start(host, port, project_path) ⇒ Object
81 82 83 84 |
# File 'lib/cijoe/server.rb', line 81 def self.start(host, port, project_path) set :project_path, project_path CIJoe::Server.run! :host => host, :port => port end |
Instance Method Details
#check_project ⇒ Object
86 87 88 89 90 91 92 |
# File 'lib/cijoe/server.rb', line 86 def check_project if .project_path.nil? || !File.exists?(File.(.project_path)) puts "Whoops! I need the path to a Git repo." puts " $ git clone [email protected]:username/project.git project" abort " $ cijoe project" end end |