dnsmadeeasy 0.3.5 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +31 -0
  3. data/.gitignore +2 -0
  4. data/.rubocop.yml +6 -0
  5. data/.rubocop_todo.yml +272 -107
  6. data/.travis.yml +2 -1
  7. data/CLAUDE.md +67 -0
  8. data/Gemfile +9 -1
  9. data/README.md +506 -310
  10. data/Rakefile +4 -4
  11. data/dnsmadeeasy.gemspec +44 -27
  12. data/docs/badges/coverage_badge.svg +21 -0
  13. data/docs/dry-cli-based-tools.webloc +8 -0
  14. data/docs/plan-zone-management.md +756 -0
  15. data/docs/plans/01-plan-ruby4-baseline.md +38 -0
  16. data/docs/plans/02-plan-dry-cli-launcher.md +44 -0
  17. data/docs/plans/03-plan-account-command.md +43 -0
  18. data/docs/plans/04-plan-zone-record-model.md +48 -0
  19. data/docs/plans/05-plan-zone-parser.md +41 -0
  20. data/docs/plans/06-plan-zone-formatter.md +43 -0
  21. data/docs/plans/07-plan-zone-export.md +58 -0
  22. data/docs/plans/08-plan-zone-diff.md +42 -0
  23. data/docs/plans/09-plan-zone-apply.md +69 -0
  24. data/docs/plans/10-plan-docs-cleanup.md +55 -0
  25. data/docs/spec-zone-management.md +242 -0
  26. data/exe/dme +13 -2
  27. data/exe/dmez +6 -0
  28. data/lib/dme.rb +6 -6
  29. data/lib/dnsmadeeasy/api/client.rb +31 -32
  30. data/lib/dnsmadeeasy/cli/box_output.rb +9 -0
  31. data/lib/dnsmadeeasy/cli/commands/account.rb +222 -0
  32. data/lib/dnsmadeeasy/cli/commands/base.rb +119 -0
  33. data/lib/dnsmadeeasy/cli/commands/legacy_operation.rb +30 -0
  34. data/lib/dnsmadeeasy/cli/commands/version.rb +22 -0
  35. data/lib/dnsmadeeasy/cli/commands/zone.rb +326 -0
  36. data/lib/dnsmadeeasy/cli/commands.rb +19 -0
  37. data/lib/dnsmadeeasy/cli/input.rb +14 -0
  38. data/lib/dnsmadeeasy/cli/launcher.rb +53 -0
  39. data/lib/dnsmadeeasy/cli/message_helpers.rb +81 -0
  40. data/lib/dnsmadeeasy/cli/reported_error.rb +10 -0
  41. data/lib/dnsmadeeasy/credentials/api_keys.rb +11 -9
  42. data/lib/dnsmadeeasy/credentials/yaml_file.rb +28 -27
  43. data/lib/dnsmadeeasy/credentials.rb +3 -4
  44. data/lib/dnsmadeeasy/runner.rb +102 -98
  45. data/lib/dnsmadeeasy/types.rb +19 -0
  46. data/lib/dnsmadeeasy/version.rb +2 -1
  47. data/lib/dnsmadeeasy/zone/aname_flattener.rb +63 -0
  48. data/lib/dnsmadeeasy/zone/apply_executor.rb +189 -0
  49. data/lib/dnsmadeeasy/zone/apply_result.rb +22 -0
  50. data/lib/dnsmadeeasy/zone/diff.rb +152 -0
  51. data/lib/dnsmadeeasy/zone/file.rb +26 -0
  52. data/lib/dnsmadeeasy/zone/parser.rb +172 -0
  53. data/lib/dnsmadeeasy/zone/plan.rb +28 -0
  54. data/lib/dnsmadeeasy/zone/plan_action.rb +29 -0
  55. data/lib/dnsmadeeasy/zone/plan_renderer.rb +91 -0
  56. data/lib/dnsmadeeasy/zone/provider_record.rb +18 -0
  57. data/lib/dnsmadeeasy/zone/record.rb +44 -0
  58. data/lib/dnsmadeeasy/zone/record_set.rb +23 -0
  59. data/lib/dnsmadeeasy/zone/remote_adapter.rb +94 -0
  60. data/lib/dnsmadeeasy/zone/remote_records.rb +26 -0
  61. data/lib/dnsmadeeasy/zone/serializer.rb +115 -0
  62. data/lib/dnsmadeeasy.rb +61 -31
  63. metadata +184 -23
data/Rakefile CHANGED
@@ -10,15 +10,15 @@ def shell(*args)
10
10
  end
11
11
 
12
12
  task :permissions do
13
- shell('rm -rf pkg/ tmp/' )
14
- shell("chmod -v o+r,g+r * */* */*/* */*/*/* */*/*/*/* */*/*/*/*/*")
15
- shell("find . -type d -exec chmod o+x,g+x {} \\;")
13
+ shell('rm -rf pkg/ tmp/')
14
+ shell('chmod -v o+r,g+r * */* */*/* */*/*/* */*/*/*/* */*/*/*/*/*')
15
+ shell('find . -type d -exec chmod o+x,g+x {} \\;')
16
16
  end
17
17
 
18
18
  task build: :permissions
19
19
 
20
20
  YARD::Rake::YardocTask.new(:doc) do |t|
21
- t.files = %w(lib/**/*.rb exe/*.rb - README.md LICENSE.txt)
21
+ t.files = %w[lib/**/*.rb exe/*.rb - README.md LICENSE.txt]
22
22
  t.options.unshift('--title', 'DNS Client for DnsMadeEasy')
23
23
  t.after = -> { exec('open doc/index.html') }
24
24
  end
data/dnsmadeeasy.gemspec CHANGED
@@ -1,54 +1,63 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # vim: ft=ruby
4
+
3
5
  lib = File.expand_path('lib', __dir__)
4
6
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
7
  require 'dnsmadeeasy/version'
6
8
 
7
9
  # rubocop:todo Naming/HeredocDelimiterCase
8
10
  DnsMadeEasy::DESCRIPTION = <<~eof
9
- This is an authoratative and fully-featured API client for the DNS Provider "DnsMadeEasy.com".
11
+ This is an authoratative and fully-featured API client for the
12
+ DNS Provider "DnsMadeEasy.com".
10
13
 
11
- This library offers both a rich Ruby API that you can use to automate DNS record management, as well
12
- as a rich CLI interface with the command line executable "dme" installed when you install the gem.
13
- The gem additionally supports storing credentials in the ~/.dnsmadeeasy/credentials.yml
14
- file, supports multiple accounts, encryption, and more.
14
+ This library offers both a rich Ruby API that you can use to
15
+ automate DNS record management, as well
16
+ as a rich CLI interface with the command line executable "dme"
17
+ installed when you install the gem.
18
+ The gem additionally supports storing credentials in
19
+ the ~/.dnsmadeeasy/credentials.yml
20
+ file, supports multiple accounts, encryption, and more.
15
21
 
16
- If you are using Chef consider using the "dnsmadeeasy" Chef Cookbook, while uses this gem behind
17
- the scenes: https://supermarket.chef.io/cookbooks/dnsmadeeasy<br />
22
+ If you are using Chef consider using the "dnsmadeeasy"
23
+ Chef Cookbook, while uses this gem behind
24
+ the scenes: https://supermarket.chef.io/cookbooks/dnsmadeeasy
18
25
 
19
- ACKNOWLEDGEMENTS:
26
+ ACKNOWLEDGEMENTS:
20
27
 
21
- 1. This gem is based on the original work contributed by Wanelo.com to the
22
- now abandonded "dnsmadeeasy-rest-api" client.
28
+ 1. This gem is based on the original work contributed by Wanelo.com to the
29
+ now abandonded "dnsmadeeasy-rest-api" client.
23
30
 
24
- 2. We also wish to thank the gem author Phil Cohen who
25
- kindly yielded the "dnsmadeeasy" RubyGems namespace to this gem.
31
+ 2. We also wish to thank the gem author Phil Cohen who
32
+ kindly yielded the "dnsmadeeasy" RubyGems namespace to this gem.
26
33
 
27
- 3. We also thank Praneeth Are for contributing the support for secondary domains in 0.3.5.
34
+ 3. We also thank Praneeth Are for contributing the support for
35
+ secondary domains in 0.3.5.
28
36
  eof
29
37
 
30
38
  Gem::Specification.new do |spec|
31
39
  spec.name = 'dnsmadeeasy'
32
40
  spec.version = DnsMadeEasy::VERSION
33
- spec.authors = ['Konstantin Gredeskoul', 'Arnoud Vermeer', 'Paul Henry', 'James Hart', 'Phil Cohen', 'Praneeth Are']
34
- spec.email = %w(kigster@gmail.com letuboy@gmail.com hjhart@gmail.com)
41
+ spec.authors = ['Konstantin Gredeskoul', 'Arnoud Vermeer', 'Paul Henry', 'James Hart', 'Phil Cohen',
42
+ 'Praneeth Are']
43
+ spec.email = %w[kigster@gmail.com letuboy@gmail.com hjhart@gmail.com]
35
44
  spec.summary = DnsMadeEasy::DESCRIPTION
36
45
  spec.description = DnsMadeEasy::DESCRIPTION
37
- # rubocop:todo Naming/HeredocDelimiterNaming
38
46
  spec.post_install_message = <<~EOF
39
- Thank you for using the DnsMadeEasy ruby gem, the Ruby client
40
- API for DnsMadeEasy.com's SDK v2. Please note that this gem
41
- comes with a rich command line utility 'dme' which you can use
42
- instead of the ruby API if you prefer. Run `dme` with no
43
- arguments to see the help message.
44
-
45
- You can also store (multi-account) credentials in a YAML file in
46
- your home directory. For more information, please see README at:
47
- https://github.com/kigster/dnsmadeeasy
47
+ Thank you for using the DnsMadeEasy ruby gem, the Ruby client
48
+ API for DnsMadeEasy.com's SDK v2. Please note that this gem
49
+ comes with a rich command line utility 'dme' which you can use
50
+ instead of the ruby API if you prefer. Run `dme` with no
51
+ arguments to see the help message.
52
+
53
+ You can also store (multi-account) credentials in a YAML file in
54
+ your home directory. For more information, please see README at:
55
+ https://github.com/kigster/dnsmadeeasy
48
56
  EOF
49
57
 
50
58
  spec.homepage = 'https://github.com/kigster/dnsmadeeasy'
51
59
  spec.license = 'MIT'
60
+ spec.required_ruby_version = '~> 4.0'
52
61
 
53
62
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
54
63
  f.match(%r{^(test|spec|features)/})
@@ -60,10 +69,17 @@ Gem::Specification.new do |spec|
60
69
 
61
70
  spec.add_dependency 'awesome_print'
62
71
  spec.add_dependency 'colored2'
72
+ spec.add_dependency 'dns-zonefile'
73
+ spec.add_dependency 'dry-cli'
74
+ spec.add_dependency 'dry-monads'
75
+ spec.add_dependency 'dry-struct'
76
+ spec.add_dependency 'dry-types'
63
77
  spec.add_dependency 'hashie'
64
78
  spec.add_dependency 'sym'
79
+ spec.add_dependency 'tsort'
80
+ spec.add_dependency 'tty-box'
81
+ spec.add_dependency 'tty-spinner'
65
82
 
66
- spec.add_development_dependency 'bundler'
67
83
  spec.add_development_dependency 'rake'
68
84
  spec.add_development_dependency 'relaxed-rubocop'
69
85
  spec.add_development_dependency 'rspec'
@@ -73,5 +89,6 @@ Gem::Specification.new do |spec|
73
89
  spec.add_development_dependency 'webmock'
74
90
  spec.add_development_dependency 'yard'
75
91
 
76
- # spec.add_development_dependency 'aruba'
92
+ spec.add_development_dependency 'aruba'
93
+ spec.metadata['rubygems_mfa_required'] = 'true'
77
94
  end
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="99" height="20">
3
+ <linearGradient id="b" x2="0" y2="100%">
4
+ <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
5
+ <stop offset="1" stop-opacity=".1"/>
6
+ </linearGradient>
7
+ <mask id="a">
8
+ <rect width="99" height="20" rx="3" fill="#fff"/>
9
+ </mask>
10
+ <g mask="url(#a)">
11
+ <path fill="#555" d="M0 0h63v20H0z"/>
12
+ <path fill="#4c1" d="M63 0h36v20H63z"/>
13
+ <path fill="url(#b)" d="M0 0h99v20H0z"/>
14
+ </g>
15
+ <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
16
+ <text x="31.5" y="15" fill="#010101" fill-opacity=".3">coverage</text>
17
+ <text x="31.5" y="14">coverage</text>
18
+ <text x="80" y="15" fill="#010101" fill-opacity=".3">93%</text>
19
+ <text x="80" y="14">93%</text>
20
+ </g>
21
+ </svg>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>URL</key>
6
+ <string>https://kig.re/2020/09/07/writing-cli-tools-ruby-migrating-github-issues-to-pivotal-tracker.html</string>
7
+ </dict>
8
+ </plist>