slacking 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/slacking.rb +3 -2
- data/lib/slacking/config.rb +4 -11
- data/lib/slacking/http_client.rb +3 -1
- data/lib/slacking/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9558e10545b92a5f3c7ea96661fa5187319c77d
|
4
|
+
data.tar.gz: e625d06a7ccb6e9d248170695f49e7c482cef568
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78d7bab9e232c2da38ad901d0bd24ae97fbc333fa5c343b74215b3b5c77c871a2bae3ba9f4e21f8394e4b1a0c5551505ca0c57e2c1fca940ae25a7843282d684
|
7
|
+
data.tar.gz: 07fe0f0972887c1870cf0de11f6d11707d7490bebde87806eed238ac3e6ece276b36a158d7bb9bd881458ce0f18551cdaabb91d6f33d8ff345d98484e41aca62
|
data/lib/slacking.rb
CHANGED
data/lib/slacking/config.rb
CHANGED
@@ -6,30 +6,23 @@ module Slacking
|
|
6
6
|
|
7
7
|
protected
|
8
8
|
|
9
|
-
def
|
9
|
+
def get_slack_config(write_options = 'a+')
|
10
10
|
create_config_dir
|
11
11
|
config = read_config_from_disk || {}
|
12
12
|
|
13
13
|
unless config[:token]
|
14
14
|
puts "Please enter your slack api token:\n"
|
15
15
|
config.merge!(token: get_action)
|
16
|
-
write_config_to_disk(config)
|
17
16
|
end
|
18
17
|
|
19
|
-
config[:token]
|
20
|
-
end
|
21
|
-
|
22
|
-
def get_slack_organization(write_options = 'a+')
|
23
|
-
create_config_dir
|
24
|
-
config = read_config_from_disk || {}
|
25
|
-
|
26
18
|
unless config[:organization]
|
27
19
|
puts "Please enter your slack organization (i.e. https://{organization}.slack.com):\n"
|
28
20
|
config.merge!(organization: get_action)
|
29
|
-
write_config_to_disk(config)
|
30
21
|
end
|
31
22
|
|
32
|
-
config
|
23
|
+
write_config_to_disk(config)
|
24
|
+
|
25
|
+
config
|
33
26
|
end
|
34
27
|
end
|
35
28
|
end
|
data/lib/slacking/http_client.rb
CHANGED
@@ -48,7 +48,9 @@ module Slacking
|
|
48
48
|
|
49
49
|
def handle_response(response)
|
50
50
|
if response.body == 'No hooks'
|
51
|
-
|
51
|
+
config = get_slack_config('w+')
|
52
|
+
@token = config[:token]
|
53
|
+
@organization = config[:organization]
|
52
54
|
else
|
53
55
|
puts response.body
|
54
56
|
end
|
data/lib/slacking/version.rb
CHANGED