ruby-bandwidth-iris 6.0.0 → 7.1.0

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: a078992d099b9230e03bf89a886d2a20722f589487fe42cf60870cf8d58a78f2
4
- data.tar.gz: 16a89092f0ade496f0fe8f7b38bfe99aa33262dda8c5d2ecde7d3108fd692ace
3
+ metadata.gz: 6f0464d72a270fd2bb6961d0598e12dc658db9dd76f94cb559e4005b0da6ecf6
4
+ data.tar.gz: df92186a78352ffaca65f532fd7183a03127e5e00929f64ade1abed240556ee1
5
5
  SHA512:
6
- metadata.gz: 55cec4a52822fac10792cd040b6837acc876241dbeb7cfb7e238b1a699e00ebe3ca7ecc60b32915180edf370009dfa9d021fd5ba31f6a6a82d1e455f9206a180
7
- data.tar.gz: b313d0f487d7816a73a0631c863b44a3b8ca3f35154562265dd625c2f0671367c4dcad04cb8da8d823ce8b6ba8d68e494a3fb628604d3779cf5107c5c782e516
6
+ metadata.gz: 9e35d5e104130d2574184139daacd7ed64c15599f88e8cb33deb05c540f8dc5b7d79aa6206092b3564a4e91cfbdd6a8f734fd0a77449e1031b7ee94e855ff991
7
+ data.tar.gz: 66c286a7ef2941877d6d87f04d7c26a301a24762dcd5fe31a15d019d41a2ca964ee114e5c06eceae908ac81179d27c6d4bab7d406d2c597c1c991f9ae763c4b3
@@ -11,32 +11,32 @@ jobs:
11
11
  if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'master' }}
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - name: Checkout
15
- uses: actions/checkout@v2
14
+ - name: Checkout
15
+ uses: actions/checkout@v3
16
16
 
17
- - name: Setup Ruby
18
- uses: ruby/setup-ruby@v1
19
- with:
20
- ruby-version: '3.0'
17
+ - name: Setup Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: "3.0"
21
21
 
22
- - name: Install Packages
23
- run: bundle install
22
+ - name: Install Packages
23
+ run: bundle install
24
24
 
25
- - name: Test
26
- run: rake
25
+ - name: Test
26
+ run: rake
27
27
 
28
- - name: Deploy to Rubygems
29
- run: |
30
- mkdir -p $HOME/.gem
31
- touch $HOME/.gem/credentials
32
- chmod 0600 $HOME/.gem/credentials
33
- printf -- "---\n:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}\n" > $HOME/.gem/credentials
34
- gem build *.gemspec
35
- gem push *.gem
28
+ - name: Deploy to Rubygems
29
+ run: |
30
+ mkdir -p $HOME/.gem
31
+ touch $HOME/.gem/credentials
32
+ chmod 0600 $HOME/.gem/credentials
33
+ printf -- "---\n:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}\n" > $HOME/.gem/credentials
34
+ gem build *.gemspec
35
+ gem push *.gem
36
36
 
37
- - uses: Bandwidth/build-notify-slack-action@v1.0.0
38
- if: always()
39
- with:
40
- job-status: ${{ job.status }}
41
- slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
42
- slack-channel: ${{ secrets.SLACK_CHANNEL }}
37
+ - uses: Bandwidth/build-notify-slack-action@v1.0.0
38
+ if: always()
39
+ with:
40
+ job-status: ${{ job.status }}
41
+ slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
42
+ slack-channel: ${{ secrets.SLACK_CHANNEL }}
@@ -1,38 +1,38 @@
1
- name: Test
2
-
3
- on:
4
- schedule:
5
- - cron: "0 4 * * *"
6
- pull_request:
7
- workflow_dispatch:
8
-
9
- jobs:
10
- test:
11
- name: Test
12
- runs-on: ${{ matrix.os }}
13
- strategy:
14
- matrix:
15
- os: [windows-2022, windows-2019, ubuntu-18.04, ubuntu-20.04]
16
- ruby-version: [2.6, 2.7, 3.0]
17
- steps:
18
- - name: Checkout
19
- uses: actions/checkout@v2
20
-
21
- - name: Set up Ruby
22
- uses: ruby/setup-ruby@v1
23
- with:
24
- ruby-version: ${{ matrix.ruby-version }}
25
-
26
- - name: Install Packages
27
- run: bundle install
28
-
29
- - name: Test
30
- run: rake
31
-
32
- - name: Notify Slack of Failures
33
- uses: Bandwidth/build-notify-slack-action@v1.0.0
34
- if: failure() && !github.event.pull_request.draft
35
- with:
36
- job-status: ${{ job.status }}
37
- slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
38
- slack-channel: ${{ secrets.SLACK_CHANNEL }}
1
+ name: Test
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 4 * * *"
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ test:
11
+ name: Test
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ matrix:
15
+ os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
16
+ ruby-version: [2.6, 2.7, 3.0]
17
+ steps:
18
+ - name: Checkout
19
+ uses: actions/checkout@v3
20
+
21
+ - name: Set up Ruby
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: ${{ matrix.ruby-version }}
25
+
26
+ - name: Install Packages
27
+ run: bundle install
28
+
29
+ - name: Test
30
+ run: rake
31
+
32
+ - name: Notify Slack of Failures
33
+ uses: Bandwidth/build-notify-slack-action@v1.0.0
34
+ if: failure() && !github.event.pull_request.draft
35
+ with:
36
+ job-status: ${{ job.status }}
37
+ slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
38
+ slack-channel: ${{ secrets.SLACK_CHANNEL }}
@@ -1,5 +1,6 @@
1
1
  require 'faraday'
2
- require 'faraday_middleware'
2
+ require 'base64'
3
+ require 'faraday/follow_redirects'
3
4
  require 'active_support'
4
5
  require 'active_support/xml_mini'
5
6
  require 'active_support/core_ext/hash/conversions'
@@ -29,11 +30,12 @@ module BandwidthIris
29
30
  @set_adapter = lambda {|faraday| faraday.adapter(Faraday.default_adapter)}
30
31
  @create_connection = lambda{||
31
32
  Faraday.new(api_endpoint) { |faraday|
32
- faraday.request :basic_auth, user_name, password
33
+ # To make this gem compatible with Faraday v1 and v2, the basic_auth middleware can't be used because it was removed in v2
34
+ faraday.request :authorization, 'Basic', Base64.strict_encode64("#{user_name}:#{password}")
33
35
  #faraday.response :logger
34
36
  faraday.headers['Accept'] = 'application/xml'
35
37
  faraday.headers['user-agent'] = 'Ruby-Bandwidth-Iris'
36
- faraday.use FaradayMiddleware::FollowRedirects
38
+ faraday.response :follow_redirects # use Faraday::FollowRedirects::Middleware
37
39
  @set_adapter.call(faraday)
38
40
  }
39
41
  }
@@ -16,6 +16,8 @@ module BandwidthIris
16
16
  def self.list_from_page_url(client, url, query=nil)
17
17
  response = client.make_request(:get, url, query)[0]
18
18
  items = response[:lnp_port_info_for_given_status]
19
+ return unless items
20
+
19
21
  items = items.is_a?(Array) ? items : [items]
20
22
  PaginatedResult.new(
21
23
  items.map { |item| PortIn.new(item, client) },
@@ -1,4 +1,4 @@
1
1
  module BandwidthIris
2
2
  # Version of this gem
3
- VERSION = "6.0.0"
3
+ VERSION = "7.1.0"
4
4
  end
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.require_paths = ["lib"]
17
17
  spec.add_dependency "builder"
18
18
  spec.add_dependency "faraday"
19
- spec.add_dependency "faraday_middleware"
19
+ spec.add_dependency "faraday-follow_redirects", '~> 0.3.0'
20
20
  spec.add_dependency "nori"
21
21
  spec.add_dependency "activesupport",">= 4.2.7"
22
22
  spec.add_dependency "rexml"
@@ -24,6 +24,14 @@ describe BandwidthIris::PortIn do
24
24
  expect(orders[1][:last_modified_date]).to eql(DateTime.new(2020, 1, 15, 19, 6, 10.085))
25
25
  end
26
26
  end
27
+
28
+ describe '#list orders empty' do
29
+ it 'should list port in orders with no orders' do
30
+ client.stubs.get('/v1.0/accounts/accountId/portins') {|env| [204, {}]}
31
+ orders = PortIn.list(client)
32
+ expect(orders.class).to eql(NilClass)
33
+ end
34
+ end
27
35
 
28
36
  describe '#create' do
29
37
  it 'should create an order' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-bandwidth-iris
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Belchikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-19 00:00:00.000000000 Z
11
+ date: 2023-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: faraday_middleware
42
+ name: faraday-follow_redirects
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 0.3.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 0.3.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: nori
57
57
  requirement: !ruby/object:Gem::Requirement