pushover 1.0.2 → 1.0.3

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: 0e2a717fd5728c512f6c58a9fef3f1e40a8b3103
4
- data.tar.gz: 020060276a59e65b83fc5a363dcfe7013f5e534e
3
+ metadata.gz: 5a70f1e785179b7356c2c887632f283de549006f
4
+ data.tar.gz: d54b26659eeefb08394b6c266af442832182f5d7
5
5
  SHA512:
6
- metadata.gz: fd7f18dfbd1b3584b5ef27c45a6f011c02f9465cdcda9258ee343bffe465c79b57c3bccefa0a405a8989cbbd53410193111c9ae79bf5a06aaad01e7554d0e70d
7
- data.tar.gz: 6941590b5140b4c38bd173e21d090b7c3f026ed8a8dd023668cf83aaf30af9e37bb9121fdbdc2e357c785800bb8b5f4f88353964419d50be4c4f04911a24c7dd
6
+ metadata.gz: 465930a2259084a11269263cd8eb5d4048a9c0551c9214e282bbc6277684f271686812acbd80dc26558325cd6ef9ccc5badddf97c8ca51f6100322fa8296daf6
7
+ data.tar.gz: d3e911be81b0e044f3dde95a06c114d3f8ad8005a64e2de665aa2aeb829bcbb7edbb4de342d73d4b5d5d0defac475b0153787b2ea139e8c7abe3c4be5cecb90e
@@ -13,8 +13,8 @@ Options.on("-c", "--config_file [FILE]", "Set the target config file.") {|o| Opt
13
13
  Options.on("--url [URL]", "Supplementary URL") { |o| Options[:url] = o }
14
14
  Options.on("--url_title [TITLE]", "Supplementary URL title.") { |o| Options[:url_title] = o }
15
15
  Options.on("--time [TIME]", "Set the messages time.") {|o| Options[:timestamp] = o}
16
- Options.on("--save-app NAME", "Saves the application to the config file under NAME.") { |o| Options[:save_app] = [Options[:appkey], o]}
17
- Options.on("--save-user NAME", "Saves the user to the config file under NAME.") { |o| Options[:save_user] = [Options[:user], o]}
16
+ Options.on("--save-app NAME", "Saves the application to the config file under NAME.") { |o| Options[:save_app] = o}
17
+ Options.on("--save-user NAME", "Saves the user to the config file under NAME.") { |o| Options[:save_user] = o}
18
18
  Options.on("--sound [SOUND]", "Specify the sound to use. Can be a partial string as long as it is unambiguous enough.") { |o| Options[:sound] = o}
19
19
  Options.on("--sound_list", "Display the current list of available sounds. Requires an app token.") { |o| Options[:sound_list] = true}
20
20
  Options.on("--emergency_retry [TIME]", "The time in seconds between retries.") { |o| Options[:retry] = o}
@@ -29,17 +29,20 @@ bail = false
29
29
  if Options[:config_file]
30
30
  Bini::Config.options[:file] = Options[:config_file]
31
31
  puts "Selected config file: #{Options[:config_file]}"
32
+ # TODO: Make a healper for changing config so it clears/loads automatically.
33
+ Bini::Config.clear
34
+ Bini::Config.load
32
35
  end
33
36
 
34
37
  if Options[:save_app]
35
- App.add Options[:save_app][1], Options[:save_app][0]
36
- puts "Saved application #{Options[:save_app][0]} to #{Options[:save_app][1]}."
38
+ App.add Options[:save_app], Options[:token]
39
+ puts "Saved application #{Options[:token]} to #{Options[:save_app]}."
37
40
  bail = true
38
41
  end
39
42
 
40
43
  if Options[:save_user]
41
- User.add Options[:save_user][1], Options[:save_user][0]
42
- puts "Saved user #{Options[:save_user][0]} to #{Options[:save_user][1]}."
44
+ User.add Options[:save_user], Options[:user]
45
+ puts "Saved user #{Options[:user]} to #{Options[:save_user]}."
43
46
  bail = true
44
47
  end
45
48
 
@@ -1,4 +1,4 @@
1
1
  module Pushover
2
2
  # The current version of Pushover.
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
@@ -50,16 +50,18 @@ if ENV["TEST_CLI"] =~ /^t/
50
50
 
51
51
  describe "saving" do
52
52
  it "saves app:key pairs" do
53
- p = CLIProcess.new "#{CMD} --config_file #{FAKE_CRED_FILE} --save-app default --app default"
53
+ p = CLIProcess.new "#{CMD} --config_file #{FAKE_CRED_FILE} --save-app saveapp --app application"
54
54
  p.run!
55
55
  p.stdout.should include 'Saved'
56
- open(FAKE_CRED_FILE).read.should include 'default'
56
+ output = YAML.load open(FAKE_CRED_FILE).read
57
+ output[:applications]["saveapp"].should eq 'application'
57
58
  end
58
59
  it "saves user:token pairs" do
59
- p = CLIProcess.new "#{CMD} --config_file #{FAKE_CRED_FILE} --save-user default --user default"
60
+ p = CLIProcess.new "#{CMD} --config_file #{FAKE_CRED_FILE} --save-user saveuser --user user"
60
61
  p.run!
61
62
  p.stdout.should include 'Saved'
62
- open(FAKE_CRED_FILE).read.should include 'default'
63
+ output = YAML.load open(FAKE_CRED_FILE).read
64
+ output[:users]["saveuser"].should eq 'user'
63
65
  end
64
66
  end
65
67
  describe "sounds" do
@@ -1,3 +1,6 @@
1
+ ## 1.0.3
2
+ * Fixed the save option to properly store the appkey and user key (@cptobvious for this). As a result I added tests and cleaned up some internal code.
3
+
1
4
  ## 1.0.2
2
5
  * hotfixes
3
6
  * #13 added license to the gemspec
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushover
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernie Brodeur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-26 00:00:00.000000000 Z
11
+ date: 2013-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yajl-ruby