jekyll-cloudflare 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +40 -0
- data/Rakefile +2 -0
- data/jekyll-cloudflare.gemspec +27 -0
- data/lib/jekyll/cloudflare.rb +7 -0
- data/lib/jekyll/cloudflare/version.rb +5 -0
- data/lib/jekyll/tasks/cloudflare.rake +22 -0
- metadata +55 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 874b7a9a04390e546deeff23be2839871e9db96094c9a669b1dc4fa3755b1d58
|
4
|
+
data.tar.gz: f17667a2f0a113ac4360d757532304406115a7ead6b7a1361e7c1ec9ab870a74
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3bf21c29d1b75f5ed3b9118b3ed251423a641afbb1b15fd18d166a1ebdf1e2b25222ae67e3bb8ab485704cbf3586c418076b9916f4765cd1df715accd156807a
|
7
|
+
data.tar.gz: 76a884554e636ed760746b830b8e3f1320109936518cd5c533e965963a909e473784243d7484d7e059cd66aca62a008c791037765ba564c84aaa514c10c9643e
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Bodacious
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# Jekyll::Cloudflare
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/jekyll/cloudflare`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'jekyll-cloudflare'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install jekyll-cloudflare
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
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.
|
30
|
+
|
31
|
+
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).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jekyll-cloudflare.
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require_relative 'lib/jekyll/cloudflare/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "jekyll-cloudflare"
|
5
|
+
spec.version = Jekyll::Cloudflare::VERSION
|
6
|
+
spec.authors = ["Bodacious"]
|
7
|
+
spec.email = ["bodacious@katanacode.com"]
|
8
|
+
|
9
|
+
spec.summary = %q{Clear the CloudFlare cache after updating Jekyll site}
|
10
|
+
spec.description = %q{Clear CloudFlare cache after deploying new Jekyll static site files}
|
11
|
+
spec.homepage = "https://github.com/katanacode/jekyll-cloudflare"
|
12
|
+
spec.license = "MIT"
|
13
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
14
|
+
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
16
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
17
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/CHANGELOG"
|
18
|
+
|
19
|
+
# Specify which files should be added to the gem when it is released.
|
20
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
21
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
22
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
|
+
end
|
24
|
+
spec.bindir = "exe"
|
25
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
|
+
spec.require_paths = ["lib"]
|
27
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'dotenv/tasks'
|
2
|
+
|
3
|
+
namespace :jekyll do
|
4
|
+
namespace :cloudflare do
|
5
|
+
|
6
|
+
desc "Purge the CloudFlare cache"
|
7
|
+
task :purge_cache => :dotenv do
|
8
|
+
%w[ CLOUDFLARE_API_TOKEN CLOUDFLARE_ZONE ].each do |var_name|
|
9
|
+
unless ENV.key?(var_name)
|
10
|
+
warn("Please provide #{var_name}")
|
11
|
+
exit(1)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
puts "Purging CloudFlare cache..."
|
15
|
+
system(%Q{curl -X POST "https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE}/purge_cache" \
|
16
|
+
-H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" \
|
17
|
+
-H "Content-Type: application/json" \
|
18
|
+
--data '{"purge_everything":true}'})
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-cloudflare
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bodacious
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-06-18 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Clear CloudFlare cache after deploying new Jekyll static site files
|
14
|
+
email:
|
15
|
+
- bodacious@katanacode.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- ".gitignore"
|
21
|
+
- Gemfile
|
22
|
+
- LICENSE.txt
|
23
|
+
- README.md
|
24
|
+
- Rakefile
|
25
|
+
- jekyll-cloudflare.gemspec
|
26
|
+
- lib/jekyll/cloudflare.rb
|
27
|
+
- lib/jekyll/cloudflare/version.rb
|
28
|
+
- lib/jekyll/tasks/cloudflare.rake
|
29
|
+
homepage: https://github.com/katanacode/jekyll-cloudflare
|
30
|
+
licenses:
|
31
|
+
- MIT
|
32
|
+
metadata:
|
33
|
+
homepage_uri: https://github.com/katanacode/jekyll-cloudflare
|
34
|
+
source_code_uri: https://github.com/katanacode/jekyll-cloudflare
|
35
|
+
changelog_uri: https://github.com/katanacode/jekyll-cloudflare/CHANGELOG
|
36
|
+
post_install_message:
|
37
|
+
rdoc_options: []
|
38
|
+
require_paths:
|
39
|
+
- lib
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 2.3.0
|
45
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
requirements: []
|
51
|
+
rubygems_version: 3.1.3
|
52
|
+
signing_key:
|
53
|
+
specification_version: 4
|
54
|
+
summary: Clear the CloudFlare cache after updating Jekyll site
|
55
|
+
test_files: []
|