j7w1 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/j7w1.gemspec +1 -1
- data/lib/j7_w1/{stub.rb → mock.rb} +0 -0
- data/lib/j7_w1/push_client.rb +30 -2
- data/lib/j7_w1/version.rb +1 -1
- data/spec/config.example.yml +1 -1
- metadata +3 -5
- data/.gitignore +0 -17
- data/Rakefile +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd7bf02bf7f31fdbbfbf6bd4df8c0ae973aa34f5
|
4
|
+
data.tar.gz: 5e174eecc3cacaa92069d711e9c9ed90734c20df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e01923d701f151179037030225e262cb83dc6a7a0fe39f83d8e402a8cc4b498567eae396c98c7e838210cab271b5e9a42f7ca2331e22e4da1a88c6d2252a6be
|
7
|
+
data.tar.gz: 0b2ba4533938b3b3a747bd7e94eab11889e495352d6cce691162dba24e76ffac2c834f626f20af09f3b03332639788296daa80d4b788d6467079782e2564b146
|
data/j7w1.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.files = `git ls-files Gemfile LICENSE.txt README.md j7w1.gemspec lib spec`.split($/)
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
File without changes
|
data/lib/j7_w1/push_client.rb
CHANGED
@@ -4,6 +4,25 @@ module J7W1
|
|
4
4
|
AWS::SNS.new J7W1.configuration.account
|
5
5
|
end
|
6
6
|
|
7
|
+
def create_ios_application(name, certs, private_key, options)
|
8
|
+
sandbox = !(options[:sandbox] == false)
|
9
|
+
configuration = options[:sns_configuration] || J7W1.configuration
|
10
|
+
|
11
|
+
private_key = content_from private_key
|
12
|
+
certs = content_from certs
|
13
|
+
|
14
|
+
sns_client = options[:sns_client] || create_sns_client(configuration)
|
15
|
+
|
16
|
+
application_endpoint =
|
17
|
+
sns_client.client.create_platform_application name: name,
|
18
|
+
platform: (sandbox ? 'APNS_SANDBOX' : 'APNS'),
|
19
|
+
attributes: {
|
20
|
+
'PlatformCredential' => private_key,
|
21
|
+
'PlatformPrincipal' => certs,
|
22
|
+
}
|
23
|
+
application_endpoint[:platform_application_arn]
|
24
|
+
end
|
25
|
+
|
7
26
|
def create_device_endpoint(device_identifier, platform, options = {})
|
8
27
|
custom_user_data = options[:custom_user_data]
|
9
28
|
sns_configuration = options[:sns_configuration]
|
@@ -77,7 +96,16 @@ module J7W1
|
|
77
96
|
# TODO Android Push Implementation
|
78
97
|
end
|
79
98
|
|
80
|
-
|
81
|
-
|
99
|
+
def content_from(argument)
|
100
|
+
case argument
|
101
|
+
when IO
|
102
|
+
argument.read
|
103
|
+
when String
|
104
|
+
argument
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
module_function :create_sns_client, :create_ios_application, :create_device_endpoint, :push,
|
109
|
+
:payload_for, :ios_payload_for, :android_payload_for, :content_from
|
82
110
|
end
|
83
111
|
end
|
data/lib/j7_w1/version.rb
CHANGED
data/spec/config.example.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: j7w1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- condor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -73,11 +73,9 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- .gitignore
|
77
76
|
- Gemfile
|
78
77
|
- LICENSE.txt
|
79
78
|
- README.md
|
80
|
-
- Rakefile
|
81
79
|
- j7w1.gemspec
|
82
80
|
- lib/generators/j7_w1/migration/migration_generator.rb
|
83
81
|
- lib/generators/j7_w1/migration/templates/active_record/migration.rb
|
@@ -88,8 +86,8 @@ files:
|
|
88
86
|
- lib/j7_w1/active_record_ext.rb
|
89
87
|
- lib/j7_w1/concrete.rb
|
90
88
|
- lib/j7_w1/configuration.rb
|
89
|
+
- lib/j7_w1/mock.rb
|
91
90
|
- lib/j7_w1/push_client.rb
|
92
|
-
- lib/j7_w1/stub.rb
|
93
91
|
- lib/j7_w1/version.rb
|
94
92
|
- lib/j7w1.rb
|
95
93
|
- spec/.gitignore
|
data/.gitignore
DELETED
data/Rakefile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require "bundler/gem_tasks"
|