Class: Heroku::Bartender::Server
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Heroku::Bartender::Server
- Defined in:
- lib/heroku/bartender/server.rb
Constant Summary collapse
- @@options =
{}
Class Method Summary collapse
- .authorize(user, password) ⇒ Object
- .config ⇒ Object
- .host ⇒ Object
- .max_per_page ⇒ Object
- .password ⇒ Object
- .port ⇒ Object
- .predeploy ⇒ Object
- .start(options = {}) ⇒ Object
- .target ⇒ Object
- .user ⇒ Object
Class Method Details
.authorize(user, password) ⇒ Object
86 87 88 89 90 91 92 |
# File 'lib/heroku/bartender/server.rb', line 86 def self.(user, password) if ! user.nil? use Rack::Auth::Basic, "Restricted Area" do |u, p| [u, p] == [user, password] end end end |
.config ⇒ Object
41 42 43 |
# File 'lib/heroku/bartender/server.rb', line 41 def self.config Config.send("remote.#{Server.target}") end |
.host ⇒ Object
33 34 35 |
# File 'lib/heroku/bartender/server.rb', line 33 def self.host @@options[:host] end |
.max_per_page ⇒ Object
17 18 19 |
# File 'lib/heroku/bartender/server.rb', line 17 def self.max_per_page @@options[:commits_per_page] end |
.password ⇒ Object
25 26 27 |
# File 'lib/heroku/bartender/server.rb', line 25 def self.password @@options[:password] end |
.port ⇒ Object
37 38 39 |
# File 'lib/heroku/bartender/server.rb', line 37 def self.port @@options[:port] end |
.predeploy ⇒ Object
45 46 47 |
# File 'lib/heroku/bartender/server.rb', line 45 def self.predeploy config.predeploy.to_s end |
.start(options = {}) ⇒ Object
79 80 81 82 83 84 |
# File 'lib/heroku/bartender/server.rb', line 79 def self.start( = {}) @@options = @@deploying = false (user, password) run!(:host => host, :port => port) end |
.target ⇒ Object
29 30 31 |
# File 'lib/heroku/bartender/server.rb', line 29 def self.target @@options[:target] || 'heroku' end |
.user ⇒ Object
21 22 23 |
# File 'lib/heroku/bartender/server.rb', line 21 def self.user @@options[:user] end |