dslimple 2.0.1 → 2.0.6

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: bc742760b9f2b0f5bb0622bef99d046fe664719459572d124f5b5ac0172d7139
4
- data.tar.gz: 2f964c7a33967651e5edd57b2551c7fd1b99430c8b017261910a1034078bb403
3
+ metadata.gz: 1701e558aa2fed91d0b6c72af872774b72041f036bf02dd1068aa1709d5ccfd9
4
+ data.tar.gz: 04fed2502ce2e1b0075fdebafc3c56fd298b8a46ba4b231e7fa1f2e69e3ee887
5
5
  SHA512:
6
- metadata.gz: 0bcde8ec0d0b9fdefa121dcfd422d50ef78d70aaec2d14b6927cf4f5730f6c840cda726e9dc02503b8ad298b2faad9083590fb4a225bbcd44b82ed390c304980
7
- data.tar.gz: 677c475d42387ac7ab0013869623aa5814c273af405fa9474c2c27e5db331aa47e51fda174f05f5e57951986ed8758430f32c9c283c934375ef75ba3c86e1598
6
+ metadata.gz: 910f9787ee627aad9b915e958e051d2e6d93cb5dd495d349631ffd2f535ea770720506dc9ed328522154a78d42d036eb83d57c6fbe86ea0d61d27b8b11aa9a46
7
+ data.tar.gz: 449186cae4d50e07048486daef865183f8efd808ec5b3f0f275ed501847a156e421083711459f8b39d24aba36d1c52beef9c05cbb97a60358264f3faabaf97b5
data/lib/dslimple/cli.rb CHANGED
@@ -68,7 +68,7 @@ class Dslimple::CLI < Thor
68
68
  when Dnsimple::AuthenticationError
69
69
  error(set_color(e.message, :red, :bold))
70
70
  when Dnsimple::RequestError
71
- error(set_color("#{e.message}: #{JSON.parse(e.response.body)['message']}", :yellow, :bold))
71
+ error(set_color("#{e.message}: #{JSON.parse(e.http_response.body)['message']}", :yellow, :bold))
72
72
  when Dslimple::DSL::Error
73
73
  error(set_color(e.message, :yellow, :bold))
74
74
  else
@@ -46,13 +46,14 @@ class Dslimple::Client < Dnsimple::Client
46
46
  end
47
47
 
48
48
  def all_records(zone)
49
- response = zones.list_records(account_id, zone.name)
49
+ zone = zone.name if zone.is_a?(Dslimple::Zone)
50
+ response = zones.list_zone_records(account_id, zone)
50
51
 
51
52
  records = []
52
53
  while response
53
54
  records = records + response.data.map do |record|
54
55
  record = Dslimple::Record.new(record)
55
- record.zone = zone.name
56
+ record.zone = zone
56
57
  record
57
58
  end
58
59
 
@@ -36,7 +36,7 @@ class Dslimple::Exporter
36
36
  File.open(zonefile, 'w') do |fd|
37
37
  export(fd, [zone])
38
38
  end
39
- fd.puts "require '#{zonefile.relative_path_from(file.dirname)}'"
39
+ fd.puts "require '#{zonefile.relative_path_from(Pathname.new(fd.path).dirname)}'"
40
40
  end
41
41
  end
42
42
 
@@ -52,11 +52,11 @@ class Dslimple::Query
52
52
  def execute_record(api_client, account_id)
53
53
  case operation
54
54
  when :addition
55
- api_client.zones.create_record(account_id, zone, params)
55
+ api_client.zones.create_zone_record(account_id, zone, params)
56
56
  when :modification
57
- api_client.zones.update_record(account_id, zone, params[:id], params)
57
+ api_client.zones.update_zone_record(account_id, zone, params[:id], params)
58
58
  when :deletion
59
- api_client.zones.delete_record(account_id, zone, params[:id])
59
+ api_client.zones.delete_zone_record(account_id, zone, params[:id])
60
60
  end
61
61
  end
62
62
  end
@@ -1,6 +1,5 @@
1
1
  require 'dslimple'
2
2
  require 'dnsimple'
3
- require 'dslimple'
4
3
 
5
4
  class Dslimple::Record
6
5
  RECORD_TYPES = %w[A ALIAS CNAME MX SPF URL TXT NS SRV NAPTR PTR AAAA SSHFP HINFO POOL CAA]
@@ -59,7 +58,7 @@ class Dslimple::Record
59
58
  end
60
59
 
61
60
  def to_params
62
- {
61
+ params = {
63
62
  id: @id,
64
63
  name: name,
65
64
  type: type.to_s.upcase,
@@ -68,6 +67,9 @@ class Dslimple::Record
68
67
  priority: priority,
69
68
  regions: regions,
70
69
  }
70
+ params.delete(:regions)
71
+
72
+ params
71
73
  end
72
74
 
73
75
  private
@@ -1,3 +1,3 @@
1
1
  module Dslimple
2
- VERSION = '2.0.1'.freeze
2
+ VERSION = '2.0.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dslimple
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Kusano
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-21 00:00:00.000000000 Z
11
+ date: 2021-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -132,7 +132,7 @@ homepage: https://github.com/zeny-io/dslimple
132
132
  licenses:
133
133
  - MIT
134
134
  metadata: {}
135
- post_install_message:
135
+ post_install_message:
136
136
  rdoc_options: []
137
137
  require_paths:
138
138
  - lib
@@ -147,9 +147,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
- rubyforge_project:
151
- rubygems_version: 2.7.6
152
- signing_key:
150
+ rubygems_version: 3.2.3
151
+ signing_key:
153
152
  specification_version: 4
154
153
  summary: DSLimple is a tool to manage DNSimple.
155
154
  test_files: []