netbox-client-ruby 0.5.2 → 0.5.3

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: 5ec30613f5add5021d332c0e68eeb8298dde60946ed7230073f2e06ea4cdfe85
4
- data.tar.gz: b17446a970898d1f35ab15c96438d1f6a63c01d6e711ce5a519ce10572e3fc25
3
+ metadata.gz: 48958aa3e4cf9397ae5e5a3cafa9f86231222e034d36c63cf474d2ab5d2d45a9
4
+ data.tar.gz: f07d74e40655d6af3ec1d716ec84b51c4da22ea6d5fc7327bd6bd93b4e72c401
5
5
  SHA512:
6
- metadata.gz: 7c6b2199fe9b0b446beda2d3e4dfdb548a49e695e4e8f2b5a6cd022c89c2a7c052071431345b199080dd64134465c04191c62a0d097f112967886e37666585ad
7
- data.tar.gz: 148105c05827440b97d25d47b9f6869baf3be23bd72069d27b47a47c9c606ced20832d684011275cacb0b5d0f856bc247fdc34cddccb7106af81b0412a16176b
6
+ metadata.gz: 0130beda3ec3ccac755a61c96cad85b5f3371c8ce1bd1e2f7bb4c66e36b97495cec08f109a137ea74f1536a593aea250489e5f6ac5073381c8a0675154220bbc
7
+ data.tar.gz: 6f571689fecc43e4517c126365b15e7c1bdab19f29152a834abfdb6f2bcda42eafc92ceb43512641542aa041976804a4af906cc85810a4bbe15fd850678f0af3
@@ -0,0 +1,27 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "*"
7
+
8
+ jobs:
9
+ build:
10
+ name: Build + Publish
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Set up Ruby 2.6
15
+ uses: actions/setup-ruby@v1
16
+ with:
17
+ ruby-version: 2.6.x
18
+ - name: Publish to RubyGems
19
+ run: |
20
+ mkdir -p $HOME/.gem
21
+ touch $HOME/.gem/credentials
22
+ chmod 0600 $HOME/.gem/credentials
23
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
24
+ gem build *.gemspec
25
+ gem push *.gem
26
+ env:
27
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
@@ -0,0 +1,25 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby CI
9
+
10
+ on: [push, pull_request]
11
+ jobs:
12
+ test:
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os: [ubuntu-latest]
17
+ ruby: [2.5, 2.6, 2.7]
18
+ runs-on: ${{ matrix.os }}
19
+ steps:
20
+ - uses: actions/checkout@v2
21
+ - uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby }}
24
+ bundler-cache: true
25
+ - run: bundle exec rake spec
data/README.md CHANGED
@@ -206,7 +206,7 @@ To simplify development, e.g. via the `bin/console` described above, there is a
206
206
  You can use it to query almost every object and relation in Netbox.
207
207
 
208
208
  ```bash
209
- cat dump.sql | docker-compose exec postgres psql -U postgres
209
+ docker exec -i netbox-client-ruby_postgres_1 psql -U postgres < dump.sql
210
210
  ```
211
211
 
212
212
  ### Dump Development from Database
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.2
1
+ 0.5.3
data/docker-compose.yml CHANGED
@@ -2,14 +2,14 @@ version: '2'
2
2
  services:
3
3
  nginx:
4
4
  image: nginx:1.14-alpine
5
- command: nginx -g 'daemon off;' -c /etc/netbox-nginx/nginx.conf
5
+ command: nginx -c /etc/netbox-nginx/nginx.conf
6
6
  depends_on:
7
7
  - netbox
8
8
  volumes:
9
9
  - netbox-nginx-config:/etc/netbox-nginx/
10
10
  - netbox-static-files:/opt/netbox/netbox/static
11
11
  ports:
12
- - 8080
12
+ - 80:8080
13
13
  netbox:
14
14
  image: ninech/netbox:v2.4.3
15
15
  depends_on:
@@ -24,12 +24,12 @@ module NetboxClientRuby
24
24
 
25
25
  object_fields(
26
26
  provider: proc do |raw_data|
27
- Circuit::CircuitProvider.new raw_data['id']
27
+ Provider.new raw_data['id']
28
28
  end,
29
29
  status: proc do |raw_status|
30
30
  STATUS_VALUES.key(raw_status['value']) || raw_status['value']
31
31
  end,
32
- type: proc { |raw_data| Circuit::CircuitType.new raw_data['id'] },
32
+ type: proc { |raw_data| CircuitType.new raw_data['id'] },
33
33
  tenant: proc { |raw_data| Tenancy::Tenant.new raw_data['id'] }
34
34
  )
35
35
  end
@@ -130,6 +130,8 @@ module NetboxClientRuby
130
130
  end
131
131
 
132
132
  def reload
133
+ raise LocalError, "Can't 'reload', this object has never been saved" unless ids_set?
134
+
133
135
  @data = get
134
136
  revert
135
137
  self
@@ -259,7 +261,7 @@ module NetboxClientRuby
259
261
  end
260
262
 
261
263
  def get
262
- response connection.get path unless @deleted
264
+ response connection.get path unless @deleted or !ids_set?
263
265
  end
264
266
 
265
267
  def readonly_fields
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netbox-client-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Mäder
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-06 00:00:00.000000000 Z
11
+ date: 2021-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -28,22 +28,22 @@ dependencies:
28
28
  name: faraday
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '0.11'
34
31
  - - ">="
35
32
  - !ruby/object:Gem::Version
36
33
  version: 0.11.0
34
+ - - "~>"
35
+ - !ruby/object:Gem::Version
36
+ version: '0.11'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - "~>"
42
- - !ruby/object:Gem::Version
43
- version: '0.11'
44
41
  - - ">="
45
42
  - !ruby/object:Gem::Version
46
43
  version: 0.11.0
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '0.11'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: faraday-detailed_logger
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -204,9 +204,10 @@ extensions: []
204
204
  extra_rdoc_files: []
205
205
  files:
206
206
  - ".dockerignore"
207
+ - ".github/workflows/gem-push.yml"
208
+ - ".github/workflows/rspec.yml"
207
209
  - ".gitignore"
208
210
  - ".rspec"
209
- - ".travis.yml"
210
211
  - Dockerfile
211
212
  - Gemfile
212
213
  - LICENSE.txt
@@ -346,8 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
346
347
  - !ruby/object:Gem::Version
347
348
  version: '0'
348
349
  requirements: []
349
- rubyforge_project:
350
- rubygems_version: 2.7.7
350
+ rubygems_version: 3.0.3
351
351
  signing_key:
352
352
  specification_version: 4
353
353
  summary: A read/write client for Netbox v2.
data/.travis.yml DELETED
@@ -1,25 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- before_install: gem install bundler
5
- rvm:
6
- - 2.3
7
- - 2.4
8
- - 2.5
9
- - 2.5.1
10
- notifications:
11
- email:
12
- on_success: never
13
- slack:
14
- secure: kcRMRU/epqsBn3n0McTz0RdGSR07xhyz5g6jOfufA1bRlmLsIQtIaeqeO0VLtcQFUd5JJ1Z2iVz9YdvbA0RLeXwI0ZS96g9NWZn1TFBk6zMM8/CN4kZcWcPKO9INbBMziRlF7lb039CRrusE0ei1YJLojPGWnsKITcS88rSX+Uq0wPDaN6nEzQbDU2HV3TBl31W0LlYYpcmz6Ju9HGVdU1NrA0DRbeV78YmUkyJ4v6p8pgOaKKx+oZidU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qMCiBstdemj77ZKsumtJ3MW1FIkvVByxeDYTPhULYP075Pki5Y/XCDTL+WUBzL3x1cVnTBrIUz+qpKhLA="
20
- gem: netbox-client-ruby
21
- on:
22
- tags: true
23
- repo: ninech/netbox-client-ruby
24
- condition: "$TRAVIS_RUBY_VERSION == 2.5.1"
25
- skip_cleanup: true