vzcdn 0.2.1 → 0.2.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: 02c4b114ae9aa0f8eb6b7a62d71ad699ce670de7
4
- data.tar.gz: 43df82ae708930fc0f98995b066339aa9ff7866a
3
+ metadata.gz: 7308b4c03e37ceb4e8929e429f5ea3cdf4b5a879
4
+ data.tar.gz: 76b3478d0d082d625bbd17e43aa0c86dfda8ee18
5
5
  SHA512:
6
- metadata.gz: fca53d416484d65fd293e8d2dd894cc255b8604022da1b1b83cd2c9294f6bc81dd1f85093bcefb19d20a5a9c26a0d31751d27d92647f852ddfb5d04f274ce155
7
- data.tar.gz: cbd0784e1a74d2240dc41d4fc7e5fef3c39cb68e86c3c9e2fdd0a2512a7b7a655d2589167f0fc4b500d92133108de948cbc13847e40d0857c82cd7bb5ee694d9
6
+ metadata.gz: 6b241986733b7fd7b4be2823a01269aaae95a6e161714783ceb8349ac084a8284dd1b0a0861739e4e3e61afa7278a88d3da230bcecca79df8d9122fb87ec1e3c
7
+ data.tar.gz: 097f7f170f2a0bb6a41d6c838058c69c72522db5cd560ab42d1ee22a39c0a26f969653c250881db92901443d746f1aa0798b6285f66947ad149fc4232ce03cc9
data/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  Commandline UI for Edgecast API
4
4
 
5
5
  ##RELEASE NOTES
6
+ 2014/05/15 0.2.2
7
+ * Bug fix: pull command would fail if zones directory does not exists.
6
8
 
7
9
  2014/05/12 0.2.1
8
10
  * CSV format support (ec zone <zname> print -t csv)
@@ -1,3 +1,3 @@
1
1
  module Vzcdn
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -215,7 +215,7 @@ class Zone < Command
215
215
  r = '.*\.(' + id + ')'
216
216
  end
217
217
  regex = Regexp.new(r)
218
- Dir.new(user_file(ZONEDIR)).each { |file|
218
+ Dir.new(user_file(ZONEDIR, '.')).each { |file|
219
219
  if (m = file.full_match(regex))
220
220
  @zone_file = user_file(ZONEDIR, file)
221
221
  @zone_id = m[1]
@@ -6,10 +6,12 @@ require 'tempfile'
6
6
 
7
7
  bin_dir = File.expand_path '../bin'
8
8
  lib_dir = File.expand_path '../lib'
9
+ test_dir = File.expand_path '.'
9
10
  $ruby_command = "ruby -I" + lib_dir + " " + bin_dir + "/ec "
11
+ $debug = 0
10
12
 
11
- test_directory = Dir.mktmpdir "steve"
12
- Dir.chdir test_directory
13
+ # test_directory = Dir.mktmpdir "steve"
14
+ # Dir.chdir test_directory
13
15
 
14
16
  class TestClui < MiniTest::Unit::TestCase
15
17
  @@config_init = false
@@ -28,7 +30,7 @@ class TestClui < MiniTest::Unit::TestCase
28
30
  `ec config set proxy #{proxy}`
29
31
  end
30
32
  assert(File.directory?(@@config_dir), "missing " + @@config_dir + " directory")
31
- assert(File.exists?(File.join(@@config_dir, "config")), "missing config file")
33
+ assert(File.exist?(File.join(@@config_dir, "config")), "missing config file")
32
34
  assert_equal("BED3", `ec config get acct-num`.chomp, "get account-num failed")
33
35
  @@route = Route.do
34
36
  end
@@ -51,6 +53,7 @@ class TestClui < MiniTest::Unit::TestCase
51
53
  end
52
54
 
53
55
  def call_ec_io(rest)
56
+ success = nil
54
57
  out, err = capture_subprocess_io do
55
58
  success = call_ec(rest)
56
59
  end
@@ -58,9 +61,14 @@ class TestClui < MiniTest::Unit::TestCase
58
61
  end
59
62
 
60
63
  def assert_ec_output(rest, expected_out)
61
- out, err, rc = call_ec_io(rest)
64
+ out, err, success = call_ec_io(rest)
62
65
  assert success, "'" + rest + "' failed"
63
- assert_equal expected_out, out.chomp, "'" + rest + "' failed"
66
+ if (expected_out.class == Regexp)
67
+ assert_match expected_out, out.chomp, "'" + rest + "' failed"
68
+ else
69
+ assert_equal expected_out, out.chomp, "'" + rest + "' failed"
70
+ end
71
+
64
72
  assert_equal '', err.chomp, "'" + rest + "' printed to stderr:" + err
65
73
  end
66
74
 
@@ -85,7 +93,7 @@ class TestClui < MiniTest::Unit::TestCase
85
93
  zone = @@zones.sample
86
94
  id = zone["ZoneId"].to_s
87
95
  assert call_ec("zone #{id} pull"), "unable to pull zone #{id}"
88
- assert File.exists?(zone_file zone), "file #{zone_file zone} not created"
96
+ assert File.exist?(zone_file zone), "file #{zone_file zone} not created"
89
97
  File.delete(zone_file zone)
90
98
  end
91
99
 
@@ -94,12 +102,20 @@ class TestClui < MiniTest::Unit::TestCase
94
102
  zone = @@zones.sample
95
103
  name = zone["DomainName"]
96
104
  assert call_ec("zone #{name} pull"), "unable to pull zone #{name}"
97
- assert File.exists?(zone_file zone), "file #{zone_file zone} not created"
105
+ assert File.exist?(zone_file zone), "file #{zone_file zone} not created"
98
106
  File.delete(zone_file zone)
99
107
  end
108
+
109
+ def test_print_zone
110
+ get_zones
111
+ zone = @@zones.sample
112
+ name = zone["DomainName"]
113
+ assert_ec_output("zone #{name} pull", /saved locally/)
114
+ end
115
+
100
116
  end
101
117
 
102
118
  rc = (Test::Unit::Runner.new.run(ARGV) || true)
103
- FileUtils.remove_entry test_directory
119
+ # FileUtils.remove_entry test_directory
104
120
 
105
121
  exit rc
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vzcdn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Preston
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-05-12 00:00:00.000000000 Z
13
+ date: 2014-05-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client