cijoe 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -6
- data/lib/cijoe/campfire.rb +7 -10
- data/lib/cijoe/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -75,16 +75,17 @@ Campfire notification is included, because it's what we use. Want Joe
|
|
75
75
|
notify your Campfire? Put this in your repo's `.git/config`:
|
76
76
|
|
77
77
|
[campfire]
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
78
|
+
token = your_api_token
|
79
|
+
subdomain = whatever
|
80
|
+
room = Awesomeness
|
81
|
+
ssl = false
|
82
|
+
|
83
|
+
Note: your API token may differ between subdomains!
|
83
84
|
|
84
85
|
Or do it the old fashion way:
|
85
86
|
|
86
87
|
$ cd yourrepo
|
87
|
-
$ git config --add campfire.
|
88
|
+
$ git config --add campfire.token 98ADFLKJSDOIU7BLAH
|
88
89
|
$ git config --add campfire.subdomain github
|
89
90
|
etc.
|
90
91
|
|
data/lib/cijoe/campfire.rb
CHANGED
@@ -15,8 +15,7 @@ class CIJoe
|
|
15
15
|
puts "Can't load Campfire notifier."
|
16
16
|
puts "Please add the following to your project's .git/config:"
|
17
17
|
puts "[campfire]"
|
18
|
-
puts "\
|
19
|
-
puts "\tpass = passw0rd"
|
18
|
+
puts "\ttoken = your_api_token"
|
20
19
|
puts "\tsubdomain = whatever"
|
21
20
|
puts "\troom = Awesomeness"
|
22
21
|
puts "\tssl = false"
|
@@ -26,16 +25,15 @@ class CIJoe
|
|
26
25
|
def self.config
|
27
26
|
campfire_config = Config.new('campfire', @project_path)
|
28
27
|
@config ||= {
|
29
|
-
:subdomain =>
|
30
|
-
:
|
31
|
-
:
|
32
|
-
:
|
33
|
-
:ssl => campfire_config.ssl.to_s.strip == 'true'
|
28
|
+
:subdomain => Config.campfire(@project_path).subdomain.to_s,
|
29
|
+
:token => Config.campfire(@project_path).token.to_s,
|
30
|
+
:room => Config.campfire(@project_path).room.to_s,
|
31
|
+
:ssl => Config.campfire(@project_path).ssl.to_s.strip == 'true'
|
34
32
|
}
|
35
33
|
end
|
36
34
|
|
37
35
|
def self.valid_config?
|
38
|
-
%w( subdomain
|
36
|
+
%w( subdomain token room ).all? do |key|
|
39
37
|
!config[key.intern].empty?
|
40
38
|
end
|
41
39
|
end
|
@@ -51,8 +49,7 @@ class CIJoe
|
|
51
49
|
@room ||= begin
|
52
50
|
config = Campfire.config
|
53
51
|
campfire = Tinder::Campfire.new(config[:subdomain],
|
54
|
-
:
|
55
|
-
:password => config[:pass],
|
52
|
+
:token => config[:token],
|
56
53
|
:ssl => config[:ssl] || false)
|
57
54
|
campfire.find_room_by_name(config[:room])
|
58
55
|
end
|
data/lib/cijoe/version.rb
CHANGED