Permalink
Browse files

fix configuration reading and improve example

  • Loading branch information...
1 parent 8583415 commit 6bece8b14d285f64cd10924695d16cf51b1a306a @mpapis mpapis committed Mar 19, 2012
Showing with 5 additions and 14 deletions.
  1. +2 −2 README.md
  2. +0 −8 example.yml
  3. +0 −1 lib/eployday/cli.rb
  4. +2 −2 lib/eployday/configuration.rb
  5. +1 −1 lib/eployday/deploy.rb
View
4 README.md
@@ -14,10 +14,10 @@ Example for auto deploy on travis-ci tests passed `rvm-site.yml`:
nick: rvm-site-deploy
channels:
- "#rvm-test"
- trigger_text: "The build passed."
+ trigger_text: !ruby/regexp /.*The build passed\..*/
allowed_users:
- travis-ci
- command: "echo bdsm deploy"
+ command: "bdsm deploy"
Start server with:
View
8 example.yml
@@ -1,8 +0,0 @@
----
-nick: rvm-site-deploy
-channels:
- - "#rvm-test"
-trigger_text: "The build passed."
-allowed_users:
- - travis-ci
- - mpapis
View
1 lib/eployday/cli.rb
@@ -6,7 +6,6 @@ module Eployday
class CLI
def initialize args
raise "configuration file name required" if args.empty?
- Eployday::Configuration.new args.first
end
def run
View
4 lib/eployday/configuration.rb
@@ -6,9 +6,9 @@ def initialize args
@@configuration = YAML.load_file args
end
def self.[] key
- @@configuration ||= {}
- puts "-- reading #{key} => #{@@configuration[key.to_s]}"
+ puts "-- configuration[#{key}] => #{@@configuration[key.to_s]}"
@@configuration[key.to_s]
end
end
+ Configuration.new ARGV.first unless ARGV.empty?
end
View
2 lib/eployday/deploy.rb
@@ -5,7 +5,7 @@ module Eployday
class Deploy
include Cinch::Plugin
- match Eployday::Configuration[:trigger_text]
+ match Eployday::Configuration[:trigger_text], :use_prefix => false
def execute(m)
if PermissionChecker.allowed?(m.user)

0 comments on commit 6bece8b

Please sign in to comment.