Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add changes for web monitor runner

  • Loading branch information...
commit 53c462cf57c45722468f3ee05839e098cd8fe6f2 1 parent f3570ba
@plukevdh authored
View
23 bin/kthxbye-monitor
@@ -0,0 +1,23 @@
+#!/usr/bin/env ruby
+$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
+
+begin
+ require 'vegas'
+rescue
+ require 'rubygems'
+ require 'vegas'
+end
+
+require 'kthxbye/web_interface'
+require 'kthxbye/config'
+
+Vegas::Runner.new(Kthxbye::WebInterface, 'kthxbye-monitor') do |runner, args, app|
+ args.on('-S SERVER', '--server SERVER', "set the redis server") {|server|
+ Kthxbye::Config.setup(:redis_server => server)
+ }
+ args.on('-P PORT', '--port PORT', "set the redis port") {|port|
+ Kthxbye::Config.setup(:redis_port => port)
+ }
+
+end
+
View
9 config.ru 100755 → 100644
@@ -1,10 +1,11 @@
#!/usr/bin/env ruby
$LOAD_PATH.unshift ::File.expand_path(::File.dirname(__FILE__) + '/lib')
-require 'kthxbye'
require 'kthxbye/web_interface'
-Kthxbye::Config.setup(:redis_server => "itwebpriv1", :redis_port => 6379)
-Kthxbye.connect
+if ENV['KTHXBYECONFIG'] && ::File.exists?(::File.expand_path(ENV['KTHXBYECONFIG']))
+ load ::File.expand_path(ENV['KTHXBYECONFIG'])
+end
-Kthxbye::WebInterface.run!
+use Rack::ShowExceptions
+Kthxbye::WebInterface.new
View
4 kthxbye.gemspec
@@ -10,9 +10,9 @@ Gem::Specification.new do |s|
s.summary = %q{Async processing + results notification}
s.description = %q{Kthxbye is the answer to a fairly unique-yet-common problem: Background job processing when we care about the result.}
s.email = %q{hungerandthirst@gmail.com}
- s.extra_rdoc_files = %w(LICENSE README.textile)
+ s.extra_rdoc_files = %w(LICENSE README.rdoc)
- s.files = Dir.glob("{bin,lib}/**/*") + %w(LICENSE README.textile DESIGN.textile config.ru Gemfile)
+ s.files = Dir.glob("{bin,lib}/**/*") + %w(LICENSE README.rdoc DESIGN.textile config.ru Gemfile)
s.test_files = Dir.glob("{test}/**/*")
s.homepage = %q{http://github.com/plukevdh/kthxbye}
View
3  lib/kthxbye/config.rb
@@ -28,8 +28,7 @@ def self.setup( args=nil )
# Quick access to the options hash. Works for setting individual options
# during runtime.
def self.options
- return @options if @options
- Config.setup
+ @options ||= DEFAULT.dup
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.