Skip to content
Browse files

Githooks is now configurable

  • Loading branch information...
1 parent 2dfcb84 commit bec76c7218c44353057a154c97e626b597559b57 Robert R Evans committed
Showing with 27 additions and 5 deletions.
  1. +2 −0 .gitignore
  2. BIN githooks-0.0.1.gem
  3. +9 −4 lib/githooks/generate.rb
  4. +16 −1 lib/githooks/parse.rb
View
2 .gitignore
@@ -0,0 +1,2 @@
+.DS_Store
+*.gem
View
BIN githooks-0.0.1.gem
Binary file not shown.
View
13 lib/githooks/generate.rb
@@ -15,9 +15,9 @@ def self.post_commit(options)
def send_campfire_message
- campfire = Tinder::Campfire.new('codewranglers')
- campfire.login('codemonkey@codewranglers.org', '89628962')
- room = campfire.find_room_by_name 'War Room'
+ campfire = Tinder::Campfire.new('#{options.domain}')
+ campfire.login('#{options.login}', '#{options.password}')
+ room = campfire.find_room_by_name '#{options.room}'
room.speak build_commit_message
room.leave
end
@@ -45,4 +45,9 @@ def build_commit_message
end
end
-end
+end
+
+# githooks bitly --login codemonkey@codewranglers.org --pass 89628962 --domain codewranglers --room "War Room"
+# campfire = Tinder::Campfire.new('codewranglers')
+# campfire.login('codemonkey@codewranglers.org', '89628962')
+# room = campfire.find_room_by_name 'War Room'
View
17 lib/githooks/parse.rb
@@ -12,7 +12,22 @@ def self.parse(args)
opts.banner = "Githooks - FACollective.com"
opts.separator ''
opts.separator 'Command line usage: githooks project_name'
-
+
+ opts.on("--room ROOM", "Which room do you want to connect this too?") do |room|
+ options.room = room
+ end
+
+ opts.on("--login LOGIN", "What is the login name to the campfire room?") do |login|
+ options.login = login
+ end
+
+ opts.on("--pass PASSWORD", "What is the password for that room?") do |pass|
+ options.password = pass
+ end
+
+ opts.on('--domain DOMAIN', "What subdomain?") do |domain|
+ options.domain = domain
+ end
opts.on_tail("-h", "--help", "Show help") do
puts opts

0 comments on commit bec76c7

Please sign in to comment.
Something went wrong with that request. Please try again.