cloud_five_push 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.rspec +2 -0
- data/cloud_five_push.gemspec +1 -0
- data/lib/cloud_five_push/notification.rb +3 -3
- data/lib/cloud_five_push/version.rb +1 -1
- data/spec/notification_spec.rb +18 -0
- data/spec/spec_helper.rb +18 -0
- metadata +22 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjdjMmQzNTFhNjFhNTI0MWM3NTQyNTU4Mzg3MGVlYjcwMTEzYTQ5Yw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDQ2NmExZWRjNDZiZWVkYjg0YjMxN2YxYjIzODMyZjI4OTc1MjgzZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmRkYTJjMTIwNTY5ZDBhOTE4YjAzODYwOWM1MjkyNWYzZjY2OGIyMWU3YzMw
|
10
|
+
MTk1NDc2ZTdmN2E3ODRjYjQ5YjhiNWY0MGI5YzlmOWRiYTBkODZlYzFkZTg1
|
11
|
+
MjZhOTY4YzllMDQzNmJkOTBmZjliNGYyMTgwM2NlOGE0YTEyMzk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjE4M2MzMGRkNjUyMGQwNDYxMjIwMDNiOTE1ZmIzOTVmMTVmMTM5ZDM4OTZh
|
14
|
+
ODVmYjU3NGM3ZjkzOGQxNDM2ZGRkMjU0NjM1OTFmNTA5ZmQ0NTU2OGI2NTEx
|
15
|
+
OWNjYWViZmJiMmRlNTM0NzAxMGYyNmNkNzZjZTFhNmEwZGZiNGE=
|
data/.rspec
ADDED
data/cloud_five_push.gemspec
CHANGED
@@ -23,7 +23,7 @@ module CloudFivePush
|
|
23
23
|
if blank_param?(@alert) && blank_param?(@badge)
|
24
24
|
raise "Please set alert or badge"
|
25
25
|
end
|
26
|
-
if @broadcast && !blank_param?(@
|
26
|
+
if @broadcast && !blank_param?(@user_identifiers)
|
27
27
|
raise "Can't both broadcast and set user_identifiers"
|
28
28
|
end
|
29
29
|
|
@@ -45,8 +45,8 @@ module CloudFivePush
|
|
45
45
|
self.class.post('/push/notify', body: params)
|
46
46
|
end
|
47
47
|
|
48
|
-
def user_identifiers=(
|
49
|
-
@
|
48
|
+
def user_identifiers=(user_identifiers)
|
49
|
+
@user_identifiers = [user_identifiers].flatten
|
50
50
|
end
|
51
51
|
|
52
52
|
private
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe CloudFivePush::Notification do
|
4
|
+
before(:all) { CloudFivePush.api_key = "fake" }
|
5
|
+
context "Setting user identifiers" do
|
6
|
+
let(:notification) { CloudFivePush::Notification.new }
|
7
|
+
it "accepts an array of identifiers" do
|
8
|
+
notification.user_identifiers = [1,2,3]
|
9
|
+
expect(notification.user_identifiers).to eq [1,2,3]
|
10
|
+
end
|
11
|
+
|
12
|
+
it "accepts a single user_identifier" do
|
13
|
+
notification.user_identifiers = 1
|
14
|
+
expect(notification.user_identifiers).to eq [1]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'cloud_five_push'
|
2
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
3
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
4
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
5
|
+
# loaded once.
|
6
|
+
#
|
7
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
8
|
+
RSpec.configure do |config|
|
9
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
10
|
+
config.run_all_when_everything_filtered = true
|
11
|
+
config.filter_run :focus
|
12
|
+
|
13
|
+
# Run specs in random order to surface order dependencies. If you find an
|
14
|
+
# order dependency and want to debug it, you can fix the order by providing
|
15
|
+
# the seed, which is printed after each run.
|
16
|
+
# --seed 1234
|
17
|
+
config.order = 'random'
|
18
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud_five_push
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Samson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: httparty
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,6 +74,7 @@ extensions: []
|
|
60
74
|
extra_rdoc_files: []
|
61
75
|
files:
|
62
76
|
- .gitignore
|
77
|
+
- .rspec
|
63
78
|
- Gemfile
|
64
79
|
- LICENSE.txt
|
65
80
|
- README.md
|
@@ -68,6 +83,8 @@ files:
|
|
68
83
|
- lib/cloud_five_push.rb
|
69
84
|
- lib/cloud_five_push/notification.rb
|
70
85
|
- lib/cloud_five_push/version.rb
|
86
|
+
- spec/notification_spec.rb
|
87
|
+
- spec/spec_helper.rb
|
71
88
|
homepage: ''
|
72
89
|
licenses:
|
73
90
|
- MIT
|
@@ -92,4 +109,6 @@ rubygems_version: 2.2.2
|
|
92
109
|
signing_key:
|
93
110
|
specification_version: 4
|
94
111
|
summary: Wraps the API for push.cloudfiveapp.com
|
95
|
-
test_files:
|
112
|
+
test_files:
|
113
|
+
- spec/notification_spec.rb
|
114
|
+
- spec/spec_helper.rb
|