porkbun 0.4.0 → 0.5.0

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: eb0888f42796fb19dfde0c817a15c707965abc4e67a177c7a5d0c7fa1052322e
4
- data.tar.gz: 4247934278026c1d90e1ce737719a233c61763324d14f48308fc13fd4a91a897
3
+ metadata.gz: 55966f08e27676143e86c9a7e8d20e93ab18f18072484a9212d4102706532d93
4
+ data.tar.gz: c75016c446c7e25d57be8c0faaf996df401494df87ac66b614a067e202a14fb8
5
5
  SHA512:
6
- metadata.gz: 6eeeca53624c7b7bda72d190390e9977461d1680a7446642ec7ce111bc591d753ba5db83ef4716d59f90470159052955db6eeb610120da2cc212c1cf005ffe4c
7
- data.tar.gz: b9b4fc53993bc4b3138d0cc43af698d118fbca85ab722be03971d77763832241a0a22ce2baa3ddfebb6aeb1aeab0da217a78c32af3b9a911ac9d49016dcac8d1
6
+ metadata.gz: 0a600d3705630e2062507e211dd6c3f000994463e60bdab46592aa6761d74d9704b1b3ca188fa5a76150948b36016442c3dda17189f9d2eb76781ca7b4b80556
7
+ data.tar.gz: f299259861ccb74e64f1d05d0eb8eecc9c22e9918ca7b243560604663e55ff06986cea57afc34d78530361b6cb73eabe3fac6e483e78b483db751b184a2a9d7a
data/Gemfile CHANGED
@@ -1,16 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source "https://rubygems.org"
3
+ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in porkbun.gemspec
6
6
  gemspec
7
7
 
8
- gem "rake", "~> 13.0", :group => :test
8
+ group :development do
9
+ # gem "rake", "~> 13.0", :group => :test
10
+ gem 'pry', '~> 0.14.2', group: :test
11
+ gem 'rspec', '~> 3.12', group: :test
12
+ gem 'webmock', '~> 3.19', group: :test
13
+ end
9
14
 
10
- gem "rspec", "~> 3.12", :group => :test
11
-
12
- gem "webmock", "~> 3.19", :group => :test
13
-
14
- gem "pry", "~> 0.14.2", :group => :test
15
-
16
- gem "thor", "~> 1.2"
15
+ gem 'thor', '~> 1.2'
data/bin/porkbun CHANGED
@@ -53,6 +53,19 @@ class CLI < Thor
53
53
  end
54
54
  end
55
55
 
56
+ desc 'create', 'Create a new record'
57
+ option :type, required: true, desc: 'The record type: A, AAAA, CNAME, MX, TXT, SRV, NS, SOA'
58
+ option :domain, required: true, desc: 'The domain name: google.com'
59
+ option :name, required: true, desc: 'The hostname: www'
60
+ option :content, required: true, desc: 'The content: hostname, or IP address'
61
+ option :ttl, default: 600, type: :numeric, desc: 'The TTL in seconds'
62
+ option :prio, default: 0, type: :numeric, desc: 'The priority for MX records'
63
+ def create
64
+ record = Porkbun::DNS.create(options)
65
+ puts record
66
+ puts record.message
67
+ end
68
+
56
69
  desc 'dyndns <hostname.domain> [<ip>]', 'Update a dynamic dns record. example: porkbun dyndns home.example.com'
57
70
  long_desc 'If no IP is provided, the current public IP is used.'
58
71
  def dyndns(hostname, ip = nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Porkbun
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
data/lib/porkbun.rb CHANGED
@@ -7,6 +7,7 @@ module Porkbun
7
7
  class Error < StandardError; end
8
8
 
9
9
  def self.porkbun(path, options = {})
10
+ pp options
10
11
  if ENV.fetch('PORKBUN_API_KEY', nil).nil? || ENV.fetch('PORKBUN_SECRET_API_KEY', nil).nil?
11
12
  abort 'PORKBUN_API_KEY and PORKBUN_SECRET_API_KEY must be set'
12
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: porkbun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bretoi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-29 00:00:00.000000000 Z
11
+ date: 2024-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http