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
Instance Attribute Details
#joe ⇒ Object (readonly)
Returns the value of attribute joe.
6 7 8 |
# File 'lib/cijoe/server.rb', line 6 def joe @joe end |
Class Method Details
.project_path=(project_path) ⇒ Object
89 90 91 92 93 94 95 96 97 98 |
# File 'lib/cijoe/server.rb', line 89 def self.project_path=(project_path) user, pass = Config.cijoe(project_path).user.to_s, Config.cijoe(project_path).pass.to_s if user != '' && pass != '' use Rack::Auth::Basic do |username, password| [ username, password ] == [ user, pass ] end puts "Using HTTP basic auth" end set :project_path, Proc.new{project_path} end |
Instance Method Details
#check_project ⇒ Object
100 101 102 103 104 105 106 |
# File 'lib/cijoe/server.rb', line 100 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 |