didww-v3 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f190a01670c1359b390201bc4cdd569f500ae20ed97ad5438f81903e55c442f
4
- data.tar.gz: fd332a3bc4bfe59ec7d12bfd60b706b2206bfdd2a77216a551405125231f1d1f
3
+ metadata.gz: 67435ef42f0af2a8862a0951069af3d7a4ce4b3afedfeef02c89203fef215645
4
+ data.tar.gz: f5bcb5ea9069ef3b10a1ac6c9b714d315e3b0f55d80fc132e22e21cc076a24ac
5
5
  SHA512:
6
- metadata.gz: b5aacd2fc1d81c7ad726a46ceea8837f64ff1469b851b164b1d4a34ea131b8fff47eecba16e4b477b615029a39a911df22f985f2a185aa6d2b95a559114866d7
7
- data.tar.gz: 1665800d20ba7bca592b52cef5ad1aea3398fa7be9d045169cad71bf9b030f51f147c77ef1d373c582765a0c38ec3da318ae38e3dee9a822f4559ef815f64448
6
+ metadata.gz: 843ef3ddb29b72b09a7ef3b586169fe2f481463a0de49a8361642ff20c31973dee901f0c0d4f21bfa0c6aff60df2243e0e9e2e22b1e123168775bea200ecd6f0
7
+ data.tar.gz: 842db8a8747dcfe7aa79fb363d45022d31a407ef2321e2599b770b7294c9eba890b4f1858a35735f77512d639a58948db44d25afddc69cfcad50f26f581820ec
@@ -0,0 +1,23 @@
1
+ name: Tests
2
+ on: [ 'pull_request' ]
3
+
4
+ jobs:
5
+ test:
6
+ runs-on: ubuntu-latest
7
+ strategy:
8
+ matrix:
9
+ ruby: [ '2.5', '2.6', '2.7' ]
10
+ rails: [ '~> 5.0', '~> 6.0' ]
11
+ name: Tests with Ruby ${{ matrix.ruby }} Activesupport ${{ matrix.rails }}
12
+ env:
13
+ RAILS_VERSION: ${{ matrix.rails }}
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ - uses: actions/setup-ruby@v1
17
+ with:
18
+ ruby-version: ${{ matrix.ruby }}
19
+ - name: Run tests
20
+ run: |
21
+ gem install bundler -v 2.2.7
22
+ bundle install
23
+ bundle exec rake
data/.rubocop.yml CHANGED
@@ -1,18 +1,18 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rake
4
+ - rubocop-rspec
5
+
1
6
  AllCops:
2
- TargetRubyVersion: 2.4
7
+ TargetRubyVersion: 2.5
3
8
  DisplayCopNames: true
4
9
  DisabledByDefault: true
5
10
 
6
11
  Exclude:
7
12
  - db/migrate/**/*
8
13
 
9
- Include:
10
- - "**/*.rake"
11
- - "**/Gemfile"
12
- - "**/Rakefile"
13
-
14
14
  ##################### Layout ##################################
15
- Layout/TrailingBlankLines:
15
+ Layout/TrailingEmptyLines:
16
16
  Enabled: true
17
17
 
18
18
  Layout/TrailingWhitespace:
@@ -68,7 +68,7 @@ Performance/EndWith:
68
68
  Enabled: true
69
69
 
70
70
  # Use `strip` instead of `lstrip.rstrip`.
71
- Performance/LstripRstrip:
71
+ Style/Strip:
72
72
  Enabled: true
73
73
 
74
74
  # Use `Range#cover?` instead of `Range#include?`.
@@ -91,7 +91,7 @@ Performance/RedundantMerge:
91
91
  Enabled: true
92
92
 
93
93
  # Use `sort` instead of `sort_by { |x| x }`.
94
- Performance/RedundantSortBy:
94
+ Style/RedundantSortBy:
95
95
  Enabled: true
96
96
 
97
97
  # Use `start_with?` instead of a regex match anchored to the beginning of a
@@ -138,7 +138,7 @@ Lint/AssignmentInCondition:
138
138
  Enabled: true
139
139
 
140
140
  # Align block ends correctly.
141
- Lint/BlockAlignment:
141
+ Layout/BlockAlignment:
142
142
  Enabled: true
143
143
 
144
144
  # Default values in optional keyword arguments and optional ordinal arguments
@@ -147,7 +147,7 @@ Lint/CircularArgumentReference:
147
147
  Enabled: true
148
148
 
149
149
  # Checks for condition placed in a confusing position relative to the keyword.
150
- Lint/ConditionPosition:
150
+ Layout/ConditionPosition:
151
151
  Enabled: true
152
152
 
153
153
  # Check for debugger calls.
@@ -155,7 +155,7 @@ Lint/Debugger:
155
155
  Enabled: true
156
156
 
157
157
  # Align ends corresponding to defs correctly.
158
- Lint/DefEndAlignment:
158
+ Layout/DefEndAlignment:
159
159
  Enabled: true
160
160
 
161
161
  # Check for deprecated class method calls.
@@ -179,11 +179,11 @@ Lint/EmptyWhen:
179
179
  Enabled: true
180
180
 
181
181
  # Align ends correctly.
182
- Lint/EndAlignment:
182
+ Layout/EndAlignment:
183
183
  Enabled: true
184
184
 
185
185
  # END blocks should not be placed inside method definitions.
186
- Lint/EndInMethod:
186
+ Style/EndBlock:
187
187
  Enabled: true
188
188
 
189
189
  # Do not use return in an ensure block.
@@ -199,7 +199,7 @@ Lint/FormatParameterMismatch:
199
199
  Enabled: true
200
200
 
201
201
  # This cop checks for *rescue* blocks with no body.
202
- Lint/HandleExceptions:
202
+ Lint/SuppressedException:
203
203
  Enabled: true
204
204
 
205
205
  # Checks for adjacent string literals on the same line, which could better be
@@ -255,7 +255,7 @@ Lint/ShadowingOuterLocalVariable:
255
255
  Enabled: false
256
256
 
257
257
  # Checks for Object#to_s usage in string interpolation.
258
- Lint/StringConversionInInterpolation:
258
+ Lint/RedundantStringCoercion:
259
259
  Enabled: false
260
260
 
261
261
  # Do not use prefix `_` for a variable that is used.
@@ -269,11 +269,11 @@ Lint/UnifiedInteger:
269
269
  # Checks for rubocop:disable comments that can be removed.
270
270
  # Note: this cop is not disabled when disabling all cops.
271
271
  # It must be explicitly disabled.
272
- Lint/UnneededDisable:
272
+ Lint/RedundantCopDisableDirective:
273
273
  Enabled: false
274
274
 
275
275
  # This cop checks for unneeded usages of splat expansion
276
- Lint/UnneededSplatExpansion:
276
+ Lint/RedundantSplatExpansion:
277
277
  Enabled: false
278
278
 
279
279
  # Unreachable code.
@@ -297,7 +297,7 @@ Lint/UselessAssignment:
297
297
  Enabled: false
298
298
 
299
299
  # Checks for comparison of something with itself.
300
- Lint/UselessComparison:
300
+ Lint/BinaryOperatorWithIdenticalOperands:
301
301
  Enabled: false
302
302
 
303
303
  # Checks for useless `else` in `begin..end` without `rescue`.
data/CHANGELOG.md ADDED
@@ -0,0 +1,35 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [1.3.1] - 2021-10-26
8
+ ### Changes
9
+ - replace travis with github actions [#7](https://github.com/didww/didww-v3-ruby/pull/7) [#9](https://github.com/didww/didww-v3-ruby/pull/9)
10
+ - use rubocop 1.9.X version [#7](https://github.com/didww/didww-v3-ruby/pull/7)
11
+ - add bundle-audit [#7](https://github.com/didww/didww-v3-ruby/pull/7)
12
+
13
+ ### Bugfixes
14
+ - fix order purchase when activesupport 6.X.X is used.
15
+ - fix BigDecimal 2 support for ruby 2.7+.
16
+
17
+ ## [1.3.0] - 2018-09-03
18
+ ### Changes
19
+ - Add Capacity Pool and Shared Capacity Group resources
20
+ - Add Capacity Pool and Shared Capacity Group relationships to DID
21
+ - Add Quantity based pricings and Capacity type Order Item
22
+
23
+ ## [1.2.0] - 2018-04-25
24
+ ### Changes
25
+ - add number selection feature
26
+
27
+ ## [1.1.0] - 2018-03-05
28
+ ### Changes
29
+ - add Pop resource
30
+ - Remove old trunk.preferred_server property
31
+ - Add max_transfers and max_30x_redirects to sip_configurations
32
+ - Added custom user-agent header
33
+
34
+ ## [1.0.0] - 2017-12-05
35
+ - initial release
data/Gemfile CHANGED
@@ -4,3 +4,22 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in didww-v3.gemspec
6
6
  gemspec
7
+
8
+ if ENV['RAILS_VERSION']
9
+ gem 'activesupport', ENV['RAILS_VERSION'], require: false
10
+ end
11
+
12
+ gem 'rake', '~> 12.0'
13
+ gem 'rspec', '~> 3.0'
14
+ gem 'pry'
15
+ gem 'byebug'
16
+ gem 'awesome_print'
17
+ gem 'http_logger'
18
+ gem 'rubocop', '~> 1.9'
19
+ gem 'rubocop-performance'
20
+ gem 'rubocop-rake'
21
+ gem 'rubocop-rspec'
22
+ gem 'simplecov'
23
+ gem 'smart_rspec'
24
+ gem 'webmock'
25
+ gem 'bundler-audit'
data/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  Ruby client for DIDWW API v3.
2
2
 
3
+ [![Build Status](https://github.com/didww/didww-v3-ruby/workflows/tests/badge.svg?branch=master)](https://github.com/didww/didww-v3-ruby/actions)
4
+
3
5
  About DIDWW API v3
4
6
  -----
5
7
 
6
- The DIDWW API provides a simple yet powerful interface that allows you to fully integrate your own applications with DIDWW services. An extensive set of actions may be performed using this API, such as ordering and configuring phone numbers, setting capacity, creating SIP trunks and retrieving CDRs and other operational data. As such, this interface is the ideal tool for building alternative dashboards, developing mobile applications and automating front and back-end applications.
8
+ The DIDWW API provides a simple yet powerful interface that allows you to fully integrate your own applications with DIDWW services. An extensive set of actions may be performed using this API, such as ordering and configuring phone numbers, setting capacity, creating SIP trunks and retrieving CDRs and other operational data.
7
9
 
8
10
  The DIDWW API v3 is a fully compliant implementation of the [JSON API specification](http://jsonapi.org/format/).
9
11
 
data/Rakefile CHANGED
@@ -1,6 +1,10 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'rspec/core/rake_task'
3
+ require 'bundler/audit/task'
4
+ require 'rubocop/rake_task'
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
7
+ Bundler::Audit::Task.new
8
+ RuboCop::RakeTask.new
5
9
 
6
- task default: :spec
10
+ task default: ['bundle:audit', :rubocop, :spec]
data/didww-v3.gemspec CHANGED
@@ -21,26 +21,9 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ['lib']
23
23
 
24
- spec.add_development_dependency 'bundler', '~> 1.16'
25
- spec.add_development_dependency 'rake', '~> 10.0'
26
- spec.add_development_dependency 'rspec', '~> 3.0'
27
-
28
- # development
29
- spec.add_development_dependency 'pry'
30
- spec.add_development_dependency 'byebug'
31
- spec.add_development_dependency 'awesome_print'
32
- spec.add_development_dependency 'http_logger'
33
- spec.add_development_dependency 'rubocop'
34
-
35
- # test
36
- spec.add_development_dependency 'simplecov'
37
- spec.add_development_dependency 'smart_rspec'
38
- spec.add_development_dependency 'webmock'
39
-
40
24
  spec.add_dependency 'activesupport'
41
25
  spec.add_dependency 'faraday'
42
- spec.add_dependency 'json_api_client'
26
+ spec.add_dependency 'json_api_client', '1.5.3'
43
27
  spec.add_dependency 'http'
44
28
  spec.add_dependency 'down'
45
-
46
29
  end
data/lib/didww/client.rb CHANGED
@@ -3,6 +3,16 @@ require 'json_api_client'
3
3
 
4
4
  require 'didww/resources/base'
5
5
 
6
+ # Fixes BigDecimal 2 support for ruby 2.7+ without introducing json_api_client breaking changes.
7
+ # https://github.com/JsonApiClient/json_api_client/commit/ac372b8bab3b71bb0aa5c4dcc6ced1d9c3fe8d14
8
+ class JsonApiClient::Schema::Types::FixedDecimal
9
+ def self.cast(value, _)
10
+ BigDecimal(value)
11
+ end
12
+ end
13
+
14
+ JsonApiClient::Schema.register decimal: JsonApiClient::Schema::Types::FixedDecimal
15
+
6
16
  module DIDWW
7
17
  module Client
8
18
  BASE_URLS = {
@@ -44,7 +44,10 @@ module DIDWW
44
44
 
45
45
  # Returns a ComplexObject class if given JSON API type matches any
46
46
  def class_for_type(type)
47
- "#{parent.name}::#{type.classify}".safe_constantize
47
+ # activesupport 6 has breaking change - parent* methods renamed to module_parent*.
48
+ # see https://github.com/rails/rails/pull/34051
49
+ name = respond_to?(:module_parent_name) ? module_parent_name : parent_name
50
+ "#{name}::#{type.classify}".safe_constantize
48
51
  end
49
52
  end
50
53
 
data/lib/didww/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DIDWW
2
- VERSION = '1.3.0'.freeze
2
+ VERSION = '1.3.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,169 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: didww-v3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Korobeinikov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-03 00:00:00.000000000 Z
11
+ date: 2021-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.16'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.16'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '10.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '10.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: '3.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '3.0'
55
- - !ruby/object:Gem::Dependency
56
- name: pry
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: byebug
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: awesome_print
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: http_logger
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'
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: simplecov
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: smart_rspec
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: webmock
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
13
  - !ruby/object:Gem::Dependency
168
14
  name: activesupport
169
15
  requirement: !ruby/object:Gem::Requirement
@@ -196,16 +42,16 @@ dependencies:
196
42
  name: json_api_client
197
43
  requirement: !ruby/object:Gem::Requirement
198
44
  requirements:
199
- - - ">="
45
+ - - '='
200
46
  - !ruby/object:Gem::Version
201
- version: '0'
47
+ version: 1.5.3
202
48
  type: :runtime
203
49
  prerelease: false
204
50
  version_requirements: !ruby/object:Gem::Requirement
205
51
  requirements:
206
- - - ">="
52
+ - - '='
207
53
  - !ruby/object:Gem::Version
208
- version: '0'
54
+ version: 1.5.3
209
55
  - !ruby/object:Gem::Dependency
210
56
  name: http
211
57
  requirement: !ruby/object:Gem::Requirement
@@ -241,10 +87,11 @@ executables: []
241
87
  extensions: []
242
88
  extra_rdoc_files: []
243
89
  files:
90
+ - ".github/workflows/tests.yml"
244
91
  - ".gitignore"
245
92
  - ".rspec"
246
93
  - ".rubocop.yml"
247
- - ".travis.yml"
94
+ - CHANGELOG.md
248
95
  - Gemfile
249
96
  - LICENSE.txt
250
97
  - README.md
@@ -306,8 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
306
153
  - !ruby/object:Gem::Version
307
154
  version: '0'
308
155
  requirements: []
309
- rubyforge_project:
310
- rubygems_version: 2.7.6
156
+ rubygems_version: 3.1.4
311
157
  signing_key:
312
158
  specification_version: 4
313
159
  summary: Ruby client for DIDWW API v3
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.2
5
- before_install: gem install bundler -v 1.16.0