ipecache 0.0.10 → 0.0.11

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.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZTdkNDBiMDBhNWNiMGUxYThkMmUxZmZlOTZlYTM1NTdlZWI2MTI0Yg==
5
- data.tar.gz: !binary |-
6
- NzdjZjA2MjY3ZDM0ZmY0Mjk0ZmZlMmRmODNkOWI2YTVhM2ZjYWZmOQ==
2
+ SHA1:
3
+ metadata.gz: f5ad45c0cf7996f6d4de2efaaa587963a8a663ab
4
+ data.tar.gz: 3146198d7fcc41a23e46be2a1c3b2dd82ab0d7dd
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ODI5YWYxMzY3OTAyMmFkY2Q3NTgzN2E5OThiZTFjMGIzYmUwZDVkNWIzZTJk
10
- N2EzMDMwNjgxOWRlNGY5ZjIyODJlMzJiZDBhNDU1OWZkOWQ2NzRhOWMxY2Fm
11
- Njg5NzAwNjgwNzhkYjQxZmQ2YTM1NGZiOTMxYWQzY2UyNjJkN2U=
12
- data.tar.gz: !binary |-
13
- ZTRlODk2ZmU0ZTNlMmQxZmY1YTg0MTAxNGU4ZGNjMjA0MTIxNjk4MzBjOGMw
14
- ZGY0NGNjOTU3OTJjZDcyMzU1Mjc0ZmFiN2MyZmE5YTU1ZmViYWNjMmJiMDgw
15
- MzA0YzU2ZTkyMWMzY2U3MDdhZjRkYWU0MGI0Nzg4MDA4MTEwMzQ=
6
+ metadata.gz: 60944d51c94150df073c004321b7f9ad8334b5a93dd6e5bc472c053b5ba1f9b13165b8c224e1167d013b882974d464759c5159c4ed006e3a830a054e816fb86b
7
+ data.tar.gz: e4f212f99206a89b183401a4db4b99ef3b3bd646f84c85ee9a21584e76ed01651079b4a69eaac86ca562d6dd89c51bf330270ffcf2a97cd436780e08a6e27b2c
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  *.gem
2
2
  .idea/
3
+ .bundle
@@ -1,3 +1,10 @@
1
+ ## 0.0.11 (September 3rd, 2015)
2
+
3
+ Bugfixes:
4
+
5
+ - Added MaxCDN support (Thanks to @jmervine https://github.com/jonlives/ipecache/pull/13)
6
+
7
+
1
8
  ## 0.0.10 (January 8th, 2015)
2
9
 
3
10
  Bugfixes:
@@ -1,26 +1,56 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ipecache (0.0.6)
4
+ ipecache (0.0.11)
5
5
  app_conf (>= 0.4.0)
6
+ aws-sdk-v1 (>= 1.0)
6
7
  choice (>= 0.1.6)
7
8
  faraday_middleware (>= 0.9.0)
9
+ maxcdn (>= 0.2.1)
8
10
  public_suffix (>= 1.4.2)
9
11
 
10
12
  GEM
11
13
  remote: https://rubygems.org/
12
14
  specs:
15
+ addressable (2.3.8)
13
16
  app_conf (0.4.2)
14
- choice (0.1.6)
15
- faraday (0.9.0)
17
+ aws-sdk-v1 (1.65.0)
18
+ json (~> 1.4)
19
+ nokogiri (>= 1.4.4)
20
+ choice (0.2.0)
21
+ curb (0.8.8)
22
+ curb-fu (0.6.2)
23
+ curb (>= 0.5.4.0)
24
+ rack-test (>= 0.2.0)
25
+ faraday (0.9.1)
16
26
  multipart-post (>= 1.2, < 3)
17
- faraday_middleware (0.9.1)
27
+ faraday_middleware (0.10.0)
18
28
  faraday (>= 0.7.4, < 0.10)
29
+ json (1.8.3)
30
+ jwt (1.5.1)
31
+ maxcdn (0.2.1)
32
+ curb-fu (~> 0.6.2)
33
+ signet (~> 0.5.1)
34
+ mini_portile (0.6.2)
35
+ multi_json (1.11.2)
19
36
  multipart-post (2.0.0)
20
- public_suffix (1.4.2)
37
+ nokogiri (1.6.6.2)
38
+ mini_portile (~> 0.6.0)
39
+ public_suffix (1.5.1)
40
+ rack (1.6.4)
41
+ rack-test (0.6.3)
42
+ rack (>= 1.0)
43
+ signet (0.5.1)
44
+ addressable (>= 2.2.3)
45
+ faraday (>= 0.9.0.rc5)
46
+ jwt (>= 0.1.5)
47
+ multi_json (>= 1.0.0)
21
48
 
22
49
  PLATFORMS
23
50
  ruby
24
51
 
25
52
  DEPENDENCIES
26
53
  ipecache!
54
+
55
+ BUNDLED WITH
56
+ 1.10.6
data/README.md CHANGED
@@ -42,6 +42,11 @@ plugins:
42
42
  edgecast:
43
43
  account_id: 1A2B
44
44
  api_key: abc123
45
+ maxcdn:
46
+ alias: myalias
47
+ token: 1A2B
48
+ secret: abc123
49
+ zone: 1234
45
50
  akamai:
46
51
  username: myusername
47
52
  password: mypassword
@@ -49,7 +54,7 @@ plugins:
49
54
  login: foo@bar.com
50
55
  api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
51
56
  local:
52
- hosts:
57
+ hosts:
53
58
  - cache1.mydomain.com
54
59
  - cache2.mydomain.com
55
60
  use_ssh: false
@@ -2,7 +2,7 @@ $:.push File.expand_path('../lib', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'ipecache'
5
- gem.version = '0.0.10'
5
+ gem.version = '0.0.11'
6
6
  gem.authors = ["Jon Cowie"]
7
7
  gem.email = 'jonlives@gmail.com'
8
8
  gem.homepage = 'https://github.com/jonlives/ipecache'
@@ -20,4 +20,5 @@ Gem::Specification.new do |gem|
20
20
  gem.add_runtime_dependency 'faraday_middleware', '>= 0.9.0'
21
21
  gem.add_runtime_dependency 'public_suffix', '>= 1.4.2'
22
22
  gem.add_runtime_dependency 'aws-sdk-v1', '>= 1.0'
23
+ gem.add_runtime_dependency 'maxcdn', '>= 0.2.1'
23
24
  end
@@ -28,11 +28,6 @@ module Ipecache
28
28
  http = Net::HTTP.new(uri.host, uri.port)
29
29
  http.use_ssl = true
30
30
 
31
- # Fix for https://github.com/jonlives/ipecache/issues/10
32
- # We're using SSL v3 here to disable SNI,
33
- # which causes Fastly's API to return a 400
34
- # as the hostname is changed to the URL being purged after
35
- # SSL handshake.
36
31
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
37
32
 
38
33
  request = Net::HTTP::Post.new(uri.request_uri)
@@ -0,0 +1,53 @@
1
+ require 'ipecache/plugins/plugin'
2
+
3
+ module Ipecache
4
+ module Plugins
5
+ class MaxCDN < Plugin
6
+ name :maxcdn
7
+ hooks :cdn_purge
8
+
9
+ def perform
10
+ safe_require 'maxcdn'
11
+
12
+ [ :alias, :token, :secret, :zone ].each do |key|
13
+ confirm!(key)
14
+ end
15
+
16
+ zone = config.zone.to_i
17
+
18
+ plugin_puts "Beginning URL Purge from MaxCDN..."
19
+
20
+ api = ::MaxCDN::Client.new(config.alias, config.token, config.secret)
21
+
22
+ urls.each do |u|
23
+ url = u.chomp
24
+ plugin_puts ("Purging #{url}")
25
+
26
+ begin
27
+ response = api.purge(zone, url)
28
+
29
+ if response["code"] != 200
30
+ plugin_puts_error(url, "Response Code: #{response["code"]}")
31
+ plugin_puts_error(url, response.to_s)
32
+ exit 1 unless continue_on_error
33
+ else
34
+ plugin_puts "Purge successful!"
35
+ end
36
+ rescue MaxCDN::APIException => e
37
+ plugin_puts_error(url, "Response: #{e}")
38
+ exit 1 unless continue_on_error
39
+ end
40
+ end
41
+ end
42
+
43
+ private
44
+ def confirm! key
45
+ if config.send(key).nil?
46
+ plugin_puts("MaxCDN #{key} not specified, Exiting...")
47
+ exit 1
48
+ end
49
+ end
50
+
51
+ end
52
+ end
53
+ end
metadata CHANGED
@@ -1,85 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipecache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Cowie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-08 00:00:00.000000000 Z
11
+ date: 2015-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: app_conf
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: choice
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.1.6
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.1.6
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: faraday_middleware
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 0.9.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.9.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: public_suffix
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.4.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.4.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: aws-sdk-v1
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: maxcdn
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 0.2.1
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 0.2.1
83
97
  description: An extensible tool for purging urls from caches and CDNs
84
98
  email: jonlives@gmail.com
85
99
  executables:
@@ -87,7 +101,7 @@ executables:
87
101
  extensions: []
88
102
  extra_rdoc_files: []
89
103
  files:
90
- - .gitignore
104
+ - ".gitignore"
91
105
  - CHANGELOG.md
92
106
  - Gemfile
93
107
  - Gemfile.lock
@@ -105,6 +119,7 @@ files:
105
119
  - lib/ipecache/plugins/edgecast.rb
106
120
  - lib/ipecache/plugins/fastly.rb
107
121
  - lib/ipecache/plugins/local.rb
122
+ - lib/ipecache/plugins/maxcdn.rb
108
123
  - lib/ipecache/plugins/plugin.rb
109
124
  - lib/ipecache/plugins/swisstxt_cdn.rb
110
125
  - lib/ipecache/runner.rb
@@ -126,12 +141,12 @@ require_paths:
126
141
  - lib
127
142
  required_ruby_version: !ruby/object:Gem::Requirement
128
143
  requirements:
129
- - - ! '>='
144
+ - - ">="
130
145
  - !ruby/object:Gem::Version
131
146
  version: '0'
132
147
  required_rubygems_version: !ruby/object:Gem::Requirement
133
148
  requirements:
134
- - - ! '>='
149
+ - - ">="
135
150
  - !ruby/object:Gem::Version
136
151
  version: '0'
137
152
  requirements: []
@@ -141,3 +156,4 @@ signing_key:
141
156
  specification_version: 4
142
157
  summary: An extensible tool for purging urls from caches and CDNs
143
158
  test_files: []
159
+ has_rdoc: