net-purgedomain 1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a1097c54b9901ab8b063b79b1a059c16af5b7234
4
+ data.tar.gz: b429df3ded23c893ea7e0bd95e55c461e29c5b89
5
+ SHA512:
6
+ metadata.gz: cfe2cf347f077f112a914515ca1a096211228d3bdb41dcfc1c2c351102b1b33128ce0b9963b4700a3d72c3eb926e6cbd296f446c387711d044642c415abadb2e
7
+ data.tar.gz: 3111ea4f2dbb83adbfe89ea768455e29f155ce283b7a8e36166a34267bf8f53980f44b36c7492c3131d596aa4a46156e3ceca0f62c6257d69494990e92b6feaa
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2015 Dan Benjamin
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,34 @@
1
+ # net-purgedomain
2
+
3
+ Adds PURGEDOMAIN to Net::HTTP for domain-level cache purging requests in Varnish.
4
+
5
+ Installation:
6
+
7
+ ```
8
+ gem 'net-purgedomain', '~> 1.0'
9
+ ```
10
+
11
+ ## Example Use
12
+
13
+ ```
14
+ require 'net-purge'
15
+
16
+ Net::HTTP.start('cacheserver.com') { |http|
17
+ # You can specify any path you want, it's ignored
18
+ request = Net::HTTP::PurgeDomain.new('/')
19
+ response = http.request(request)
20
+ puts response.body # Guru Meditation
21
+ }
22
+ ```
23
+
24
+ If you'd like to specify a specific domain to purge that's different from your caching server:
25
+
26
+ ```
27
+ Net::HTTP.start('cacheserver.com') do |http|
28
+ # You can specify any path you want, it's ignored
29
+ request = Net::HTTP::PurgeDomain.new('/')
30
+ request.initialize_http_header({ "Host" => "domain.to.purge.com" })
31
+ response = http.request(request)
32
+ puts response.body # Guru Meditation
33
+ end
34
+ ```
@@ -0,0 +1,32 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'net-domainpurge'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+ Bundler::GemHelper.install_tasks
21
+
22
+ require 'rake/testtask'
23
+
24
+ Rake::TestTask.new(:test) do |t|
25
+ t.libs << 'lib'
26
+ t.libs << 'test'
27
+ t.pattern = 'test/**/*_test.rb'
28
+ t.verbose = false
29
+ end
30
+
31
+
32
+ task default: :test
@@ -0,0 +1,7 @@
1
+ require 'net/http'
2
+
3
+ class Net::HTTP::PurgeDomain < Net::HTTP::Get
4
+ METHOD = 'PURGEDOMAIN'
5
+ REQUEST_HAS_BODY = false
6
+ RESPONSE_HAS_BODY = true
7
+ end
@@ -0,0 +1,14 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "net-purgedomain"
5
+ s.version = "1.0"
6
+ s.authors = ["Dan Benjamin"]
7
+ s.email = "dan@hivelogic.com"
8
+ s.homepage = "https://github.com/dan/net-purgedomain"
9
+ s.summary = "Adds PURGEDOMAIN to Net::HTTP for domain-level cache purging requests in Varnish."
10
+ s.description = "Adds PURGEDOMAIN to Net::HTTP for domain-level cache purging requests."
11
+ s.license = 'MIT'
12
+ s.require_paths = ['lib']
13
+ s.files = Dir["{lib}/net-purgedomain.rb", "net-purgedomain.gemspec", "LICENSE", "Rakefile", "README.md"]
14
+ end
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: net-purgedomain
3
+ version: !ruby/object:Gem::Version
4
+ version: '1.0'
5
+ platform: ruby
6
+ authors:
7
+ - Dan Benjamin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-19 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Adds PURGEDOMAIN to Net::HTTP for domain-level cache purging requests.
14
+ email: dan@hivelogic.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - LICENSE
20
+ - README.md
21
+ - Rakefile
22
+ - lib/net-purgedomain.rb
23
+ - net-purgedomain.gemspec
24
+ homepage: https://github.com/dan/net-purgedomain
25
+ licenses:
26
+ - MIT
27
+ metadata: {}
28
+ post_install_message:
29
+ rdoc_options: []
30
+ require_paths:
31
+ - lib
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ required_rubygems_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ requirements: []
43
+ rubyforge_project:
44
+ rubygems_version: 2.5.1
45
+ signing_key:
46
+ specification_version: 4
47
+ summary: Adds PURGEDOMAIN to Net::HTTP for domain-level cache purging requests in
48
+ Varnish.
49
+ test_files: []