maxcdn 0.3.0 → 0.3.1

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: c94f389d66d158ba77d68022369bfc8c913ca04a
4
- data.tar.gz: 91ca67962bbb188f27a81dbfb7f96c96cf1b831c
3
+ metadata.gz: 435f49a5052b4eb24cd99f3982f9656a1c745651
4
+ data.tar.gz: 503f3288452d8433d32af90e85db1b16ea9cad96
5
5
  SHA512:
6
- metadata.gz: ae8140863edc58d8ac5f8d4af47d5af918d8e1f75f7b392e40cec9d5330a0252605b2dc1586d0eb7cf7bb9f63a73c8351493412d3b9b4894ca73e2329e4e14c5
7
- data.tar.gz: ce93ce746a2bc04633a5d14b5f4bb77115959c190146ebe1fef0bded5df2b5c8c93b886130bbd275de3717e4b47f79a01348db64955c91b023402d72e7389aa6
6
+ metadata.gz: 2cb4aafb9353dfb3ae1ae0cbe758f791fe41b36a3f6c2bf88dd42861925b81ef1535f72cc256e6de4d5019e9b34f571b677fb6390cec12d75d85c5430d551a52
7
+ data.tar.gz: cfd2cba6b02a961c92cc4e224b8379350b02c285ab2f50f70a23e930ef752382e39d99e5ffde41466ceb05c64cf0d4f9c4b0c96f53d043bf3fe4f91b9e68a4d8
data/.gitignore CHANGED
@@ -18,3 +18,7 @@ pkg
18
18
  *.lock
19
19
  .DS_Store
20
20
  npm-debug.log
21
+
22
+ # other
23
+ *.env
24
+ .vendor/
@@ -1,5 +1,10 @@
1
+ Running on Ruby version:
2
+
3
+ ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
4
+
5
+
1
6
  Running benchmarks as follows in order:
2
-
7
+
3
8
  maxcdn.get('zones/pull.json')
4
9
  maxcdn.get('reports/popularfiles.json')
5
10
  maxcdn.get('v3/reporting/logs.json')
@@ -9,14 +14,15 @@ Running benchmarks as follows in order:
9
14
  maxcdn.purge('ZONEID')
10
15
  maxcdn.purge('ZONEID', 'FILE')
11
16
  maxcdn.purge('ZONEID', [ 'FILE1','FILE2' ])
12
-
17
+
13
18
  user system total real
14
- get : 0.010000 0.000000 0.010000 ( 1.356269)
15
- get : 0.010000 0.000000 0.010000 ( 0.911275)
16
- get : 0.010000 0.000000 0.010000 ( 1.069133)
17
- post : 0.000000 0.000000 0.000000 ( 6.513997)
18
- put : 0.010000 0.000000 0.010000 ( 0.831379)
19
- delete: 0.010000 0.000000 0.010000 ( 1.248739)
20
- purge : 0.010000 0.000000 0.010000 ( 4.019390)
21
- purge : 0.010000 0.000000 0.010000 ( 6.221071)
22
- purge : 0.010000 0.000000 0.010000 ( 2.496699)
19
+ get : 0.010000 0.000000 0.010000 ( 0.444660)
20
+ get : 0.000000 0.000000 0.000000 ( 0.180768)
21
+ get : 0.000000 0.010000 0.010000 ( 0.556110)
22
+ post : 0.010000 0.000000 0.010000 ( 3.665597)
23
+ put : 0.000000 0.000000 0.000000 ( 0.370504)
24
+ delete: 0.010000 0.000000 0.010000 ( 2.557845)
25
+ purge : 0.000000 0.000000 0.000000 ( 1.392236)
26
+ purge : 0.000000 0.000000 0.000000 ( 1.386664)
27
+ purge : 0.000000 0.000000 0.000000 ( 2.841199)
28
+
data/Gemfile CHANGED
@@ -9,4 +9,3 @@ group :development, :test do
9
9
  gem "minitest-reporters"
10
10
  gem "webmock"
11
11
  end
12
-
@@ -1,10 +1,10 @@
1
- class Hash
2
- RESERVED_CHARACTERS = /[^a-zA-Z0-9\-\.\_\~]/
1
+ require 'addressable'
3
2
 
3
+ class Hash
4
4
  def _escape(value)
5
- URI::escape(value.to_s, RESERVED_CHARACTERS)
5
+ Addressable::URI.encode(Addressable::URI.parse(value.to_s))
6
6
  rescue ArgumentError
7
- URI::escape(value.to_s.force_encoding(Encoding::UTF_8), RESERVED_CHARACTERS)
7
+ Addressable::URI.encode(Addressable::URI.parse(value.to_s.force_encoding(Encoding::UTF_8)))
8
8
  end
9
9
 
10
10
  def to_params
@@ -1,3 +1,3 @@
1
1
  module MaxCDN
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -16,4 +16,5 @@ Gem::Specification.new do |gem|
16
16
  gem.add_dependency 'signet', '~> 0.7'
17
17
  gem.add_dependency 'faraday', '~> 0.9'
18
18
  gem.add_dependency 'net-http-persistent', '~> 2.9'
19
+ gem.add_dependency 'addressable', '~> 2.4'
19
20
  end
@@ -19,16 +19,6 @@ class Client < Minitest::Test
19
19
  assert_equal "foo[0]=bar&foo[1]=boo", { :foo => [ :bar, :boo ] }.to_params
20
20
  end
21
21
 
22
- def test_to_params_crazy
23
- assert_equal "a=1&c=%40%24%5E%24%23%25%26%23%26&%3F%21=asdf&1=FDAS&b[0]=a&b[1]=b&b[2]=c", {
24
- :a => 1,
25
- :b => [ :a, :b, :c ],
26
- :c => "@$^$#%&#&",
27
- "?!" => "asdf",
28
- 1 => "FDAS"
29
- }.to_params
30
- end
31
-
32
22
  def test_case_indifferent_delete
33
23
  original_hash = {
34
24
  # using realistic content types to test real use cases
@@ -8,6 +8,7 @@ Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
8
8
 
9
9
  require "webmock"
10
10
  include WebMock::API
11
+ WebMock.enable!
11
12
 
12
13
  host = "https://rws.maxcdn.com/alias"
13
14
 
@@ -138,9 +139,6 @@ class Client < Minitest::Test
138
139
 
139
140
  def test_purge_files
140
141
  assert_equal({"foo.txt"=>{"foo"=>"bar"}, "bar.txt"=>{"foo"=>"bar"}}, @max.purge(12345, [ "foo.txt", "bar.txt" ]))
141
- end
142
-
143
- def test_purge_files
144
142
  assert_equal({"foo.txt"=>{"foo"=>"bar"}, "bar.txt"=>{"foo"=>"bar"}}, @max.purge(12345, { :files => [ "foo.txt", "bar.txt" ]}))
145
143
  end
146
144
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maxcdn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua P. Mervine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-25 00:00:00.000000000 Z
11
+ date: 2016-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: signet
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.9'
55
+ - !ruby/object:Gem::Dependency
56
+ name: addressable
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.4'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.4'
55
69
  description: A Rest Client For MaxCDN Rest Web Services
56
70
  email: joshua@mervine.net
57
71
  executables: []