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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67122d41e3207dee33537c6d23ce8dcfeb70ad1d
4
- data.tar.gz: d611c3578faa58356e43ad7c16b00ab394449121
3
+ metadata.gz: e9558e10545b92a5f3c7ea96661fa5187319c77d
4
+ data.tar.gz: e625d06a7ccb6e9d248170695f49e7c482cef568
5
5
  SHA512:
6
- metadata.gz: a7a4e80da3dcb364cb8cd0747606e7dca190e11b64292b5c48c251d2217556b6e95980dffd5cc0abd6018e5aac4d05f6231683892be18b0c7c6b693307a60b77
7
- data.tar.gz: f4b4bee8357ec18acdbad8550fe2db6423ce7a491aa14bf9a425051b98590613dc6481a0780e74b242affcb5c32a2b33a2e9a9c1c4b5bf324abde34af71c212d
6
+ metadata.gz: 78d7bab9e232c2da38ad901d0bd24ae97fbc333fa5c343b74215b3b5c77c871a2bae3ba9f4e21f8394e4b1a0c5551505ca0c57e2c1fca940ae25a7843282d684
7
+ data.tar.gz: 07fe0f0972887c1870cf0de11f6d11707d7490bebde87806eed238ac3e6ece276b36a158d7bb9bd881458ce0f18551cdaabb91d6f33d8ff345d98484e41aca62
@@ -13,8 +13,9 @@ module Slacking
13
13
  include Help
14
14
 
15
15
  def run
16
- @token = get_slack_token
17
- @organization = get_slack_organization
16
+ config = get_slack_config
17
+ @token = config[:token]
18
+ @organization = config[:organization]
18
19
  listen
19
20
  end
20
21
 
@@ -6,30 +6,23 @@ module Slacking
6
6
 
7
7
  protected
8
8
 
9
- def get_slack_token(write_options = 'a+')
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[:organization]
23
+ write_config_to_disk(config)
24
+
25
+ config
33
26
  end
34
27
  end
35
28
  end
@@ -48,7 +48,9 @@ module Slacking
48
48
 
49
49
  def handle_response(response)
50
50
  if response.body == 'No hooks'
51
- @token = get_slack_token('w+')
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
@@ -1,3 +1,3 @@
1
1
  module Slacking
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slacking
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Ryan