dnsmadeeasy 0.4.0 → 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 +5 -10
  3. data/.gitignore +2 -0
  4. data/.rubocop.yml +5 -4
  5. data/.rubocop_todo.yml +251 -143
  6. data/CLAUDE.md +67 -0
  7. data/Gemfile +9 -1
  8. data/README.md +858 -0
  9. data/Rakefile +4 -4
  10. data/dnsmadeeasy.gemspec +42 -26
  11. data/docs/badges/coverage_badge.svg +21 -0
  12. data/docs/dry-cli-based-tools.webloc +8 -0
  13. data/docs/plan-zone-management.md +756 -0
  14. data/docs/plans/01-plan-ruby4-baseline.md +38 -0
  15. data/docs/plans/02-plan-dry-cli-launcher.md +44 -0
  16. data/docs/plans/03-plan-account-command.md +43 -0
  17. data/docs/plans/04-plan-zone-record-model.md +48 -0
  18. data/docs/plans/05-plan-zone-parser.md +41 -0
  19. data/docs/plans/06-plan-zone-formatter.md +43 -0
  20. data/docs/plans/07-plan-zone-export.md +58 -0
  21. data/docs/plans/08-plan-zone-diff.md +42 -0
  22. data/docs/plans/09-plan-zone-apply.md +69 -0
  23. data/docs/plans/10-plan-docs-cleanup.md +55 -0
  24. data/docs/spec-zone-management.md +242 -0
  25. data/exe/dme +13 -2
  26. data/exe/dmez +6 -0
  27. data/lib/dme.rb +7 -2
  28. data/lib/dnsmadeeasy/api/client.rb +32 -26
  29. data/lib/dnsmadeeasy/cli/box_output.rb +9 -0
  30. data/lib/dnsmadeeasy/cli/commands/account.rb +222 -0
  31. data/lib/dnsmadeeasy/cli/commands/base.rb +119 -0
  32. data/lib/dnsmadeeasy/cli/commands/legacy_operation.rb +30 -0
  33. data/lib/dnsmadeeasy/cli/commands/version.rb +22 -0
  34. data/lib/dnsmadeeasy/cli/commands/zone.rb +326 -0
  35. data/lib/dnsmadeeasy/cli/commands.rb +19 -0
  36. data/lib/dnsmadeeasy/cli/input.rb +14 -0
  37. data/lib/dnsmadeeasy/cli/launcher.rb +53 -0
  38. data/lib/dnsmadeeasy/cli/message_helpers.rb +81 -0
  39. data/lib/dnsmadeeasy/cli/reported_error.rb +10 -0
  40. data/lib/dnsmadeeasy/credentials/api_keys.rb +11 -9
  41. data/lib/dnsmadeeasy/credentials.rb +0 -1
  42. data/lib/dnsmadeeasy/runner.rb +24 -24
  43. data/lib/dnsmadeeasy/types.rb +19 -0
  44. data/lib/dnsmadeeasy/version.rb +2 -1
  45. data/lib/dnsmadeeasy/zone/aname_flattener.rb +63 -0
  46. data/lib/dnsmadeeasy/zone/apply_executor.rb +189 -0
  47. data/lib/dnsmadeeasy/zone/apply_result.rb +22 -0
  48. data/lib/dnsmadeeasy/zone/diff.rb +152 -0
  49. data/lib/dnsmadeeasy/zone/file.rb +26 -0
  50. data/lib/dnsmadeeasy/zone/parser.rb +172 -0
  51. data/lib/dnsmadeeasy/zone/plan.rb +28 -0
  52. data/lib/dnsmadeeasy/zone/plan_action.rb +29 -0
  53. data/lib/dnsmadeeasy/zone/plan_renderer.rb +91 -0
  54. data/lib/dnsmadeeasy/zone/provider_record.rb +18 -0
  55. data/lib/dnsmadeeasy/zone/record.rb +44 -0
  56. data/lib/dnsmadeeasy/zone/record_set.rb +23 -0
  57. data/lib/dnsmadeeasy/zone/remote_adapter.rb +94 -0
  58. data/lib/dnsmadeeasy/zone/remote_records.rb +26 -0
  59. data/lib/dnsmadeeasy/zone/serializer.rb +115 -0
  60. data/lib/dnsmadeeasy.rb +61 -27
  61. metadata +184 -25
  62. data/.dme-help.png +0 -0
  63. data/README.adoc +0 -690
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
@@ -8,48 +8,56 @@ require 'dnsmadeeasy/version'
8
8
 
9
9
  # rubocop:todo Naming/HeredocDelimiterCase
10
10
  DnsMadeEasy::DESCRIPTION = <<~eof
11
- 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".
12
13
 
13
- This library offers both a rich Ruby API that you can use to automate DNS record management, as well
14
- as a rich CLI interface with the command line executable "dme" installed when you install the gem.
15
- The gem additionally supports storing credentials in the ~/.dnsmadeeasy/credentials.yml
16
- 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.
17
21
 
18
- If you are using Chef consider using the "dnsmadeeasy" Chef Cookbook, while uses this gem behind
19
- 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
20
25
 
21
- ACKNOWLEDGEMENTS:
26
+ ACKNOWLEDGEMENTS:
22
27
 
23
- 1. This gem is based on the original work contributed by Wanelo.com to the
24
- 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.
25
30
 
26
- 2. We also wish to thank the gem author Phil Cohen who
27
- 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.
28
33
 
29
- 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.
30
36
  eof
31
37
 
32
38
  Gem::Specification.new do |spec|
33
39
  spec.name = 'dnsmadeeasy'
34
40
  spec.version = DnsMadeEasy::VERSION
35
- spec.authors = ['Konstantin Gredeskoul', 'Arnoud Vermeer', 'Paul Henry', 'James Hart', 'Phil Cohen', 'Praneeth Are']
36
- 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]
37
44
  spec.summary = DnsMadeEasy::DESCRIPTION
38
45
  spec.description = DnsMadeEasy::DESCRIPTION
39
46
  spec.post_install_message = <<~EOF
40
- Thank you for using the DnsMadeEasy ruby gem, the Ruby client
41
- API for DnsMadeEasy.com's SDK v2. Please note that this gem
42
- comes with a rich command line utility 'dme' which you can use
43
- instead of the ruby API if you prefer. Run `dme` with no
44
- arguments to see the help message.
45
-
46
- You can also store (multi-account) credentials in a YAML file in
47
- your home directory. For more information, please see README at:
48
- 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
49
56
  EOF
50
57
 
51
58
  spec.homepage = 'https://github.com/kigster/dnsmadeeasy'
52
59
  spec.license = 'MIT'
60
+ spec.required_ruby_version = '~> 4.0'
53
61
 
54
62
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
55
63
  f.match(%r{^(test|spec|features)/})
@@ -61,10 +69,17 @@ Gem::Specification.new do |spec|
61
69
 
62
70
  spec.add_dependency 'awesome_print'
63
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'
64
77
  spec.add_dependency 'hashie'
65
78
  spec.add_dependency 'sym'
79
+ spec.add_dependency 'tsort'
80
+ spec.add_dependency 'tty-box'
81
+ spec.add_dependency 'tty-spinner'
66
82
 
67
- spec.add_development_dependency 'bundler'
68
83
  spec.add_development_dependency 'rake'
69
84
  spec.add_development_dependency 'relaxed-rubocop'
70
85
  spec.add_development_dependency 'rspec'
@@ -74,5 +89,6 @@ Gem::Specification.new do |spec|
74
89
  spec.add_development_dependency 'webmock'
75
90
  spec.add_development_dependency 'yard'
76
91
 
77
- # spec.add_development_dependency 'aruba'
92
+ spec.add_development_dependency 'aruba'
93
+ spec.metadata['rubygems_mfa_required'] = 'true'
78
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>