Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Githooks is now configurable

  • Loading branch information...
commit bec76c7218c44353057a154c97e626b597559b57 1 parent 2dfcb84
Robert R Evans authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.