netbox-client-ruby 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rspec.yml +2 -0
  3. data/Gemfile.lock +4 -2
  4. data/gemfiles/faraday0.gemfile.lock +1 -1
  5. data/gemfiles/faraday1.gemfile.lock +1 -1
  6. data/gemfiles/faraday2.gemfile.lock +1 -1
  7. data/lib/netbox_client_ruby/api/circuits/circuit_terminations.rb +1 -1
  8. data/lib/netbox_client_ruby/api/circuits/circuit_types.rb +1 -1
  9. data/lib/netbox_client_ruby/api/circuits/circuits.rb +1 -1
  10. data/lib/netbox_client_ruby/api/circuits/providers.rb +1 -1
  11. data/lib/netbox_client_ruby/api/dcim/console_connections.rb +1 -1
  12. data/lib/netbox_client_ruby/api/dcim/console_ports.rb +1 -1
  13. data/lib/netbox_client_ruby/api/dcim/console_server_ports.rb +1 -1
  14. data/lib/netbox_client_ruby/api/dcim/device_roles.rb +1 -1
  15. data/lib/netbox_client_ruby/api/dcim/device_types.rb +1 -1
  16. data/lib/netbox_client_ruby/api/dcim/devices.rb +1 -1
  17. data/lib/netbox_client_ruby/api/dcim/interface_connections.rb +1 -1
  18. data/lib/netbox_client_ruby/api/dcim/interfaces.rb +1 -1
  19. data/lib/netbox_client_ruby/api/dcim/inventory_items.rb +1 -1
  20. data/lib/netbox_client_ruby/api/dcim/manufacturers.rb +1 -1
  21. data/lib/netbox_client_ruby/api/dcim/platforms.rb +1 -1
  22. data/lib/netbox_client_ruby/api/dcim/power_connections.rb +1 -1
  23. data/lib/netbox_client_ruby/api/dcim/power_outlets.rb +1 -1
  24. data/lib/netbox_client_ruby/api/dcim/power_ports.rb +1 -1
  25. data/lib/netbox_client_ruby/api/dcim/rack_groups.rb +1 -1
  26. data/lib/netbox_client_ruby/api/dcim/rack_reservations.rb +1 -1
  27. data/lib/netbox_client_ruby/api/dcim/rack_roles.rb +1 -1
  28. data/lib/netbox_client_ruby/api/dcim/racks.rb +1 -1
  29. data/lib/netbox_client_ruby/api/dcim/regions.rb +1 -1
  30. data/lib/netbox_client_ruby/api/dcim/sites.rb +1 -1
  31. data/lib/netbox_client_ruby/api/dcim/virtual_chassis_list.rb +1 -1
  32. data/lib/netbox_client_ruby/api/extras/config_contexts.rb +1 -1
  33. data/lib/netbox_client_ruby/api/extras/journal_entries.rb +1 -1
  34. data/lib/netbox_client_ruby/api/extras/tags.rb +1 -1
  35. data/lib/netbox_client_ruby/api/ipam/aggregates.rb +1 -1
  36. data/lib/netbox_client_ruby/api/ipam/ip_address.rb +1 -1
  37. data/lib/netbox_client_ruby/api/ipam/ip_addresses.rb +1 -1
  38. data/lib/netbox_client_ruby/api/ipam/ip_ranges.rb +1 -1
  39. data/lib/netbox_client_ruby/api/ipam/prefixes.rb +1 -1
  40. data/lib/netbox_client_ruby/api/ipam/rirs.rb +1 -1
  41. data/lib/netbox_client_ruby/api/ipam/roles.rb +1 -1
  42. data/lib/netbox_client_ruby/api/ipam/services.rb +1 -1
  43. data/lib/netbox_client_ruby/api/ipam/vlan_groups.rb +1 -1
  44. data/lib/netbox_client_ruby/api/ipam/vlans.rb +1 -1
  45. data/lib/netbox_client_ruby/api/ipam/vrfs.rb +1 -1
  46. data/lib/netbox_client_ruby/api/secrets/secret_roles.rb +1 -1
  47. data/lib/netbox_client_ruby/api/secrets/secrets.rb +1 -1
  48. data/lib/netbox_client_ruby/api/tenancy/tenant_groups.rb +1 -1
  49. data/lib/netbox_client_ruby/api/tenancy/tenants.rb +1 -1
  50. data/lib/netbox_client_ruby/api/virtualization/cluster_groups.rb +1 -1
  51. data/lib/netbox_client_ruby/api/virtualization/cluster_types.rb +1 -1
  52. data/lib/netbox_client_ruby/api/virtualization/clusters.rb +1 -1
  53. data/lib/netbox_client_ruby/api/virtualization/interfaces.rb +1 -1
  54. data/lib/netbox_client_ruby/api/virtualization/virtual_machines.rb +1 -1
  55. data/lib/netbox_client_ruby/communication.rb +2 -2
  56. data/lib/netbox_client_ruby/entity.rb +7 -7
  57. data/netbox-client-ruby.gemspec +1 -1
  58. metadata +3 -4
  59. data/VERSION +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec7ff93496769653e21eea7c3f04b184890fb7babdc00ea8f0f8173cc7040470
4
- data.tar.gz: ff23b46b13f2f849dd3b4b3465ff42ead9b771ff5a064a6aa27d9582031b4f4a
3
+ metadata.gz: e05b0acd52ba688b19ce5874d612d9601290f8ec3c88a4798849f976c3f0b368
4
+ data.tar.gz: 1cd26e233b325ff0502698cd91e6036f430d5d7920aa660b6edeb9852f8c1e11
5
5
  SHA512:
6
- metadata.gz: 2f2437ae2ecb563e586b62ac05a852f6726f46d2e117373ebf0381b6b9e615906fe74504ea5898036380c08ed98b8b2b72e04095ed3b9649303f9859fa0f7da8
7
- data.tar.gz: e8ab26e54501488a91c0bc1544c2cfb8c7b79801bb6e73fa87c0c3351d24481b2a07b87ae369dab263f2b3bd7450c035a179d959f443032fdc943cf48e14a8a3
6
+ metadata.gz: 8c12dbb99d8fe6a8c431252fe95489395b55d783161989b457cb8f53d97303289e13e83b45a55bdad9e679fac347b921ac64843c54e2c1b7c64d4d98d66fe383
7
+ data.tar.gz: 5bd2e5b74095102928eee7f63a2ddfd19f213e099f0eac97edd8ce7be58b754416f9a363b465aa07de99c6d99cc96cfb8542f9f2f6af1e9182862245539ae626
@@ -36,6 +36,8 @@ jobs:
36
36
  BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
37
37
  steps:
38
38
  - uses: actions/checkout@v2
39
+ with:
40
+ fetch-depth: 0
39
41
  - uses: ruby/setup-ruby@v1
40
42
  with:
41
43
  ruby-version: ${{ matrix.ruby }}
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- netbox-client-ruby (0.9.0)
4
+ netbox-client-ruby (0.10.0)
5
5
  dry-configurable (~> 1)
6
6
  faraday (>= 0.11.0, < 3)
7
7
  faraday-detailed_logger (~> 2.1)
@@ -63,7 +63,8 @@ GEM
63
63
  rainbow (3.1.1)
64
64
  rake (13.0.6)
65
65
  regexp_parser (2.8.1)
66
- rexml (3.2.6)
66
+ rexml (3.3.6)
67
+ strscan
67
68
  rspec (3.12.0)
68
69
  rspec-core (~> 3.12.0)
69
70
  rspec-expectations (~> 3.12.0)
@@ -93,6 +94,7 @@ GEM
93
94
  rubocop-ast (>= 0.7.1)
94
95
  ruby-progressbar (1.13.0)
95
96
  ruby2_keywords (0.0.5)
97
+ strscan (3.1.0)
96
98
  unicode-display_width (1.8.0)
97
99
  zeitwerk (2.6.12)
98
100
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- netbox-client-ruby (0.9.0)
4
+ netbox-client-ruby (0.10.0)
5
5
  dry-configurable (~> 1)
6
6
  faraday (>= 0.11.0, < 3)
7
7
  faraday-detailed_logger (~> 2.1)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- netbox-client-ruby (0.9.0)
4
+ netbox-client-ruby (0.10.0)
5
5
  dry-configurable (~> 1)
6
6
  faraday (>= 0.11.0, < 3)
7
7
  faraday-detailed_logger (~> 2.1)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- netbox-client-ruby (0.9.0)
4
+ netbox-client-ruby (0.10.0)
5
5
  dry-configurable (~> 1)
6
6
  faraday (>= 0.11.0, < 3)
7
7
  faraday-detailed_logger (~> 2.1)
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class CircuitTerminations
7
7
  include Entities
8
8
 
9
- path 'circuits/circuit-terminations.json'
9
+ path 'circuits/circuit-terminations/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class CircuitTypes
7
7
  include Entities
8
8
 
9
- path 'circuits/circuit-types.json'
9
+ path 'circuits/circuit-types/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -11,7 +11,7 @@ module NetboxClientRuby
11
11
  class Circuits
12
12
  include Entities
13
13
 
14
- path 'circuits/circuits.json'
14
+ path 'circuits/circuits/'
15
15
  data_key 'results'
16
16
  count_key 'count'
17
17
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Providers
7
7
  include Entities
8
8
 
9
- path 'circuits/providers.json'
9
+ path 'circuits/providers/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class ConsoleConnections
7
7
  include Entities
8
8
 
9
- path 'dcim/console-connections.json'
9
+ path 'dcim/console-connections/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class ConsolePorts
7
7
  include Entities
8
8
 
9
- path 'dcim/console-ports.json'
9
+ path 'dcim/console-ports/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class ConsoleServerPorts
7
7
  include Entities
8
8
 
9
- path 'dcim/console-server-ports.json'
9
+ path 'dcim/console-server-ports/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class DeviceRoles
7
7
  include Entities
8
8
 
9
- path 'dcim/device-roles.json'
9
+ path 'dcim/device-roles/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class DeviceTypes
7
7
  include Entities
8
8
 
9
- path 'dcim/device-types.json'
9
+ path 'dcim/device-types/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Devices
7
7
  include Entities
8
8
 
9
- path 'dcim/devices.json'
9
+ path 'dcim/devices/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class InterfaceConnections
7
7
  include Entities
8
8
 
9
- path 'dcim/interface-connections.json'
9
+ path 'dcim/interface-connections/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Interfaces
7
7
  include Entities
8
8
 
9
- path 'dcim/interfaces.json'
9
+ path 'dcim/interfaces/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class InventoryItems
7
7
  include Entities
8
8
 
9
- path 'dcim/inventory-items.json'
9
+ path 'dcim/inventory-items/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Manufacturers
7
7
  include Entities
8
8
 
9
- path 'dcim/manufacturers.json'
9
+ path 'dcim/manufacturers/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Platforms
7
7
  include Entities
8
8
 
9
- path 'dcim/platforms.json'
9
+ path 'dcim/platforms/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class PowerConnections
7
7
  include Entities
8
8
 
9
- path 'dcim/power-connections.json'
9
+ path 'dcim/power-connections/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class PowerOutlets
7
7
  include Entities
8
8
 
9
- path 'dcim/power-outlets.json'
9
+ path 'dcim/power-outlets/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class PowerPorts
7
7
  include Entities
8
8
 
9
- path 'dcim/power-ports.json'
9
+ path 'dcim/power-ports/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class RackGroups
7
7
  include Entities
8
8
 
9
- path 'dcim/rack-groups.json'
9
+ path 'dcim/rack-groups/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class RackReservations
7
7
  include Entities
8
8
 
9
- path 'dcim/rack-reservations.json'
9
+ path 'dcim/rack-reservations/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class RackRoles
7
7
  include Entities
8
8
 
9
- path 'dcim/rack-roles.json'
9
+ path 'dcim/rack-roles/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Racks
7
7
  include Entities
8
8
 
9
- path 'dcim/racks.json'
9
+ path 'dcim/racks/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Regions
7
7
  include Entities
8
8
 
9
- path 'dcim/regions.json'
9
+ path 'dcim/regions/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Sites
7
7
  include Entities
8
8
 
9
- path 'dcim/sites.json'
9
+ path 'dcim/sites/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class VirtualChassisList
7
7
  include Entities
8
8
 
9
- path 'dcim/virtual-chassis.json'
9
+ path 'dcim/virtual-chassis/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class ConfigContexts
7
7
  include Entities
8
8
 
9
- path 'extras/config-contexts.json'
9
+ path 'extras/config-contexts/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class JournalEntries
7
7
  include Entities
8
8
 
9
- path 'extras/journal-entries.json'
9
+ path 'extras/journal-entries/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Tags
7
7
  include Entities
8
8
 
9
- path 'extras/tags.json'
9
+ path 'extras/tags/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Aggregates
7
7
  include Entities
8
8
 
9
- path 'ipam/aggregates.json'
9
+ path 'ipam/aggregates/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -38,7 +38,7 @@ module NetboxClientRuby
38
38
 
39
39
  return nil unless interface_data
40
40
 
41
- if interface_data.key? ('virtual_machine')
41
+ if interface_data.key?('virtual_machine')
42
42
  Virtualization::Interface.new interface_data['id']
43
43
  else
44
44
  DCIM::Interface.new interface_data['id']
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class IpAddresses
7
7
  include Entities
8
8
 
9
- path 'ipam/ip-addresses.json'
9
+ path 'ipam/ip-addresses/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class IpRanges
7
7
  include Entities
8
8
 
9
- path 'ipam/ip-ranges.json'
9
+ path 'ipam/ip-ranges/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Prefixes
7
7
  include Entities
8
8
 
9
- path 'ipam/prefixes.json'
9
+ path 'ipam/prefixes/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Rirs
7
7
  include Entities
8
8
 
9
- path 'ipam/rirs.json'
9
+ path 'ipam/rirs/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Roles
7
7
  include Entities
8
8
 
9
- path 'ipam/roles.json'
9
+ path 'ipam/roles/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Services
7
7
  include Entities
8
8
 
9
- path 'ipam/services.json'
9
+ path 'ipam/services/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class VlanGroups
7
7
  include Entities
8
8
 
9
- path 'ipam/vlan-groups.json'
9
+ path 'ipam/vlan-groups/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Vlans
7
7
  include Entities
8
8
 
9
- path 'ipam/vlans.json'
9
+ path 'ipam/vlans/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Vrfs
7
7
  include Entities
8
8
 
9
- path 'ipam/vrfs.json'
9
+ path 'ipam/vrfs/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class SecretRoles
7
7
  include Entities
8
8
 
9
- path 'secrets/secret-roles.json'
9
+ path 'secrets/secret-roles/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Secrets
7
7
  include Entities
8
8
 
9
- path 'secrets/secrets.json'
9
+ path 'secrets/secrets/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class TenantGroups
7
7
  include Entities
8
8
 
9
- path 'tenancy/tenant-groups.json'
9
+ path 'tenancy/tenant-groups/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Tenants
7
7
  include Entities
8
8
 
9
- path 'tenancy/tenants.json'
9
+ path 'tenancy/tenants/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class ClusterGroups
7
7
  include Entities
8
8
 
9
- path 'virtualization/cluster-groups.json'
9
+ path 'virtualization/cluster-groups/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class ClusterTypes
7
7
  include Entities
8
8
 
9
- path 'virtualization/cluster-types.json'
9
+ path 'virtualization/cluster-types/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Clusters
7
7
  include Entities
8
8
 
9
- path 'virtualization/clusters.json'
9
+ path 'virtualization/clusters/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class Interfaces
7
7
  include Entities
8
8
 
9
- path 'virtualization/interfaces.json'
9
+ path 'virtualization/interfaces/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -6,7 +6,7 @@ module NetboxClientRuby
6
6
  class VirtualMachines
7
7
  include Entities
8
8
 
9
- path 'virtualization/virtual-machines.json'
9
+ path 'virtualization/virtual-machines/'
10
10
  data_key 'results'
11
11
  count_key 'count'
12
12
  entity_creator :entity_creator
@@ -23,8 +23,8 @@ module NetboxClientRuby
23
23
  variable_name = sanitize_variable_name(k)
24
24
  variable_name = "_#{variable_name}" if objectified_instance.methods.map(&:to_s).include?(variable_name)
25
25
 
26
- objectified_instance.instance_variable_set("@#{variable_name}", v)
27
- objectified_class.send(:define_method, variable_name, proc { instance_variable_get("@#{variable_name}") })
26
+ objectified_instance.instance_variable_set(:"@#{variable_name}", v)
27
+ objectified_class.send(:define_method, variable_name, proc { instance_variable_get(:"@#{variable_name}") })
28
28
  end
29
29
  objectified_instance
30
30
  end
@@ -38,7 +38,7 @@ module NetboxClientRuby
38
38
  end
39
39
 
40
40
  @id_fields.keys.each do |field|
41
- define_method(field) { instance_variable_get "@#{field}" }
41
+ define_method(field) { instance_variable_get :"@#{field}" }
42
42
  end
43
43
 
44
44
  @id_fields
@@ -108,13 +108,13 @@ module NetboxClientRuby
108
108
  return self if given_values.nil?
109
109
 
110
110
  if id_fields.count == 1 && !given_values.is_a?(Hash)
111
- instance_variable_set("@#{id_fields.keys.first}", given_values)
111
+ instance_variable_set(:"@#{id_fields.keys.first}", given_values)
112
112
  return self
113
113
  end
114
114
 
115
115
  given_values.each do |field, value|
116
116
  if id_fields.key? field.to_s
117
- instance_variable_set "@#{field}", value
117
+ instance_variable_set :"@#{field}", value
118
118
  else
119
119
  # via method_missing, because it checks for readonly fields, etc.
120
120
  method_missing("#{field}=", value)
@@ -164,7 +164,7 @@ module NetboxClientRuby
164
164
  s_attribute = attribute.to_s
165
165
  next if readonly_fields.include? s_attribute
166
166
 
167
- sym_attr_writer = "#{attribute}=".to_sym
167
+ sym_attr_writer = :"#{attribute}="
168
168
  if methods.include?(sym_attr_writer)
169
169
  public_send(sym_attr_writer, values)
170
170
  else
@@ -197,7 +197,7 @@ module NetboxClientRuby
197
197
 
198
198
  if name.end_with?('=')
199
199
  is_readonly_field = readonly_fields.include?(name[0..-2])
200
- is_instance_variable = instance_variables.include?("@#{name[0..-2]}".to_sym)
200
+ is_instance_variable = instance_variables.include?(:"@#{name[0..-2]}")
201
201
  not_this_classes_business = is_readonly_field || is_instance_variable
202
202
 
203
203
  return super if not_this_classes_business
@@ -328,12 +328,12 @@ module NetboxClientRuby
328
328
  raise LocalError, "Can't find the id field '#{id_field}' in the received data."
329
329
  end
330
330
 
331
- instance_variable_set("@#{id_attr}", data[id_field])
331
+ instance_variable_set(:"@#{id_attr}", data[id_field])
332
332
  end
333
333
  end
334
334
 
335
335
  def ids_set?
336
- id_fields.map { |id_attr, _| instance_variable_get("@#{id_attr}") }.all?
336
+ id_fields.map { |id_attr, _| instance_variable_get(:"@#{id_attr}") }.all?
337
337
  end
338
338
  end
339
339
  end
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'netbox-client-ruby'
6
- spec.version = File.read(File.expand_path('VERSION', __dir__)).strip
6
+ spec.version = `git describe --tags --match="v[0-9]*" --abbrev=0`.strip.delete_prefix("v")
7
7
 
8
8
  spec.summary = 'A read/write client for Netbox v2.'
9
9
  spec.homepage = 'https://github.com/ninech/netbox-client-ruby'
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.10.0
4
+ version: 0.10.1
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: 2023-09-29 00:00:00.000000000 Z
11
+ date: 2024-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -195,7 +195,6 @@ files:
195
195
  - LICENSE.txt
196
196
  - README.md
197
197
  - Rakefile
198
- - VERSION
199
198
  - bin/console
200
199
  - bin/setup
201
200
  - docker-compose.test.yml
@@ -344,7 +343,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
344
343
  - !ruby/object:Gem::Version
345
344
  version: '0'
346
345
  requirements: []
347
- rubygems_version: 3.4.10
346
+ rubygems_version: 3.4.19
348
347
  signing_key:
349
348
  specification_version: 4
350
349
  summary: A read/write client for Netbox v2.
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.10.0