onesignal 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +17 -0
- data/README.md +5 -3
- data/lib/onesignal/client.rb +12 -2
- data/lib/onesignal/version.rb +1 -1
- data/onesignal.gemspec +3 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d1a29d0d02ff0e3b749a77da48c9af71fef56a9
|
4
|
+
data.tar.gz: 4ac7e0a67d93f3239ef27fc72da955718c7a1741
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2661a29b31b7710a63b0441a39973f20c3b66c16c712974b1bd15aad0f9b349d849909540217c07f5de43f06be1c6551b8029da13d56987d1ebe3e342209f6de
|
7
|
+
data.tar.gz: 8738408d1d19eda8d65bc42995d8445fd46941e074fb4478f982feaec37a86a9832998a121124c71466e90023cd463b31f68ebd83f0553ebf23a640b7e2e4794
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
|
+
|
5
|
+
## [0.2.0] - 2016-04-29
|
6
|
+
### Added
|
7
|
+
* Ruby 2.0 compatibility
|
8
|
+
* CHANGELOG
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
* Typos in README
|
12
|
+
|
13
|
+
## 0.1.0 - 2016-03-29
|
14
|
+
### Added
|
15
|
+
* Methods for all OneSignal resources
|
16
|
+
|
17
|
+
[0.2.0]: https://github.com/coding-chimp/onesignal/compare/v0.1.0...v0.2.0
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# OneSignal
|
2
2
|
|
3
|
-
[![Build Status][trb]][trl] [![Code Climate][ccb]][ccl]
|
3
|
+
[![Gem Version][rgb]][rgl] [![Build Status][trb]][trl] [![Code Climate][ccb]][ccl]
|
4
4
|
|
5
5
|
OneSignal is a simple ruby wrapper for the [OneSignal API][osa].
|
6
6
|
|
@@ -26,12 +26,12 @@ You can find your auth keys and app IDs on the Account Management page when
|
|
26
26
|
you're logged into OneSignal. With those at hand, you can create a client.
|
27
27
|
|
28
28
|
```ruby
|
29
|
-
client = OneSignal::Client.new(
|
29
|
+
client = OneSignal::Client.new(auth_token: 'AUTH_TOKEN', app_id: 'APP_ID')
|
30
30
|
```
|
31
31
|
|
32
32
|
### Design
|
33
33
|
|
34
|
-
This gem follows a strict design of
|
34
|
+
This gem follows a strict design of resources as methods on your client. For
|
35
35
|
examples, for apps, you will call your client like this:
|
36
36
|
|
37
37
|
```ruby
|
@@ -129,6 +129,8 @@ contributors are expected to adhere to the [Contributor Covenant][cc] code of co
|
|
129
129
|
|
130
130
|
The gem is available as open source under the terms of the [MIT License][mit].
|
131
131
|
|
132
|
+
[rgb]: https://img.shields.io/gem/v/onesignal.svg
|
133
|
+
[rgl]: https://rubygems.org/gems/onesignal
|
132
134
|
[trb]: https://travis-ci.org/coding-chimp/onesignal.svg?branch=master
|
133
135
|
[trl]: https://travis-ci.org/coding-chimp/onesignal
|
134
136
|
[ccb]: https://codeclimate.com/github/coding-chimp/onesignal/badges/gpa.svg
|
data/lib/onesignal/client.rb
CHANGED
@@ -4,9 +4,11 @@ module OneSignal
|
|
4
4
|
|
5
5
|
attr_reader :auth_token, :app_id
|
6
6
|
|
7
|
-
def initialize(auth_token
|
7
|
+
def initialize(auth_token: nil, app_id: nil)
|
8
8
|
@auth_token = auth_token
|
9
9
|
@app_id = app_id
|
10
|
+
|
11
|
+
ensure_auth_token_presence
|
10
12
|
end
|
11
13
|
|
12
14
|
def apps
|
@@ -27,8 +29,16 @@ module OneSignal
|
|
27
29
|
|
28
30
|
private
|
29
31
|
|
32
|
+
def ensure_auth_token_presence
|
33
|
+
if auth_token.nil?
|
34
|
+
raise ArgumentError, 'missing keyword: auth_token'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
30
38
|
def ensure_app_id_presence
|
31
|
-
|
39
|
+
if app_id.nil?
|
40
|
+
raise AppIdMissingError
|
41
|
+
end
|
32
42
|
end
|
33
43
|
end
|
34
44
|
end
|
data/lib/onesignal/version.rb
CHANGED
data/onesignal.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
spec.summary = 'Simple wrapper for the OneSignal API.'
|
13
13
|
spec.description = 'Simple wrapper for the OneSignal API.'
|
14
|
-
spec.homepage = 'https://github.com/coding-chimp/onesignal
|
14
|
+
spec.homepage = 'https://github.com/coding-chimp/onesignal'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
@@ -19,6 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
|
+
spec.required_ruby_version = '>= 2.0.0'
|
23
|
+
|
22
24
|
spec.add_development_dependency 'bundler', '~> 1.11'
|
23
25
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
24
26
|
spec.add_development_dependency 'rake', '~> 10.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onesignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bastian Bartmann
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- ".gitignore"
|
77
77
|
- ".rubocop.yml"
|
78
78
|
- ".travis.yml"
|
79
|
+
- CHANGELOG.md
|
79
80
|
- CODE_OF_CONDUCT.md
|
80
81
|
- Gemfile
|
81
82
|
- LICENSE
|
@@ -98,7 +99,7 @@ files:
|
|
98
99
|
- lib/onesignal/resources/player_resource.rb
|
99
100
|
- lib/onesignal/version.rb
|
100
101
|
- onesignal.gemspec
|
101
|
-
homepage: https://github.com/coding-chimp/onesignal
|
102
|
+
homepage: https://github.com/coding-chimp/onesignal
|
102
103
|
licenses:
|
103
104
|
- MIT
|
104
105
|
metadata: {}
|
@@ -110,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
111
|
requirements:
|
111
112
|
- - ">="
|
112
113
|
- !ruby/object:Gem::Version
|
113
|
-
version:
|
114
|
+
version: 2.0.0
|
114
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
116
|
requirements:
|
116
117
|
- - ">="
|