aws_sns_manager 0.0.2.pre.alpha.pre.28 → 0.0.4.pre.alpha.pre.54

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MzlhMDNjYjlhMDQxNzBhMmFhNTUxYTRhMTg4ZWE0OGRiZTk1OWRkYw==
5
- data.tar.gz: !binary |-
6
- ZmM2MTc2OWM2OTA2YzU3NmVkOThlOTNhM2I0NzY5Yzg5ZDM0MWU1YQ==
2
+ SHA256:
3
+ metadata.gz: 2340779c68cade397e0ae565e7cb44188e29291f9715aabed732cf3b0f727ac2
4
+ data.tar.gz: 0bdd5cb42cdc78d9393aee5da7e4f373c64aa8a94c1ed8e6e6636f8acf74254f
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ODY1Yzc2MDVhZjU3MDdkMjUyOTAzOWRmNDAxN2E2NWFhNWM2ZDllMTA5Njg1
10
- N2ZmNmZhNDkyM2YzNmJjZjgzNTBjNjRiNGJkOWJkZTAzNDJjMzAxZjE0NTI5
11
- Njk3MzQ3MzFlOTkzODQwZjY2NWUzNTM2ZjIzY2RlMGE0NDNlZmM=
12
- data.tar.gz: !binary |-
13
- Yjg2ZGI3ZjQzMmRmMDNhNzAwNDZlNTdiN2M5M2Y4NmFhYTMzMDlkODk0ODA3
14
- MmU1YmM2ZDgyODJlYWQ0NTUzZmEzNmQ2ZGQ1NmNlYjA2ZTY5ZmQ3YzA3ZGIy
15
- MWQwMzc1YmJkZGNlMWFmNDM4ZjQyMGZmNmNmOGRlMTA5MTY4ZWM=
6
+ metadata.gz: 6bc36922a47ebb0d4ecb5898046cda84b1097046ba1c42ea1932fbf1a8cb6174b9f38baaa8c8c272baa05d03297a9699d8d2486994079f7d0842b7e1b45b07c5
7
+ data.tar.gz: b6b6a03abdaac901b65f7d5bc6533007450f8e9738242fbf45556224cd207f64e30ddf546c2011e668cc56bbcd03c8ff6d3f1ae99037fa4ff88c725e4ed21375
@@ -1,3 +1,6 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.3
3
+
1
4
  Lint/HandleExceptions:
2
5
  Exclude:
3
6
  - spec/aws_sns_manager/client_spec.rb
@@ -5,3 +8,7 @@ Lint/HandleExceptions:
5
8
  Metrics/LineLength:
6
9
  Exclude:
7
10
  - aws_sns_manager.gemspec
11
+
12
+ Metrics/BlockLength:
13
+ Exclude:
14
+ - '**/*_spec.rb'
@@ -2,21 +2,25 @@ language: ruby
2
2
  before_install:
3
3
  - gem install bundler
4
4
  - "rm ${BUNDLE_GEMFILE}.lock"
5
- before_script:
6
- - bundle update
7
5
  cache: bundler
8
6
  rvm:
9
- - 2.2.0
10
- - 2.2.1
11
- - 2.2.2
12
- deploy:
13
- provider: rubygems
14
- api_key:
15
- secure: DaIvbW+6p9LNv3YrnsIDtwo4f/7pIe1Y1E5tQuoOspN+lnUhaL5qFWYtbyuMUW9yG9TQhPCn9irCbUBkoKLCKCcbtYrQsELY2hx+z3fFJ7wZMriLojCttf4yZfGdK539clcPsIpkWVSsDaUnxGC1nbj5pJBLJk4U23SiZrMWL0I=
16
- gem: aws_sns_manager
17
- on:
18
- tags: true
19
- repo: nafu/aws_sns_manager
7
+ - 2.3.8
8
+ - 2.4.10
9
+ - 2.5.8
10
+ - 2.6.6
11
+ - 2.7.1
12
+ jobs:
13
+ include:
14
+ - stage: deploy
15
+ rvm: 2.7.1
16
+ deploy:
17
+ provider: rubygems
18
+ api_key:
19
+ secure: DaIvbW+6p9LNv3YrnsIDtwo4f/7pIe1Y1E5tQuoOspN+lnUhaL5qFWYtbyuMUW9yG9TQhPCn9irCbUBkoKLCKCcbtYrQsELY2hx+z3fFJ7wZMriLojCttf4yZfGdK539clcPsIpkWVSsDaUnxGC1nbj5pJBLJk4U23SiZrMWL0I=
20
+ gem: aws_sns_manager
21
+ on:
22
+ tags: true
23
+ repo: nafu/aws_sns_manager
20
24
  addons:
21
25
  code_climate:
22
26
  repo_token: f963cfa99b5c830023926cbaa0cf70b2112d28cdc1b7db78bf39841936e4f766
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
@@ -1,65 +1,69 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aws_sns_manager (0.0.2.pre.alpha.pre.28)
4
+ aws_sns_manager (0.0.4)
5
5
  aws-sdk (~> 2)
6
- bundler (>= 1.3.0, < 2.0)
7
6
  json (~> 1.8)
8
7
 
9
8
  GEM
10
9
  remote: https://rubygems.org/
11
10
  specs:
12
- ast (2.1.0)
13
- astrolabe (1.3.1)
14
- parser (~> 2.2)
15
- aws-sdk (2.1.35)
16
- aws-sdk-resources (= 2.1.35)
17
- aws-sdk-core (2.1.35)
11
+ ast (2.3.0)
12
+ aws-eventstream (1.1.0)
13
+ aws-sdk (2.11.541)
14
+ aws-sdk-resources (= 2.11.541)
15
+ aws-sdk-core (2.11.541)
16
+ aws-sigv4 (~> 1.0)
18
17
  jmespath (~> 1.0)
19
- aws-sdk-resources (2.1.35)
20
- aws-sdk-core (= 2.1.35)
21
- codeclimate-test-reporter (0.4.8)
22
- simplecov (>= 0.7.1, < 1.0.0)
23
- diff-lcs (1.2.5)
18
+ aws-sdk-resources (2.11.541)
19
+ aws-sdk-core (= 2.11.541)
20
+ aws-sigv4 (1.2.1)
21
+ aws-eventstream (~> 1, >= 1.0.2)
22
+ codeclimate-test-reporter (1.0.8)
23
+ simplecov (<= 0.13)
24
+ diff-lcs (1.3)
24
25
  docile (1.1.5)
25
- jmespath (1.1.3)
26
- json (1.8.3)
27
- parser (2.2.3.0)
28
- ast (>= 1.1, < 3.0)
26
+ jmespath (1.4.0)
27
+ json (1.8.6)
28
+ parser (2.4.0.0)
29
+ ast (~> 2.2)
29
30
  powerpack (0.1.1)
30
- rainbow (2.0.0)
31
- rake (10.4.2)
32
- rspec (3.3.0)
33
- rspec-core (~> 3.3.0)
34
- rspec-expectations (~> 3.3.0)
35
- rspec-mocks (~> 3.3.0)
36
- rspec-core (3.3.2)
37
- rspec-support (~> 3.3.0)
38
- rspec-expectations (3.3.1)
31
+ rainbow (2.2.2)
32
+ rake
33
+ rake (10.5.0)
34
+ rspec (3.6.0)
35
+ rspec-core (~> 3.6.0)
36
+ rspec-expectations (~> 3.6.0)
37
+ rspec-mocks (~> 3.6.0)
38
+ rspec-core (3.6.0)
39
+ rspec-support (~> 3.6.0)
40
+ rspec-expectations (3.6.0)
39
41
  diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.3.0)
41
- rspec-mocks (3.3.2)
42
+ rspec-support (~> 3.6.0)
43
+ rspec-mocks (3.6.0)
42
44
  diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.3.0)
44
- rspec-support (3.3.0)
45
- rubocop (0.34.2)
46
- astrolabe (~> 1.3)
47
- parser (>= 2.2.2.5, < 3.0)
45
+ rspec-support (~> 3.6.0)
46
+ rspec-support (3.6.0)
47
+ rubocop (0.48.1)
48
+ parser (>= 2.3.3.1, < 3.0)
48
49
  powerpack (~> 0.1)
49
50
  rainbow (>= 1.99.1, < 3.0)
50
- ruby-progressbar (~> 1.4)
51
- ruby-progressbar (1.7.5)
52
- simplecov (0.10.0)
51
+ ruby-progressbar (~> 1.7)
52
+ unicode-display_width (~> 1.0, >= 1.0.1)
53
+ ruby-progressbar (1.8.1)
54
+ simplecov (0.13.0)
53
55
  docile (~> 1.1.0)
54
- json (~> 1.8)
56
+ json (>= 1.8, < 3)
55
57
  simplecov-html (~> 0.10.0)
56
58
  simplecov-html (0.10.0)
59
+ unicode-display_width (1.2.1)
57
60
 
58
61
  PLATFORMS
59
62
  ruby
60
63
 
61
64
  DEPENDENCIES
62
65
  aws_sns_manager!
66
+ bundler (>= 1.3.0)
63
67
  codeclimate-test-reporter
64
68
  rake (~> 10.0)
65
69
  rspec (~> 3)
@@ -67,4 +71,4 @@ DEPENDENCIES
67
71
  simplecov (~> 0.9)
68
72
 
69
73
  BUNDLED WITH
70
- 1.10.6
74
+ 2.1.4
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler'
2
4
  Bundler::GemHelper.install_tasks
3
5
 
@@ -14,4 +16,4 @@ rescue LoadError
14
16
  end
15
17
  end
16
18
 
17
- task default: [:spec, :rubocop]
19
+ task default: %i[spec]
@@ -1,4 +1,6 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
3
+
2
4
  lib = File.expand_path('../lib', __FILE__)
3
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
6
  require 'aws_sns_manager/version'
@@ -9,9 +11,9 @@ Gem::Specification.new do |s|
9
11
  s.email = ['nakamurafumiya003@gmail.com']
10
12
  s.files = `git ls-files -z`.split("\x0").reject { |f| f.start_with?('spec/') }
11
13
  s.homepage = 'http://github.com/nafu/aws_sns_manager'
12
- s.licenses = %w(MIT)
14
+ s.licenses = %w[MIT]
13
15
  s.name = 'aws_sns_manager'
14
- s.require_paths = %w(lib)
16
+ s.require_paths = %w[lib]
15
17
  s.required_rubygems_version = '>= 1.3.5'
16
18
  s.summary = s.description
17
19
  s.version = AwsSnsManager::VERSION
@@ -19,10 +21,10 @@ Gem::Specification.new do |s|
19
21
 
20
22
  s.required_ruby_version = '~> 2.0'
21
23
 
22
- s.add_dependency 'bundler', '>= 1.3.0', '< 2.0'
23
24
  s.add_dependency 'aws-sdk', '~> 2'
24
25
  s.add_dependency 'json', '~> 1.8'
25
26
 
27
+ s.add_development_dependency 'bundler', '>= 1.3.0'
26
28
  s.add_development_dependency 'rake', '~> 10.0'
27
29
  s.add_development_dependency 'rspec', '~> 3'
28
30
  s.add_development_dependency 'simplecov', '~> 0.9'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'aws-sdk'
2
4
  require 'json'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module AwsSnsManager
2
4
  # = AwsSnsManager::Client
3
5
  class Client
@@ -30,38 +32,66 @@ module AwsSnsManager
30
32
  # +text+:: Text you want to send
31
33
  # +options+:: Options you want on payload
32
34
  # +env+:: Environments :prod, :dev
33
- # +type+:: Notification type :normal, :silent
35
+ # +type+:: Notification type :normal, :silent, :nosound
34
36
  #
35
37
  def message(text, options = {}, env = :prod, type = :normal)
36
38
  if type == :normal
37
39
  data = normal_notification(text, options)
38
40
  elsif type == :silent
39
41
  data = silent_notification(text, options)
42
+ elsif type == :nosound
43
+ data = nosound_notification(text, options)
40
44
  end
41
45
  return dev_json(data) if env == :dev
42
46
  prod_json(data)
43
47
  end
44
48
 
49
+ # rubocop:disable Metrics/MethodLength
45
50
  def normal_notification(text, options = {})
46
51
  base = {
47
52
  aps: {
48
- alert: text,
49
- sound: 'default',
53
+ alert: {
54
+ title: nil,
55
+ subtitle: nil,
56
+ body: text
57
+ },
58
+ sound: options.delete(:sound),
50
59
  badge: 1,
60
+ 'mutable-content': 1,
51
61
  'content-available': 1
52
62
  }
53
63
  }
54
64
  base.merge(options)
55
65
  end
66
+ # rubocop:enable Metrics/MethodLength
56
67
 
57
68
  def silent_notification(_text, options = {})
58
69
  base = {
59
70
  aps: {
71
+ 'mutable-content': 1,
72
+ 'content-available': 1
73
+ }
74
+ }
75
+ base.merge(options)
76
+ end
77
+
78
+ # rubocop:disable Metrics/MethodLength
79
+ def nosound_notification(text, options = {})
80
+ base = {
81
+ aps: {
82
+ alert: {
83
+ title: nil,
84
+ subtitle: nil,
85
+ body: text
86
+ },
87
+ badge: 1,
88
+ 'mutable-content': 1,
60
89
  'content-available': 1
61
90
  }
62
91
  }
63
92
  base.merge(options)
64
93
  end
94
+ # rubocop:enable Metrics/MethodLength
65
95
 
66
96
  private
67
97
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module AwsSnsManager
2
4
  # = AwsSnsManager::Config
3
5
  module Config
@@ -1,4 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # = AwsSnsManager::VERSION
2
4
  module AwsSnsManager
3
- VERSION = '0.0.2'
5
+ VERSION = '0.0.4'
4
6
  end
metadata CHANGED
@@ -1,117 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_sns_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.pre.alpha.pre.28
4
+ version: 0.0.4.pre.alpha.pre.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fumiya Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-06 00:00:00.000000000 Z
11
+ date: 2020-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: aws-sdk
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
18
- - !ruby/object:Gem::Version
19
- version: 1.3.0
20
- - - <
17
+ - - "~>"
21
18
  - !ruby/object:Gem::Version
22
- version: '2.0'
19
+ version: '2'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ! '>='
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: 1.3.0
30
- - - <
31
- - !ruby/object:Gem::Version
32
- version: '2.0'
26
+ version: '2'
33
27
  - !ruby/object:Gem::Dependency
34
- name: aws-sdk
28
+ name: json
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
- - - ~>
31
+ - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: '2'
33
+ version: '1.8'
40
34
  type: :runtime
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
- - - ~>
38
+ - - "~>"
45
39
  - !ruby/object:Gem::Version
46
- version: '2'
40
+ version: '1.8'
47
41
  - !ruby/object:Gem::Dependency
48
- name: json
42
+ name: bundler
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
- - - ~>
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
- version: '1.8'
54
- type: :runtime
47
+ version: 1.3.0
48
+ type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
- - - ~>
52
+ - - ">="
59
53
  - !ruby/object:Gem::Version
60
- version: '1.8'
54
+ version: 1.3.0
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: rake
63
57
  requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
- - - ~>
59
+ - - "~>"
66
60
  - !ruby/object:Gem::Version
67
61
  version: '10.0'
68
62
  type: :development
69
63
  prerelease: false
70
64
  version_requirements: !ruby/object:Gem::Requirement
71
65
  requirements:
72
- - - ~>
66
+ - - "~>"
73
67
  - !ruby/object:Gem::Version
74
68
  version: '10.0'
75
69
  - !ruby/object:Gem::Dependency
76
70
  name: rspec
77
71
  requirement: !ruby/object:Gem::Requirement
78
72
  requirements:
79
- - - ~>
73
+ - - "~>"
80
74
  - !ruby/object:Gem::Version
81
75
  version: '3'
82
76
  type: :development
83
77
  prerelease: false
84
78
  version_requirements: !ruby/object:Gem::Requirement
85
79
  requirements:
86
- - - ~>
80
+ - - "~>"
87
81
  - !ruby/object:Gem::Version
88
82
  version: '3'
89
83
  - !ruby/object:Gem::Dependency
90
84
  name: simplecov
91
85
  requirement: !ruby/object:Gem::Requirement
92
86
  requirements:
93
- - - ~>
87
+ - - "~>"
94
88
  - !ruby/object:Gem::Version
95
89
  version: '0.9'
96
90
  type: :development
97
91
  prerelease: false
98
92
  version_requirements: !ruby/object:Gem::Requirement
99
93
  requirements:
100
- - - ~>
94
+ - - "~>"
101
95
  - !ruby/object:Gem::Version
102
96
  version: '0.9'
103
97
  - !ruby/object:Gem::Dependency
104
98
  name: rubocop
105
99
  requirement: !ruby/object:Gem::Requirement
106
100
  requirements:
107
- - - ~>
101
+ - - "~>"
108
102
  - !ruby/object:Gem::Version
109
103
  version: '0.30'
110
104
  type: :development
111
105
  prerelease: false
112
106
  version_requirements: !ruby/object:Gem::Requirement
113
107
  requirements:
114
- - - ~>
108
+ - - "~>"
115
109
  - !ruby/object:Gem::Version
116
110
  version: '0.30'
117
111
  description: Utility for Amazon Simple Notification Service
@@ -121,9 +115,9 @@ executables: []
121
115
  extensions: []
122
116
  extra_rdoc_files: []
123
117
  files:
124
- - .gitignore
125
- - .rubocop.yml
126
- - .travis.yml
118
+ - ".gitignore"
119
+ - ".rubocop.yml"
120
+ - ".travis.yml"
127
121
  - Gemfile
128
122
  - Gemfile.lock
129
123
  - LICENSE
@@ -144,17 +138,17 @@ require_paths:
144
138
  - lib
145
139
  required_ruby_version: !ruby/object:Gem::Requirement
146
140
  requirements:
147
- - - ~>
141
+ - - "~>"
148
142
  - !ruby/object:Gem::Version
149
143
  version: '2.0'
150
144
  required_rubygems_version: !ruby/object:Gem::Requirement
151
145
  requirements:
152
- - - ! '>'
146
+ - - ">"
153
147
  - !ruby/object:Gem::Version
154
148
  version: 1.3.1
155
149
  requirements: []
156
150
  rubyforge_project:
157
- rubygems_version: 2.4.5
151
+ rubygems_version: 2.7.7
158
152
  signing_key:
159
153
  specification_version: 4
160
154
  summary: Utility for Amazon Simple Notification Service