pwush 0.0.0 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +64 -0
- data/.gitignore +1 -0
- data/Gemfile.lock +76 -2
- data/README.md +11 -6
- data/bin/console +3 -3
- data/lib/pwush/client.rb +13 -10
- data/lib/pwush/{notification.rb → message.rb} +109 -79
- data/lib/pwush/request.rb +1 -5
- data/lib/pwush/response/deffered.rb +53 -0
- data/lib/pwush/response/value.rb +11 -0
- data/lib/pwush/response.rb +17 -0
- data/lib/pwush/version.rb +1 -1
- data/lib/pwush.rb +7 -8
- data/pwush.gemspec +25 -17
- metadata +127 -10
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aaa9bec7f09191281344c77afb61d0de59852570
|
4
|
+
data.tar.gz: cac9d2719b8e21e063faa2d2ff2c8785a3317804
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4357cbe52d3f48562f57be99bfb198e7dec8b601df355b0c7549cf305aece196c622c45f27cdeaddd24c6735c1e09ec0c9bd17eb978f86525684b9cb4c9a123d
|
7
|
+
data.tar.gz: 128fb28825c1a47baabc2320e15a40892ee9161abc61dc8903759b18a76c21f8f34383769f984424f22600ba6afdfae04eb898311d207b0f04db5e35054e9ac2
|
@@ -0,0 +1,64 @@
|
|
1
|
+
version: 2.0
|
2
|
+
defaults: &default_job
|
3
|
+
working_directory: ~/repo
|
4
|
+
|
5
|
+
docker:
|
6
|
+
- image: circleci/ruby:2.4-node-browsers
|
7
|
+
|
8
|
+
steps:
|
9
|
+
- checkout
|
10
|
+
|
11
|
+
- type: cache-restore
|
12
|
+
name: Restore bundle cache
|
13
|
+
key: pwush-{{ checksum "Gemfile.lock" }}
|
14
|
+
|
15
|
+
- run:
|
16
|
+
name: install dependencies
|
17
|
+
command: |
|
18
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
19
|
+
|
20
|
+
- type: cache-save
|
21
|
+
name: Store bundle cache
|
22
|
+
key: pwush-{{ checksum "Gemfile.lock" }}
|
23
|
+
paths:
|
24
|
+
- vendor/bundle
|
25
|
+
|
26
|
+
- run:
|
27
|
+
name: Download cc-test-reporter
|
28
|
+
command: |
|
29
|
+
mkdir -p tmp/
|
30
|
+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
|
31
|
+
chmod +x ./tmp/cc-test-reporter
|
32
|
+
|
33
|
+
- run:
|
34
|
+
name: Run tests
|
35
|
+
command: |
|
36
|
+
bundle exec rake
|
37
|
+
./tmp/cc-test-reporter format-coverage -t simplecov -o tmp/codeclimate.json
|
38
|
+
|
39
|
+
- run:
|
40
|
+
name: Upload coverage results to Code Climate
|
41
|
+
command: |
|
42
|
+
./tmp/cc-test-reporter upload-coverage -i tmp/codeclimate.json -r ce337e25b76b0c3048abfdb2d5aa6d3e87cc8540d90f0029ef7416683814732e
|
43
|
+
|
44
|
+
jobs:
|
45
|
+
ruby-2.3:
|
46
|
+
<<: *default_job
|
47
|
+
docker:
|
48
|
+
- image: circleci/ruby:2.3-node-browsers
|
49
|
+
ruby-2.4:
|
50
|
+
<<: *default_job
|
51
|
+
docker:
|
52
|
+
- image: circleci/ruby:2.4-node-browsers
|
53
|
+
ruby-2.5:
|
54
|
+
<<: *default_job
|
55
|
+
docker:
|
56
|
+
- image: circleci/ruby:2.5-node-browsers
|
57
|
+
|
58
|
+
workflows:
|
59
|
+
version: 2
|
60
|
+
multiple-rubies:
|
61
|
+
jobs:
|
62
|
+
- ruby-2.3
|
63
|
+
- ruby-2.4
|
64
|
+
- ruby-2.5
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,21 +1,77 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
4
|
+
pwush (0.1.0)
|
5
|
+
dry-monads (~> 0.4)
|
6
|
+
dry-struct (~> 0.4)
|
7
|
+
dry-types (~> 0.12)
|
8
|
+
http (~> 3.0)
|
9
|
+
oj (~> 3)
|
5
10
|
|
6
11
|
GEM
|
7
12
|
remote: https://rubygems.org/
|
8
13
|
specs:
|
14
|
+
addressable (2.5.2)
|
15
|
+
public_suffix (>= 2.0.2, < 4.0)
|
9
16
|
byebug (10.0.2)
|
10
17
|
coderay (1.1.2)
|
18
|
+
concurrent-ruby (1.0.5)
|
19
|
+
crack (0.4.3)
|
20
|
+
safe_yaml (~> 1.0.0)
|
11
21
|
diff-lcs (1.3)
|
22
|
+
docile (1.3.0)
|
23
|
+
domain_name (0.5.20170404)
|
24
|
+
unf (>= 0.0.5, < 1.0.0)
|
25
|
+
dry-configurable (0.7.0)
|
26
|
+
concurrent-ruby (~> 1.0)
|
27
|
+
dry-container (0.6.0)
|
28
|
+
concurrent-ruby (~> 1.0)
|
29
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
30
|
+
dry-core (0.4.5)
|
31
|
+
concurrent-ruby (~> 1.0)
|
32
|
+
dry-equalizer (0.2.0)
|
33
|
+
dry-logic (0.4.2)
|
34
|
+
dry-container (~> 0.2, >= 0.2.6)
|
35
|
+
dry-core (~> 0.2)
|
36
|
+
dry-equalizer (~> 0.2)
|
37
|
+
dry-monads (0.4.0)
|
38
|
+
dry-core (~> 0.3, >= 0.3.3)
|
39
|
+
dry-equalizer
|
40
|
+
dry-struct (0.4.0)
|
41
|
+
dry-core (~> 0.4, >= 0.4.1)
|
42
|
+
dry-equalizer (~> 0.2)
|
43
|
+
dry-types (~> 0.12, >= 0.12.2)
|
44
|
+
ice_nine (~> 0.11)
|
45
|
+
dry-types (0.12.2)
|
46
|
+
concurrent-ruby (~> 1.0)
|
47
|
+
dry-configurable (~> 0.1)
|
48
|
+
dry-container (~> 0.3)
|
49
|
+
dry-core (~> 0.2, >= 0.2.1)
|
50
|
+
dry-equalizer (~> 0.2)
|
51
|
+
dry-logic (~> 0.4, >= 0.4.2)
|
52
|
+
inflecto (~> 0.0.0, >= 0.0.2)
|
53
|
+
hashdiff (0.3.7)
|
54
|
+
http (3.0.0)
|
55
|
+
addressable (~> 2.3)
|
56
|
+
http-cookie (~> 1.0)
|
57
|
+
http-form_data (>= 2.0.0.pre.pre2, < 3)
|
58
|
+
http_parser.rb (~> 0.6.0)
|
59
|
+
http-cookie (1.0.3)
|
60
|
+
domain_name (~> 0.5)
|
61
|
+
http-form_data (2.1.0)
|
62
|
+
http_parser.rb (0.6.0)
|
63
|
+
ice_nine (0.11.2)
|
64
|
+
inflecto (0.0.2)
|
65
|
+
json (2.1.0)
|
12
66
|
method_source (0.9.0)
|
67
|
+
oj (3.5.0)
|
13
68
|
pry (0.11.3)
|
14
69
|
coderay (~> 1.1.0)
|
15
70
|
method_source (~> 0.9.0)
|
16
71
|
pry-byebug (3.6.0)
|
17
72
|
byebug (~> 10.0)
|
18
73
|
pry (~> 0.10)
|
74
|
+
public_suffix (3.0.2)
|
19
75
|
rake (10.5.0)
|
20
76
|
rspec (3.7.0)
|
21
77
|
rspec-core (~> 3.7.0)
|
@@ -30,16 +86,34 @@ GEM
|
|
30
86
|
diff-lcs (>= 1.2.0, < 2.0)
|
31
87
|
rspec-support (~> 3.7.0)
|
32
88
|
rspec-support (3.7.1)
|
89
|
+
rspec_junit_formatter (0.3.0)
|
90
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
91
|
+
safe_yaml (1.0.4)
|
92
|
+
simplecov (0.16.1)
|
93
|
+
docile (~> 1.1)
|
94
|
+
json (>= 1.8, < 3)
|
95
|
+
simplecov-html (~> 0.10.0)
|
96
|
+
simplecov-html (0.10.2)
|
97
|
+
unf (0.1.4)
|
98
|
+
unf_ext
|
99
|
+
unf_ext (0.0.7.5)
|
100
|
+
webmock (3.3.0)
|
101
|
+
addressable (>= 2.3.6)
|
102
|
+
crack (>= 0.3.2)
|
103
|
+
hashdiff
|
33
104
|
|
34
105
|
PLATFORMS
|
35
106
|
ruby
|
36
107
|
|
37
108
|
DEPENDENCIES
|
38
|
-
Pwush!
|
39
109
|
bundler (~> 1.16)
|
40
110
|
pry-byebug
|
111
|
+
pwush!
|
41
112
|
rake (~> 10.0)
|
42
113
|
rspec (~> 3.0)
|
114
|
+
rspec_junit_formatter
|
115
|
+
simplecov
|
116
|
+
webmock (~> 3.0)
|
43
117
|
|
44
118
|
BUNDLED WITH
|
45
119
|
1.16.1
|
data/README.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
-
|
1
|
+
[![CircleCI](https://circleci.com/gh/iarie/pwush/tree/master.svg?style=shield)](https://circleci.com/gh/iarie/pwush/tree/master)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/pwush.svg)](https://badge.fury.io/rb/pwush)
|
3
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/d1887381dee84e26e860/maintainability)](https://codeclimate.com/github/iarie/pwush/maintainability)
|
4
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/d1887381dee84e26e860/test_coverage)](https://codeclimate.com/github/iarie/pwush/test_coverage)
|
2
5
|
|
3
|
-
|
6
|
+
# Pwush
|
7
|
+
|
8
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/pwush.rb`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
9
|
|
5
10
|
TODO: Delete this and the text above, and describe your gem
|
6
11
|
|
@@ -9,7 +14,7 @@ TODO: Delete this and the text above, and describe your gem
|
|
9
14
|
Add this line to your application's Gemfile:
|
10
15
|
|
11
16
|
```ruby
|
12
|
-
gem '
|
17
|
+
gem 'pwush'
|
13
18
|
```
|
14
19
|
|
15
20
|
And then execute:
|
@@ -18,7 +23,7 @@ And then execute:
|
|
18
23
|
|
19
24
|
Or install it yourself as:
|
20
25
|
|
21
|
-
$ gem install
|
26
|
+
$ gem install pwush
|
22
27
|
|
23
28
|
## Usage
|
24
29
|
|
@@ -32,7 +37,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
37
|
|
33
38
|
## Contributing
|
34
39
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
40
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/iarie/pwush. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
41
|
|
37
42
|
## License
|
38
43
|
|
@@ -40,4 +45,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
40
45
|
|
41
46
|
## Code of Conduct
|
42
47
|
|
43
|
-
Everyone interacting in the PwRb project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
48
|
+
Everyone interacting in the PwRb project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/iarie/pwush/blob/master/CODE_OF_CONDUCT.md).
|
data/bin/console
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'pwush'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
8
8
|
|
9
9
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
require
|
10
|
+
require 'pry'
|
11
11
|
Pry.start
|
data/lib/pwush/client.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
|
+
require 'http'
|
2
|
+
|
1
3
|
module Pwush
|
2
4
|
class Client
|
3
5
|
def initialize(options)
|
4
6
|
@config = Config.new(options)
|
5
7
|
end
|
6
8
|
|
7
|
-
def create_message(*
|
8
|
-
post(:createMessage, notifications:
|
9
|
+
def create_message(*messages)
|
10
|
+
post(:createMessage, notifications: messages)
|
9
11
|
end
|
10
12
|
alias push create_message
|
11
13
|
|
@@ -33,6 +35,10 @@ module Pwush
|
|
33
35
|
post(:getPreset, preset_code: preset_code)
|
34
36
|
end
|
35
37
|
|
38
|
+
def fail
|
39
|
+
post(:someshit, shit: 'crap')
|
40
|
+
end
|
41
|
+
|
36
42
|
private
|
37
43
|
|
38
44
|
def get(action, payload = nil)
|
@@ -44,18 +50,15 @@ module Pwush
|
|
44
50
|
end
|
45
51
|
|
46
52
|
def perform_request(verb, action, payload)
|
47
|
-
|
48
|
-
verb, url(action), json: build_request(payload).body
|
49
|
-
)
|
50
|
-
parse_response(response)
|
53
|
+
Response.wrap { raw_request(verb, action, payload) }
|
51
54
|
end
|
52
55
|
|
53
|
-
def
|
54
|
-
|
56
|
+
def raw_request(verb, action, payload)
|
57
|
+
Http.request(verb, url(action), json: build_request(payload).body)
|
55
58
|
end
|
56
59
|
|
57
|
-
def
|
58
|
-
|
60
|
+
def build_request(payload = nil)
|
61
|
+
Request.new(auth: @config.auth, app: @config.app, payload: payload)
|
59
62
|
end
|
60
63
|
|
61
64
|
def url(action)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Pwush
|
2
|
-
class
|
2
|
+
class Message < Dry::Struct
|
3
3
|
# https://www.pushwoosh.com/v1.0/reference#createmessage
|
4
4
|
|
5
|
-
constructor_type :
|
5
|
+
constructor_type :strict_with_defaults
|
6
6
|
|
7
7
|
# YYYY-MM-DD HH:mm OR 'now'
|
8
8
|
attribute :send_date, Types::Strict::String.default('now')
|
@@ -11,11 +11,11 @@ module Pwush
|
|
11
11
|
|
12
12
|
# "timezone":"America/New_York", optional, if ignored UTC-0 is default in "send_date".
|
13
13
|
# See http://php.net/manual/timezones.php for supported timezones
|
14
|
-
attribute :timezone, Types::Strict::String.optional
|
14
|
+
attribute :timezone, Types::Strict::String.optional.default('UTC-0')
|
15
15
|
|
16
16
|
# "campaign":"CAMPAIGN_CODE", optional.
|
17
17
|
# Campaign code to which you want to assign this push message
|
18
|
-
attribute :campaign, Types::Strict::String.optional
|
18
|
+
attribute :campaign, Types::Strict::String.optional.default(nil)
|
19
19
|
|
20
20
|
# "content":{
|
21
21
|
# "en":"English",
|
@@ -25,21 +25,21 @@ module Pwush
|
|
25
25
|
attribute :content, Types::Strict::String | Types::Hash
|
26
26
|
|
27
27
|
# "page_id": 39, optional. HTML Pages. integer
|
28
|
-
attribute :page_id, Types::Strict::
|
28
|
+
attribute :page_id, Types::Strict::Int.optional.default(nil)
|
29
29
|
|
30
30
|
# "rich_page_id": 42, optional. Rich Pages. integer
|
31
|
-
attribute :rich_page_id, Types::Strict::
|
31
|
+
attribute :rich_page_id, Types::Strict::Int.optional.default(nil)
|
32
32
|
|
33
33
|
# "rich_media": "XXXX-XXXX", optional. Rich Media code. string
|
34
|
-
attribute :rich_media, Types::Strict::String.optional
|
34
|
+
attribute :rich_media, Types::Strict::String.optional.default(nil)
|
35
35
|
|
36
36
|
# "remote_page" : "http://myremoteurl.com",
|
37
37
|
# Remote Rich HTML Page URL. <scheme>://<authority>
|
38
|
-
attribute :remote_page, Types::Strict::String.optional
|
38
|
+
attribute :remote_page, Types::Strict::String.optional.default(nil)
|
39
39
|
|
40
40
|
# "link": "http://google.com", optional, string.
|
41
41
|
# For deeplinks add "minimize_link":0
|
42
|
-
attribute :link, Types::Strict::String.optional
|
42
|
+
attribute :link, Types::Strict::String.optional.default(nil)
|
43
43
|
|
44
44
|
# "minimize_link": 0, optional.
|
45
45
|
# False or 0 - do not minimize, 1 - Google, 2 - bitly. Default = 1
|
@@ -47,68 +47,68 @@ module Pwush
|
|
47
47
|
|
48
48
|
# "data": {"key":"value"}, JSON string or JSON object,
|
49
49
|
# will be passed as "u" parameter in the payload (converted to JSON string)
|
50
|
-
attribute :data, Types::Strict::String
|
50
|
+
attribute :data, (Types::Strict::String | Types::Hash).optional.default(nil)
|
51
51
|
|
52
52
|
# 1 - iOS; 2 - BB; 3 - Android; 5 - Windows Phone; 7 - OS X; 8 - Windows 8;
|
53
53
|
# 9 - Amazon; 10 - Safari; 11 - Chrome; 12 - Firefox;
|
54
54
|
# ignored if "devices" < 10
|
55
55
|
Platforms = Types::Strict::Int.enum(1, 2, 3, 5, 7, 8, 9, 10, 11, 12)
|
56
|
-
attribute :platforms, Types::Strict::Array.of(Platforms).optional
|
56
|
+
attribute :platforms, Types::Strict::Array.of(Platforms).optional.default(nil)
|
57
57
|
|
58
58
|
# "preset":"Q1A2Z-6X8SW", Push Preset Code from your Control Panel
|
59
|
-
attribute :preset, Types::Strict::String.optional
|
59
|
+
attribute :preset, Types::Strict::String.optional.default(nil)
|
60
60
|
|
61
61
|
# "send_rate": 100, throttling. Valid values are from 100 to 1000 pushes/second.
|
62
|
-
attribute :send_rate, Types::Strict::Int.
|
62
|
+
attribute :send_rate, Types::Strict::Int.constrained(included_in: 100..1000).optional.default(nil)
|
63
63
|
|
64
64
|
# Optional. Specify tokens or hwids to send targeted push notifications.
|
65
65
|
# Not more than 1000 tokens/hwids in an array.
|
66
66
|
# If set, the message will only be sent to the devices on the list.
|
67
67
|
# Ignored if the Applications Group is used. iOS push tokens can only be lower case.
|
68
|
-
attribute :devices, Types::Strict::Array.of(Types::Strict::String).optional
|
68
|
+
attribute :devices, Types::Strict::Array.of(Types::Strict::String).optional.default(nil)
|
69
69
|
|
70
70
|
# "users":["user_3078a"], optional.
|
71
71
|
# If set, message will only be delivered to the specified users Id's
|
72
72
|
# (specified via /registerUser call).
|
73
73
|
# If specified together with devices parameter, the latter will be ignored.
|
74
|
-
attribute :users, Types::Strict::Array.of(Types::Strict::String).optional
|
74
|
+
attribute :users, Types::Strict::Array.of(Types::Strict::String).optional.default(nil)
|
75
75
|
|
76
76
|
# "filter": "FILTER_NAME", optional.
|
77
|
-
attribute :filter, Types::Strict::String.optional
|
77
|
+
attribute :filter, Types::Strict::String.optional.default(nil)
|
78
78
|
|
79
79
|
# optional, placeholders for dynamic content instead of device tags
|
80
80
|
# "dynamic_content_placeholders" :{
|
81
81
|
# "firstname":"John",
|
82
82
|
# "lastname":"Doe"
|
83
83
|
# },
|
84
|
-
attribute :dynamic_content_placeholders, Types::Hash.optional
|
84
|
+
attribute :dynamic_content_placeholders, Types::Hash.optional.default(nil)
|
85
85
|
|
86
86
|
# "conditions": [TAG_CONDITION1, TAG_CONDITION2, ..., TAG_CONDITIONN],
|
87
87
|
# Optional.
|
88
|
-
attribute :conditions, Types::Strict::Array.of(Types::Strict::String).optional
|
88
|
+
attribute :conditions, Types::Strict::Array.of(Types::Strict::String).optional.default(nil)
|
89
89
|
|
90
90
|
# iOS related
|
91
91
|
|
92
92
|
# "ios_badges": 5, optional, integer.
|
93
93
|
# iOS application badge number.
|
94
94
|
# Use "+n" or "-n" to increment/decrement the badge value by n
|
95
|
-
attribute :ios_badges, Types::Strict::Int.optional
|
95
|
+
attribute :ios_badges, Types::Strict::Int.optional.default(nil)
|
96
96
|
|
97
97
|
# "ios_sound": "sound file.wav", optional.
|
98
98
|
# Sound file name in the main bundle of application.
|
99
99
|
# If left empty, the device will produce no sound upon receiving a push
|
100
|
-
attribute :ios_sound, Types::Strict::String.optional
|
100
|
+
attribute :ios_sound, Types::Strict::String.optional.default(nil)
|
101
101
|
|
102
102
|
# "ios_ttl": 3600, optional.
|
103
103
|
# Time to live parameter - maximum message lifespan in seconds
|
104
|
-
attribute :ios_ttl, Types::Strict::Int.optional
|
104
|
+
attribute :ios_ttl, Types::Strict::Int.optional.default(nil)
|
105
105
|
|
106
106
|
# "ios_silent": 1, optional.
|
107
107
|
# Enable silent notifications (ignore "sound" and "content")
|
108
|
-
attribute :ios_silent, Types::Strict::Int.optional
|
108
|
+
attribute :ios_silent, Types::Strict::Int.constrained(included_in: 0..1).optional.default(nil)
|
109
109
|
|
110
110
|
# iOS8 category ID from Pushwoosh
|
111
|
-
attribute :ios_category_id, Types::Strict::Int.optional.
|
111
|
+
attribute :ios_category_id, Types::Strict::Int.optional.default(nil)
|
112
112
|
|
113
113
|
# Optional - root level parameters to the aps dictionary
|
114
114
|
# "ios_root_params" : {
|
@@ -119,167 +119,197 @@ module Pwush
|
|
119
119
|
# "attachment":"YOUR_ATTACHMENT_URL", // iOS 10 media attachment URL
|
120
120
|
# "data": << User supplied data, max of 4KB>>
|
121
121
|
# },
|
122
|
-
attribute :ios_root_params, Types::Hash.optional
|
122
|
+
attribute :ios_root_params, Types::Hash.optional.default(nil)
|
123
123
|
|
124
124
|
# "apns_trim_content":1, optional. (0|1)
|
125
125
|
# Trims the exceeding content strings with ellipsis
|
126
|
-
attribute :apns_trim_content, Types::Strict::Int.
|
126
|
+
attribute :apns_trim_content, Types::Strict::Int.constrained(included_in: 0..1).optional.default(nil)
|
127
127
|
|
128
128
|
# "ios_title":"Title", optional. Add Title for push notification
|
129
|
-
attribute :ios_title, Types::Strict::String.optional
|
129
|
+
attribute :ios_title, Types::Strict::String.optional.default(nil)
|
130
130
|
|
131
131
|
# "ios_subtitle" : "SubTitle", //Optional. Added sub-title for push notification
|
132
|
-
attribute :ios_subtitle, Types::Strict::String.optional
|
132
|
+
attribute :ios_subtitle, Types::Strict::String.optional.default(nil)
|
133
133
|
|
134
134
|
# Android related
|
135
135
|
|
136
136
|
# "android_root_params": {"key": "value"}
|
137
137
|
# custom key-value object. root level parameters for the android payload recipients
|
138
|
-
attribute :android_root_params, Types::Hash
|
138
|
+
attribute :android_root_params, Types::Hash.optional.default(nil)
|
139
139
|
|
140
140
|
# "android_sound" : "soundfile", optional. No file extension.
|
141
141
|
# If left empty, the device will produce no sound upon receiving a push
|
142
|
-
attribute :android_sound, Types::Strict::String.optional
|
142
|
+
attribute :android_sound, Types::Strict::String.optional.default(nil)
|
143
143
|
|
144
144
|
# "android_header":"header", optional. Android notification header
|
145
|
-
attribute :android_header, Types::Strict::String.optional
|
145
|
+
attribute :android_header, Types::Strict::String.optional.default(nil)
|
146
146
|
|
147
147
|
# "android_icon": "icon",
|
148
|
-
attribute :android_icon, Types::Strict::String.optional
|
148
|
+
attribute :android_icon, Types::Strict::String.optional.default(nil)
|
149
149
|
|
150
150
|
# "android_custom_icon": "http://example.com/image.png", optional.
|
151
151
|
# Full path URL to the image file
|
152
|
-
attribute :android_custom_icon, Types::Strict::String.optional
|
152
|
+
attribute :android_custom_icon, Types::Strict::String.optional.default(nil)
|
153
153
|
|
154
154
|
# "android_banner": "http://example.com/banner.png", optional.
|
155
155
|
# Full path URL to the image file
|
156
|
-
attribute :android_banner, Types::Strict::String.optional
|
156
|
+
attribute :android_banner, Types::Strict::String.optional.default(nil)
|
157
157
|
|
158
158
|
# "android_badges": 5, optional, integer.
|
159
159
|
# Android application icon badge number.
|
160
160
|
# Use "+n" or "-n" to increment/decrement the badge value by n
|
161
|
-
attribute :android_badges, Types::Strict::Int.optional
|
161
|
+
attribute :android_badges, Types::Strict::Int.optional.default(nil)
|
162
162
|
|
163
163
|
# "android_gcm_ttl": 3600, optional.
|
164
|
-
# Time to live parameter
|
165
|
-
attribute :android_gcm_ttl, Types::Strict::Int.optional
|
164
|
+
# Time to live parameter - maximum message lifespan in seconds
|
165
|
+
attribute :android_gcm_ttl, Types::Strict::Int.optional.default(nil)
|
166
166
|
|
167
167
|
# "android_vibration": 0, Android force-vibration for high-priority pushes, boolean
|
168
|
-
attribute :android_vibration, Types::Strict::Bool.default(
|
168
|
+
attribute :android_vibration, Types::Strict::Bool.optional.default(nil)
|
169
169
|
|
170
170
|
# "android_led":"#rrggbb", LED hex color, device will do its best approximation
|
171
|
-
attribute :android_led, Types::Strict::String.optional
|
171
|
+
attribute :android_led, Types::Strict::String.optional.default(nil)
|
172
172
|
|
173
173
|
# "android_priority":-1, priority of the push in the Android push drawer.
|
174
174
|
# Valid values are -2, -1, 0, 1 and 2
|
175
|
-
attribute :android_priority, Types::Strict::Int.
|
175
|
+
attribute :android_priority, Types::Strict::Int.constrained(included_in: -2..2).optional.default(nil)
|
176
176
|
|
177
177
|
# "android_ibc":"#RRGGBB", icon background color on Lollipop,
|
178
178
|
# #RRGGBB, #AARRGGBB, "red", "black", "yellow", etc.
|
179
|
-
attribute :android_ibc, Types::Strict::String.optional
|
179
|
+
attribute :android_ibc, Types::Strict::String.optional.default(nil)
|
180
180
|
|
181
181
|
# "android_silent": 1, optional. 0 or 1
|
182
182
|
# Enable silent notificaiton (ignore sound and content)
|
183
|
-
attribute :android_silent, Types::Strict::Int.
|
183
|
+
attribute :android_silent, Types::Strict::Int.constrained(included_in: 0..1).optional.default(nil)
|
184
184
|
|
185
185
|
# Amazon related
|
186
186
|
|
187
187
|
# "adm_root_params": {"key": "value"}, // custom key-value object
|
188
|
+
attribute :adm_root_params, Types::Hash.optional.default(nil)
|
188
189
|
# "adm_sound": "push.mp3",
|
190
|
+
attribute :adm_sound, Types::Strict::String.optional.default(nil)
|
189
191
|
# "adm_header": "Header",
|
192
|
+
attribute :adm_header, Types::Strict::String.optional.default(nil)
|
190
193
|
# "adm_icon": "icon",
|
194
|
+
attribute :adm_icon, Types::Strict::String.optional.default(nil)
|
191
195
|
# "adm_custom_icon": "http://example.com/image.png",
|
196
|
+
attribute :adm_custom_icon, Types::Strict::String.optional.default(nil)
|
192
197
|
# "adm_banner": "http://example.com/banner.png",
|
198
|
+
attribute :adm_banner, Types::Strict::String.optional.default(nil)
|
193
199
|
# "adm_ttl": 3600, optional. Time to live parameter - the maximum message lifespan in seconds
|
200
|
+
attribute :adm_ttl, Types::Strict::Int.optional.default(nil)
|
194
201
|
# "adm_priority":-1, priority of the push in Amazon push drawer, valid values are -2, -1, 0, 1 and 2
|
202
|
+
attribute :adm_priority, Types::Strict::Int.optional.default(nil)
|
195
203
|
|
196
204
|
# Windows Phone related
|
197
205
|
|
198
|
-
#
|
199
|
-
|
200
|
-
#
|
201
|
-
|
202
|
-
#
|
203
|
-
|
206
|
+
# Windows Phone notification type. 'Tile' or 'Toast'. Raw notifications are not supported. 'Tile' if default
|
207
|
+
attribute :wp_type, Types::Strict::String.optional.default(nil)
|
208
|
+
# tile image
|
209
|
+
attribute :wp_background, Types::Strict::String.optional.default(nil)
|
210
|
+
# back tile image
|
211
|
+
attribute :wp_backbackground, Types::Strict::String.optional.default(nil)
|
212
|
+
# back tile title
|
213
|
+
attribute :wp_backtitle, Types::Strict::String.optional.default(nil)
|
214
|
+
# back tile content
|
215
|
+
attribute :wp_backcontent, Types::Strict::String.optional.default(nil)
|
216
|
+
# Badge for Windows Phone notification
|
217
|
+
attribute :wp_count, Types::Strict::Int.optional.default(nil)
|
204
218
|
|
205
219
|
# BlackBerry related
|
206
220
|
|
207
|
-
#
|
221
|
+
# BlackBerry header, applicable to BB10 Series devices
|
222
|
+
attribute :blackberry_header, Types::Strict::String.optional.default(nil)
|
208
223
|
|
209
224
|
# Mac OS X related
|
210
225
|
|
211
226
|
# "mac_badges": 3,
|
227
|
+
attribute :mac_badges, Types::Strict::Int.optional.default(nil)
|
212
228
|
# "mac_sound": "sound.caf",
|
229
|
+
attribute :mac_sound, Types::Strict::String.optional.default(nil)
|
213
230
|
# "mac_root_params": {"content-available":1},
|
214
|
-
|
231
|
+
attribute :mac_root_params, Types::Hash.optional.default(nil)
|
232
|
+
# Time to live parameter — maximum message lifespan in seconds
|
233
|
+
attribute :mac_ttl, Types::Strict::Int.optional.default(nil)
|
215
234
|
|
216
235
|
# WNS related
|
217
236
|
|
218
|
-
#
|
237
|
+
# Content (XML or raw) of notification encoded in MIME's base64 in form of Object( language1: 'content1', language2: 'content2' ) OR String
|
219
238
|
# "en": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48YmFkZ2UgdmFsdWU9ImF2YWlsYWJsZSIvPg==",
|
220
239
|
# "de": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48YmFkZ2UgdmFsdWU9Im5ld01lc3NhZ2UiLz4="
|
221
240
|
# },
|
222
|
-
|
223
|
-
#
|
224
|
-
|
225
|
-
#
|
241
|
+
attribute :wns_content, Types::Hash.optional.default(nil)
|
242
|
+
# 'Tile' | 'Toast' | 'Badge' | 'Raw'
|
243
|
+
attribute :wns_type, Types::Strict::String.optional.default(nil)
|
244
|
+
# optional. Used in Tile replacement policy. An alphanumeric string of no more than 16 characters.
|
245
|
+
attribute :wns_tag, Types::Strict::String.optional.default(nil)
|
246
|
+
# optional. (1|0) Translates into X-WNS-Cache-Policy value
|
247
|
+
attribute :wns_cache, Types::Strict::Int.optional.default(nil)
|
248
|
+
# optional. Expiration time for notification in seconds
|
249
|
+
attribute :wns_ttl, Types::Strict::Int.optional.default(nil)
|
226
250
|
|
227
251
|
# Safari related
|
228
252
|
|
229
253
|
# obligatory, title of the notification
|
230
|
-
attribute :safari_title, Types::Strict::String.optional
|
254
|
+
attribute :safari_title, Types::Strict::String.optional.default(nil)
|
231
255
|
|
232
256
|
# "safari_action": "Click here", // optional
|
233
|
-
attribute :safari_action, Types::Strict::String.optional
|
257
|
+
attribute :safari_action, Types::Strict::String.optional.default(nil)
|
234
258
|
|
235
259
|
# "safari_url_args": ["firstArgument", "secondArgument"],
|
236
260
|
# Obligatory, but the value may be empty
|
237
|
-
attribute :safari_url_args, Types::Strict::Array.of(Types::Strict::String).optional
|
261
|
+
attribute :safari_url_args, Types::Strict::Array.of(Types::Strict::String).optional.default(nil)
|
238
262
|
|
239
263
|
# Optional. Time to live parameter - the maximum lifespan of a message in seconds
|
240
|
-
attribute :safari_ttl, Types::Strict::Int.constrained(min_size: 0).optional
|
264
|
+
attribute :safari_ttl, Types::Strict::Int.constrained(min_size: 0).optional.default(nil)
|
241
265
|
|
242
266
|
# Chrome related
|
243
267
|
|
244
|
-
# "chrome_title":"", optional.
|
245
268
|
# You can specify the header of the message in this parameter
|
246
|
-
attribute :chrome_title, Types::Strict::String.optional
|
269
|
+
attribute :chrome_title, Types::Strict::String.optional.default(nil)
|
247
270
|
|
248
271
|
# "chrome_icon":"", full path URL to the icon or extension resources file path
|
249
|
-
attribute :chrome_icon, Types::Strict::String.optional
|
272
|
+
attribute :chrome_icon, Types::Strict::String.optional.default(nil)
|
250
273
|
|
251
|
-
# "chrome_gcm_ttl": 3600, optional.
|
252
274
|
# Time to live parameter - maximum message lifespan in seconds
|
253
|
-
attribute :chrome_gcm_ttl, Types::Strict::Int.optional
|
275
|
+
attribute :chrome_gcm_ttl, Types::Strict::Int.optional.default(nil)
|
254
276
|
|
255
|
-
#
|
277
|
+
# optional, changes chrome push display time.
|
256
278
|
# Set to 0 to display push until user interacts with it
|
257
|
-
attribute :chrome_duration
|
279
|
+
attribute :chrome_duration, Types::Strict::Int.optional.default(nil)
|
258
280
|
|
259
|
-
#
|
260
|
-
attribute :chrome_image, Types::Strict::String.optional
|
281
|
+
# optional, URL to large image.
|
282
|
+
attribute :chrome_image, Types::Strict::String.optional.default(nil)
|
261
283
|
|
262
|
-
|
263
|
-
attribute :chrome_button_text1, Types::Strict::String.optional
|
284
|
+
attribute :chrome_button_text1, Types::Strict::String.optional.default(nil)
|
264
285
|
|
265
|
-
# "chrome_button_url1": "button1_url", optional,
|
266
286
|
# ignored if chrome_button_text1 is not set
|
267
|
-
attribute :chrome_button_url1, Types::Strict::String.optional
|
287
|
+
attribute :chrome_button_url1, Types::Strict::String.optional.default(nil)
|
268
288
|
|
269
|
-
|
270
|
-
attribute :chrome_button_text2”, Types::Strict::String.optional
|
289
|
+
attribute :chrome_button_text2, Types::Strict::String.optional.default(nil)
|
271
290
|
|
272
|
-
# "chrome_button_url2": "button2_url", optional,
|
273
291
|
# ignored if chrome_button_text2 is not set
|
274
|
-
attribute :chrome_button_url2
|
292
|
+
attribute :chrome_button_url2, Types::Strict::String.optional.default(nil)
|
275
293
|
|
276
294
|
# Firefox-related
|
277
295
|
|
278
|
-
#
|
279
|
-
attribute :firefox_title, Types::Strict::String.optional
|
296
|
+
# optional. You can specify message header here
|
297
|
+
attribute :firefox_title, Types::Strict::String.optional.default(nil)
|
280
298
|
|
281
|
-
# "firefox_icon":"",
|
282
299
|
# full path URL to the icon or path to the file in extension resources
|
283
|
-
attribute :firefox_icon, Types::Strict::String.optional
|
300
|
+
attribute :firefox_icon, Types::Strict::String.optional.default(nil)
|
301
|
+
|
302
|
+
def defined_attributes
|
303
|
+
__attributes__.reject { |_, v| v.nil? }
|
304
|
+
end
|
305
|
+
|
306
|
+
def to_json(options = nil)
|
307
|
+
defined_attributes.to_json(options)
|
308
|
+
end
|
309
|
+
|
310
|
+
def inspect
|
311
|
+
attrs = defined_attributes.map { |k, v| " #{k}=#{v.inspect}" }.join
|
312
|
+
"#<#{self.class}#{attrs}>"
|
313
|
+
end
|
284
314
|
end
|
285
315
|
end
|
data/lib/pwush/request.rb
CHANGED
@@ -16,11 +16,7 @@ module Pwush
|
|
16
16
|
private
|
17
17
|
|
18
18
|
def build_body(payload)
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
def wrap_request(request)
|
23
|
-
{ request: request }
|
19
|
+
{ request: payload.merge(auth: @auth, application: @app) }
|
24
20
|
end
|
25
21
|
end
|
26
22
|
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Pwush
|
2
|
+
module Response
|
3
|
+
class Deffered
|
4
|
+
def initialize(raw_result)
|
5
|
+
@_raw_result = raw_result
|
6
|
+
end
|
7
|
+
|
8
|
+
def resolve
|
9
|
+
return http_request_failure if raw_result.status != 200
|
10
|
+
return api_request_failure if value_from_api.status_code != 200
|
11
|
+
api_request_succesful
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def http_request_failure
|
17
|
+
Failure.new(value_from_http)
|
18
|
+
end
|
19
|
+
|
20
|
+
def api_request_failure
|
21
|
+
Failure.new(value_from_api)
|
22
|
+
end
|
23
|
+
|
24
|
+
def api_request_succesful
|
25
|
+
Success.new(value_from_api)
|
26
|
+
end
|
27
|
+
|
28
|
+
def raw_result
|
29
|
+
@_raw_result
|
30
|
+
end
|
31
|
+
|
32
|
+
def parsed_result
|
33
|
+
@_parsed_result ||= raw_result.parse
|
34
|
+
end
|
35
|
+
|
36
|
+
def value_from_http
|
37
|
+
@_value_from_http ||= Value.new(
|
38
|
+
status_code: raw_result.status,
|
39
|
+
status_message: raw_result.reason,
|
40
|
+
body: nil
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
def value_from_api
|
45
|
+
@_value_from_api ||= Value.new(
|
46
|
+
status_code: parsed_result['status_code'],
|
47
|
+
status_message: parsed_result['status_message'],
|
48
|
+
body: parsed_result['response']
|
49
|
+
)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Pwush
|
2
|
+
module Response
|
3
|
+
class Value < Dry::Struct::Value
|
4
|
+
constructor_type :strict
|
5
|
+
|
6
|
+
attribute :status_code, Types::Coercible::Int
|
7
|
+
attribute :status_message, Types::Strict::String.optional
|
8
|
+
attribute :body, (Types::Hash | Types::String).optional
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'dry-monads'
|
2
|
+
|
3
|
+
require 'pwush/response/deffered'
|
4
|
+
require 'pwush/response/value'
|
5
|
+
|
6
|
+
module Pwush
|
7
|
+
module Response
|
8
|
+
def self.wrap
|
9
|
+
Deffered.new(yield).resolve
|
10
|
+
rescue Http::TimeoutError => e
|
11
|
+
Failure.new(e)
|
12
|
+
end
|
13
|
+
|
14
|
+
class Success < Dry::Monads::Success; end
|
15
|
+
class Failure < Dry::Monads::Failure; end
|
16
|
+
end
|
17
|
+
end
|
data/lib/pwush/version.rb
CHANGED
data/lib/pwush.rb
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
require 'pwush/config'
|
2
|
-
|
3
|
-
require 'pwush/request'
|
2
|
+
|
4
3
|
require 'pwush/types'
|
5
|
-
require 'pwush/
|
4
|
+
require 'pwush/message'
|
5
|
+
|
6
|
+
require 'pwush/response'
|
7
|
+
require 'pwush/request'
|
8
|
+
|
9
|
+
require 'pwush/client'
|
6
10
|
|
7
11
|
module Pwush
|
8
12
|
def self.new(options)
|
9
13
|
Client.new(options)
|
10
14
|
end
|
11
15
|
end
|
12
|
-
|
13
|
-
# Pwush::Qlean = Pwush.new(
|
14
|
-
# auth: App::Settings.pushwoosh.auth,
|
15
|
-
# app: App::Settings.pushwoosh.clients_app
|
16
|
-
# )
|
data/pwush.gemspec
CHANGED
@@ -1,28 +1,36 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
3
|
+
require 'pwush/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
6
|
+
spec.name = 'pwush'
|
8
7
|
spec.version = Pwush::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
8
|
+
spec.authors = ['Yaroslav Litvinov']
|
9
|
+
spec.email = ['litvinov@applicot.ru']
|
11
10
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
11
|
+
spec.summary = 'Pushwoosh remote API ruby toolkit'
|
12
|
+
spec.description = spec.summary
|
13
|
+
spec.homepage = 'https://github.com/iarie/pwush'
|
14
|
+
spec.license = 'MIT'
|
16
15
|
|
17
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
17
|
f.match(%r{^(test|spec|features)/})
|
19
18
|
end
|
20
|
-
spec.bindir =
|
21
|
-
spec.executables = spec.files.grep(%r{^
|
22
|
-
spec.require_paths = [
|
19
|
+
spec.bindir = 'bin'
|
20
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ['lib']
|
22
|
+
|
23
|
+
spec.add_dependency 'dry-monads', '~> 0.4'
|
24
|
+
spec.add_dependency 'dry-struct', '~> 0.4'
|
25
|
+
spec.add_dependency 'dry-types', '~> 0.12'
|
26
|
+
spec.add_dependency 'http', '~> 3.0'
|
27
|
+
spec.add_dependency 'oj', '~> 3'
|
23
28
|
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
29
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
30
|
+
spec.add_development_dependency 'pry-byebug'
|
31
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
32
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
33
|
+
spec.add_development_dependency 'rspec_junit_formatter'
|
34
|
+
spec.add_development_dependency 'simplecov'
|
35
|
+
spec.add_development_dependency 'webmock', '~> 3.0'
|
28
36
|
end
|
metadata
CHANGED
@@ -1,15 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yaroslav Litvinov
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dry-monads
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: dry-struct
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.4'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: dry-types
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.12'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.12'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: http
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: oj
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3'
|
13
83
|
- !ruby/object:Gem::Dependency
|
14
84
|
name: bundler
|
15
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -24,6 +94,20 @@ dependencies:
|
|
24
94
|
- - "~>"
|
25
95
|
- !ruby/object:Gem::Version
|
26
96
|
version: '1.16'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry-byebug
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
27
111
|
- !ruby/object:Gem::Dependency
|
28
112
|
name: rake
|
29
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,7 +137,21 @@ dependencies:
|
|
53
137
|
- !ruby/object:Gem::Version
|
54
138
|
version: '3.0'
|
55
139
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
140
|
+
name: rspec_junit_formatter
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: simplecov
|
57
155
|
requirement: !ruby/object:Gem::Requirement
|
58
156
|
requirements:
|
59
157
|
- - ">="
|
@@ -66,16 +164,32 @@ dependencies:
|
|
66
164
|
- - ">="
|
67
165
|
- !ruby/object:Gem::Version
|
68
166
|
version: '0'
|
69
|
-
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: webmock
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '3.0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '3.0'
|
181
|
+
description: Pushwoosh remote API ruby toolkit
|
70
182
|
email:
|
71
183
|
- litvinov@applicot.ru
|
72
|
-
executables:
|
184
|
+
executables:
|
185
|
+
- console
|
186
|
+
- setup
|
73
187
|
extensions: []
|
74
188
|
extra_rdoc_files: []
|
75
189
|
files:
|
190
|
+
- ".circleci/config.yml"
|
76
191
|
- ".gitignore"
|
77
192
|
- ".rspec"
|
78
|
-
- ".travis.yml"
|
79
193
|
- CODE_OF_CONDUCT.md
|
80
194
|
- Gemfile
|
81
195
|
- Gemfile.lock
|
@@ -87,12 +201,15 @@ files:
|
|
87
201
|
- lib/pwush.rb
|
88
202
|
- lib/pwush/client.rb
|
89
203
|
- lib/pwush/config.rb
|
90
|
-
- lib/pwush/
|
204
|
+
- lib/pwush/message.rb
|
91
205
|
- lib/pwush/request.rb
|
206
|
+
- lib/pwush/response.rb
|
207
|
+
- lib/pwush/response/deffered.rb
|
208
|
+
- lib/pwush/response/value.rb
|
92
209
|
- lib/pwush/types.rb
|
93
210
|
- lib/pwush/version.rb
|
94
211
|
- pwush.gemspec
|
95
|
-
homepage:
|
212
|
+
homepage: https://github.com/iarie/pwush
|
96
213
|
licenses:
|
97
214
|
- MIT
|
98
215
|
metadata: {}
|
@@ -115,5 +232,5 @@ rubyforge_project:
|
|
115
232
|
rubygems_version: 2.6.14
|
116
233
|
signing_key:
|
117
234
|
specification_version: 4
|
118
|
-
summary:
|
235
|
+
summary: Pushwoosh remote API ruby toolkit
|
119
236
|
test_files: []
|