cache-buster 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MTg1NjE0MWY3OTgzODczYzc4YTlhY2FhNGMwNzhjYTM3OGE3ODEwMg==
5
+ data.tar.gz: !binary |-
6
+ YzdhMWQ2MmQzOWExYWEzZjMzNWViNjIxNTQzNWI2MDQzMWMxYzFjNA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ OWQzYTc5ZjIzNTJiZDI3YmQyYzZiNTFjODVjYWIzOGIxNGJjMzJiYTVkOThj
10
+ MWJmMWIwYzE0MTJhMTgwN2MwNzI0NGNjMmRjYzc5MWFhMzkzOGNkMjNhNjcx
11
+ ZDQ3N2QyYmJlNWIyNmFhNzE2OGQxZDJjOTkwZWFhOTRlNmQ0ZDQ=
12
+ data.tar.gz: !binary |-
13
+ ZDAxMTQ3OTc2NmFkOGNhODgxZmQyNjc2ZWVkNTQ5NzQ0YmQwNDMyZThlZTdl
14
+ Yzk5Y2QxNjIzNGMzMmExNTM3MDkxY2NkZDFhODM1MjRhY2FiMzJhZmIwZDE0
15
+ N2Q3ZjdhZWY1MzcwZjEwMmFlZWI5MDdjOTkyNDc4YjFlNTY2YTE=
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .env
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,37 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.4
4
+ before_install: gem install bundler -v 1.11.2
5
+ env:
6
+ global:
7
+ - secure: jYUX3kuylRyISFwsqZKIdh8eXxxmfVvcMKV3CuMqaeYWmK9FidqpJRiz8ZJLvrXNCLcW4zfEbSuC4C4snActTLB1mnAeqZVKoZRaIJo6qL0nnmlPpiQ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GlyDFTJdoX/v27A2pNyXrm1DOw3wonLh0N8FJBe+WbPSDkOH35jBTf011Nsyc9ouEcH24/ljPMhxW7pkFgUuH704w=
19
+ deploy:
20
+ provider: rubygems
21
+ api_key:
22
+ secure: gzbh51QSje2D5tgSoJN+w1/T1kjEQryZJ6aGOrZ5FgLjroW1gjuwCpWtqym4Te24t1yh4L5PI1Psxb34D0H5rZVL+H8wVzp+QWq4jiLe2G2AJtkAvogbIwRSAwOI1AuUGcee59KnJAhjyJYU/eYXwn5R/sPZOYzMRI9xdoTe5FGHlAycgYhm7PJwMqUTW+bD5NRy1B/+W9mq59rCcXBElD52CB0oQXKzW6N/FIO3Ws4jqsLjwCcQxdCpOl3xzd/hV0tf8g6cb2Yyiqux+3jgbvAuh6h8DTEAm1xbPTpk6ktrRVAUwGIVpI8Kajap9XOZZp8ginR2Q/6/dGeeJeAKhAvnW5QsQsT4iDwwnG+IQMx3g8PkxjwlK50z660rnbE3PIYH+CCQlFHwwGwalbs9ExoSkGjJfaedyWtWJaGE+ZO9iKeOEMjlfZVtWHKwE1+iGzt4pQ4UEi2yap9PAamhrZ9Q9m4J/WN5GiDB9/ue+Uq2lX2mv5uwXn3XpNDBjF6GtQOBbR+3N7lv10QyyoQWu1K2wbyrW/fwCR45x2HciKokdWSmtBFu9Hc+i+AXbC736rsZHA/WtvUinnAEE+6ht2qDflKNA6E+LLwXxQAuYMmRE8gc7sruCeWyCt1qDS0sgUkXODzCW5WM/sWY1VNDY+seJKucf1drP/XpJUBwe4Q=
23
+ gem: cache-buster
24
+ on:
25
+ tags: true
26
+ repo: theodi/cache-buster
27
+ after_success:
28
+ - export GEM_VERSION=`ruby -e "puts Gem::Specification.load(Dir['*.gemspec'].first).version.to_s"`
29
+ - '[ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && curl
30
+ -v -X POST -d ''{"ref":"refs/tags/''$GEM_VERSION''","sha":"''$TRAVIS_COMMIT''"}'' --header
31
+ "Content-Type:application/json" -u $GITHUB_USER:$GITHUB_PASSWORD "https://api.github.com/repos/$TRAVIS_REPO_SLUG/git/refs"'
32
+ - gem install github_changelog_generator && github_changelog_generator
33
+ - git config user.name "Travis CI"
34
+ - git config user.email "travis@theodi.org"
35
+ - git add CHANGELOG.md
36
+ - git commit -m "Updated Changelog [ci skip]"
37
+ - git push "https://${CHANGELOG_GITHUB_TOKEN}@github.com/theodi/cache-buster" master
@@ -0,0 +1,6 @@
1
+ # Change Log
2
+
3
+ ## [0.1.0](https://github.com/theodi/cache-buster/tree/0.1.0) (2016-03-08)
4
+
5
+
6
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at pezholio@gmail.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cache-buster.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 pezholio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,46 @@
1
+ [![Build Status](http://img.shields.io/travis/theodi/cache-buster.svg)](https://travis-ci.org/theodi/cache-buster)
2
+ [![Dependency Status](http://img.shields.io/gemnasium/theodi/cache-buster.svg)](https://gemnasium.com/theodi/cache-buster)
3
+ [![Coverage Status](http://img.shields.io/coveralls/theodi/cache-buster.svg)](https://coveralls.io/r/theodi/cache-buster)
4
+ [![Code Climate](http://img.shields.io/codeclimate/github/theodi/cache-buster.svg)](https://codeclimate.com/github/theodi/cache-buster)
5
+ [![Gem Version](http://img.shields.io/gem/v/cache-buster.svg)](https://rubygems.org/gems/cache-buster)
6
+ [![License](http://img.shields.io/:license-mit-blue.svg)](http://theodi.mit-license.org)
7
+ [![Badges](http://img.shields.io/:badges-7/7-ff6799.svg)](https://github.com/badges/badgerbadgerbadger)
8
+
9
+ # Cache Buster
10
+
11
+ ♩ ♫ ♩ When a cache gets stuck, and something something else / Who you gonna call? ♩ ♫ ♩
12
+
13
+ ## Installation
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ ```ruby
18
+ gem 'cache-buster'
19
+ ```
20
+
21
+ And then execute:
22
+
23
+ $ bundle
24
+
25
+ Or install it yourself as:
26
+
27
+ $ gem install cache-buster
28
+
29
+ ## Usage
30
+
31
+ TODO: Write usage instructions here
32
+
33
+ ## Development
34
+
35
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
36
+
37
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
38
+
39
+ ## Contributing
40
+
41
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cache-buster. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
42
+
43
+
44
+ ## License
45
+
46
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "cache-buster"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cache-buster/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cache-buster"
8
+ spec.version = CacheBuster::VERSION
9
+ spec.authors = ["pezholio"]
10
+ spec.email = ["pezholio@gmail.com"]
11
+
12
+ spec.summary = "♩ ♫ ♩ When a cache gets stuck, and something something else / Who you gonna call? ♩ ♫ ♩"
13
+ spec.homepage = "https://github.com/theodi/cache-buster"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "rubyflare", "~> 0.1.0"
22
+ spec.add_dependency "dotenv", "~> 2.0.2"
23
+ spec.add_dependency "fog-rackspace", "~> 0.1"
24
+ spec.add_dependency "thor", "~> 0.19"
25
+ spec.add_dependency "pi_piper", "~> 1.9"
26
+
27
+ spec.add_development_dependency "bundler", "~> 1.11"
28
+ spec.add_development_dependency "rake", "~> 10.0"
29
+ spec.add_development_dependency "rspec", "~> 3.0"
30
+ spec.add_development_dependency "pry", "~> 0.10"
31
+ spec.add_development_dependency "vcr", "~> 3.0"
32
+ spec.add_development_dependency "webmock", "~> 1.24"
33
+ spec.add_development_dependency "coveralls", "~> 0.8"
34
+ end
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "cache-buster"
5
+
6
+ CacheBuster::Cli.start(ARGV)
@@ -0,0 +1,16 @@
1
+ require "dotenv"
2
+ require "rubyflare"
3
+ require "fog/rackspace"
4
+ require "thor"
5
+ require "pi_piper"
6
+
7
+ Dotenv.load
8
+
9
+ require "cache-buster/version"
10
+ require "cache-buster/cloudflare"
11
+ require "cache-buster/rackspace"
12
+ require "cache-buster/cli"
13
+ require "cache-buster/pi"
14
+
15
+ module CacheBuster
16
+ end
@@ -0,0 +1,36 @@
1
+ module CacheBuster
2
+ class Cli < Thor
3
+ desc "clear PATH", "clears the cache at PATH"
4
+ option :hard, :type => :boolean
5
+ def clear(path = 'news')
6
+ if options[:hard]
7
+ say "********************************************************************************************************\n", :red
8
+ say "* SUPER MEGA IMPORTANT WARNING *\n", :red
9
+ say "********************************************************************************************************\n", :red
10
+ say "* This will reboot all three backend nodes cleanly to completely clear the mysterious invisible caches *\n", :red
11
+ say "* Before doing this, you should try and clear a page cache without the --hard option *\n", :red
12
+ say "********************************************************************************************************\n\n", :red
13
+ if yes?('Are you sure you want to proceed?', :yellow)
14
+ say "\nPreparing to clear the cache with brute force. Press ctrl + c to cancel\n", :red
15
+ (1..5).to_a.reverse_each { |i| say "#{i}.. ", :red ; sleep 1 }
16
+ say "\n\nClearing cache.... ", :red
17
+ Rackspace.new.clear
18
+ say "Done!\n", :green
19
+ else
20
+ say "\nAborting. This was probably the right decision.\n", :green
21
+ end
22
+ else
23
+ say "Clearing cache for #{path}..... ", :yellow
24
+ Cloudflare.new.clear(path)
25
+ say "Done!", :green
26
+ end
27
+ end
28
+
29
+ desc "watch", "watches for a button press"
30
+ def watch
31
+ say "Waiting for someone to press a button"
32
+ Pi.new
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,25 @@
1
+ module CacheBuster
2
+ class Cloudflare
3
+
4
+ def initialize
5
+ @connection = Rubyflare.connect_with(ENV['CLOUDFLARE_EMAIL'], ENV['CLOUDFLARE_API_KEY'])
6
+ end
7
+
8
+ def clear(path = 'news')
9
+ @connection.delete("/zones/#{zone[:id]}/purge_cache", {
10
+ files: ["#{zone[:host]}/#{path}"]
11
+ })
12
+ end
13
+
14
+ def zone
15
+ @zone ||= begin
16
+ zone = @connection.get("zones/#{ENV['CLOUDFLARE_ZONE_ID']}")
17
+ {
18
+ id: zone.results[:id],
19
+ host: "http://#{zone.results[:name]}"
20
+ }
21
+ end
22
+ end
23
+
24
+ end
25
+ end
@@ -0,0 +1,43 @@
1
+ module CacheBuster
2
+ class Pi
3
+
4
+ def initialize
5
+ watch_buttons
6
+ end
7
+
8
+ def watch_buttons
9
+ PiPiper.watch pin: ENV['SOFT_BUTTON'].to_i do
10
+ CacheBuster::Pi.soft
11
+ end
12
+
13
+ PiPiper.watch pin: ENV['HARD_BUTTON'].to_i do
14
+ CacheBuster::Pi.hard
15
+ end
16
+
17
+ PiPiper.wait
18
+ end
19
+
20
+ def self.hard
21
+ run Proc.new { Rackspace.new.clear }
22
+ end
23
+
24
+ def self.soft
25
+ run Proc.new { Cloudflare.new.clear }
26
+ end
27
+
28
+ def self.run(proc)
29
+ red = PiPiper::Pin.new(pin: ENV['RED_PIN'].to_i, direction: :out)
30
+ green = PiPiper::Pin.new(pin: ENV['GREEN_PIN'].to_i, direction: :out)
31
+ red.on
32
+ proc.call
33
+ red.off
34
+ green.on
35
+ sleep 5
36
+ green.off
37
+ red.release
38
+ green.release
39
+ exit if ENV['TEST']
40
+ end
41
+
42
+ end
43
+ end
@@ -0,0 +1,25 @@
1
+ module CacheBuster
2
+ class Rackspace
3
+
4
+ def initialize
5
+ @connection = Fog::Compute.new(
6
+ :provider => 'Rackspace',
7
+ :rackspace_api_key => ENV['RACKSPACE_API_KEY'],
8
+ :rackspace_username => ENV['RACKSPACE_USERNAME'],
9
+ :rackspace_region => :lon
10
+ )
11
+ end
12
+
13
+ def clear
14
+ servers.each do |server_id|
15
+ @connection.reboot_server(server_id, 'SOFT')
16
+ sleep 90
17
+ end
18
+ end
19
+
20
+ def servers
21
+ ENV['RACKSPACE_SERVER_IDS'].split(',')
22
+ end
23
+
24
+ end
25
+ end
@@ -0,0 +1,3 @@
1
+ module CacheBuster
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,233 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cache-buster
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - pezholio
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-03-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubyflare
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 0.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: dotenv
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 2.0.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 2.0.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: fog-rackspace
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '0.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '0.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: thor
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '0.19'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '0.19'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pi_piper
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '1.9'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '1.9'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '1.11'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '1.11'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: '10.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: '10.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: '3.0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: '3.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ~>
130
+ - !ruby/object:Gem::Version
131
+ version: '0.10'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ~>
137
+ - !ruby/object:Gem::Version
138
+ version: '0.10'
139
+ - !ruby/object:Gem::Dependency
140
+ name: vcr
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ~>
144
+ - !ruby/object:Gem::Version
145
+ version: '3.0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ~>
151
+ - !ruby/object:Gem::Version
152
+ version: '3.0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: webmock
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ~>
158
+ - !ruby/object:Gem::Version
159
+ version: '1.24'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ~>
165
+ - !ruby/object:Gem::Version
166
+ version: '1.24'
167
+ - !ruby/object:Gem::Dependency
168
+ name: coveralls
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ~>
172
+ - !ruby/object:Gem::Version
173
+ version: '0.8'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ~>
179
+ - !ruby/object:Gem::Version
180
+ version: '0.8'
181
+ description:
182
+ email:
183
+ - pezholio@gmail.com
184
+ executables:
185
+ - cachebuster
186
+ extensions: []
187
+ extra_rdoc_files: []
188
+ files:
189
+ - .gitignore
190
+ - .rspec
191
+ - .travis.yml
192
+ - CHANGELOG.md
193
+ - CODE_OF_CONDUCT.md
194
+ - Gemfile
195
+ - LICENSE.txt
196
+ - README.md
197
+ - Rakefile
198
+ - bin/console
199
+ - bin/setup
200
+ - cache-buster.gemspec
201
+ - exe/cachebuster
202
+ - lib/cache-buster.rb
203
+ - lib/cache-buster/cli.rb
204
+ - lib/cache-buster/cloudflare.rb
205
+ - lib/cache-buster/pi.rb
206
+ - lib/cache-buster/rackspace.rb
207
+ - lib/cache-buster/version.rb
208
+ homepage: https://github.com/theodi/cache-buster
209
+ licenses:
210
+ - MIT
211
+ metadata: {}
212
+ post_install_message:
213
+ rdoc_options: []
214
+ require_paths:
215
+ - lib
216
+ required_ruby_version: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - ! '>='
219
+ - !ruby/object:Gem::Version
220
+ version: '0'
221
+ required_rubygems_version: !ruby/object:Gem::Requirement
222
+ requirements:
223
+ - - ! '>='
224
+ - !ruby/object:Gem::Version
225
+ version: '0'
226
+ requirements: []
227
+ rubyforge_project:
228
+ rubygems_version: 2.4.5
229
+ signing_key:
230
+ specification_version: 4
231
+ summary: ♩ ♫ ♩ When a cache gets stuck, and something something else / Who you gonna
232
+ call? ♩ ♫ ♩
233
+ test_files: []