dnsdeploy 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: 436c4fe88d39f8f420272553dee3f69e7d1864b2
4
- data.tar.gz: 3acf085a2e88226dd0b9d95df1dd627348deb6fd
3
+ metadata.gz: 4c9d6cfa6925af281c9d41a6becc2518aa531aa0
4
+ data.tar.gz: 5680902a6b4c3d9f5e16df8eec07a4fd447ca7bf
5
5
  SHA512:
6
- metadata.gz: a58056300b6c3f37bb94a9a7c25b3391fd3dc91de0a57c13ce63d99095380f2d14e83d59d445658e57a0ef29b7223f1c472436288106764c9e00be5a115d9184
7
- data.tar.gz: 36e3c7f223fedbaa7ac13dad82a110eae51d0ce73f73d223eb95c6d9bd6c22cac3941ebf0bcbdeaa2ba434562227a854a3e8993c9c5997a7cd7e6a7fb5c3b4ab
6
+ metadata.gz: 84462a70458d3d0a067ce5ddb984eec9cb8e6ea98f5585ce17771b2371114219bc22305d5c0724c8aba82adc74b7eeee239e68379ecc67478a886aff96061350
7
+ data.tar.gz: e1852dfcd43b1587fbe75f3f7daed1f72b0fef0988ba6abaef8206b1c2893556e7b327b2339507dd84b14b11421ba50c114de972896a0501d4e442df7f8d9413
data/History.md ADDED
@@ -0,0 +1,10 @@
1
+
2
+ 0.0.2 / 2014-09-07
3
+ ==================
4
+
5
+ * load JSON only once
6
+
7
+ 0.0.1 / 2014-09-06
8
+ ==================
9
+
10
+ * initial version
@@ -1,18 +1,19 @@
1
1
  module Dnsdeploy
2
2
  class Base
3
- def initialize(records_file)
4
- @records_file = File.new(records_file)
3
+ def initialize(records_file_path)
4
+ @records_file_path = records_file_path
5
+ @local_records_json = File.new(records_file_path).read
5
6
  end
6
7
 
7
- def self.update_records(records_file)
8
- self.new(records_file).update_records
8
+ def self.update_records(records_file_path)
9
+ self.new(records_file_path).update_records
9
10
  end
10
11
 
11
12
  def validate
12
- JSON.load(@records_file.read)
13
- puts "#{@records_file.path} is valid json".green
13
+ JSON.load(@local_records_json)
14
+ puts "#{@records_file_path} is valid json".green
14
15
  rescue => e
15
- puts "unable to parse #{@records_file.path}".red
16
+ puts "unable to parse #{@records_file_path}".red
16
17
  end
17
18
 
18
19
  def update_records
@@ -39,7 +40,7 @@ module Dnsdeploy
39
40
  end
40
41
 
41
42
  def local
42
- @local ||= Dnsdeploy::Local.new(@records_file)
43
+ @local ||= Dnsdeploy::Local.new(@local_records_json)
43
44
  end
44
45
  end
45
46
  end
@@ -2,8 +2,8 @@ require 'singleton'
2
2
 
3
3
  module Dnsdeploy
4
4
  class Local
5
- def initialize(records_file_path)
6
- @records_file_path = records_file_path
5
+ def initialize(local_records_json)
6
+ @local_records_json = local_records_json
7
7
  end
8
8
 
9
9
  def all_records
@@ -31,7 +31,7 @@ module Dnsdeploy
31
31
  end
32
32
 
33
33
  def json
34
- @json ||= JSON.load(@records_file_path.read)
34
+ @json ||= JSON.load(@local_records_json)
35
35
  end
36
36
 
37
37
  def dnsimple_domain(zone)
@@ -1,3 +1,3 @@
1
1
  module Dnsdeploy
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dnsdeploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - beanieboi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-06 00:00:00.000000000 Z
11
+ date: 2014-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dnsimple-ruby
@@ -91,6 +91,7 @@ files:
91
91
  - ".gitignore"
92
92
  - ".rspec"
93
93
  - Gemfile
94
+ - History.md
94
95
  - LICENSE.txt
95
96
  - README.md
96
97
  - Rakefile