bridgetown-content-security-policy 1.2.0 → 2.0.0

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
  SHA256:
3
- metadata.gz: 3f75a1bfbb00c754a13f87bc07d494e8fd5a73bc18ff032124407ba6c2d410ce
4
- data.tar.gz: 824961a6500068aa87074b8cf9bab87d2baf6732ece45f950069aa5b19422b65
3
+ metadata.gz: '01187babccb4805b3932c7d8c0fbefb349fecf45e829108b44538dfb3c8f7fe4'
4
+ data.tar.gz: b8770f4cfb4740c2c7cbaa5ca3daa78d82ec8f5e2ff29e864428bd5ebaf40052
5
5
  SHA512:
6
- metadata.gz: 1fd88f9d078a63758bbe6d326af1d934b365160d64a29520f217595082d6f2b303fac4751cf3aa91def8e157c1af6bd3084173fc4cbd180b19ede8ac83970d7f
7
- data.tar.gz: 9834a964cfc7f603010970637b0f399450d76e256abc0a46e71c43d94bc3eafda6135cc84069907fd08847b5ac2447275a634a67512fcd25b81a702adfd70a20
6
+ metadata.gz: be9c1dd319f104c400cfcd08ae25318a95ecc6591af0a903dd212ef00fb2659d32e36d2b7c4208fd363124d835646b41f9efc7171336e800d9cf6406017b2460
7
+ data.tar.gz: 65819b692aaf3b25e6f03bea50cbe2807a320e9f4ac85d00f35567c4710bbcb34fb05d5205b9cb967f87784fd8ab43edc65093cb3b2b7953f8086e27ff3f1898
@@ -14,7 +14,7 @@ jobs:
14
14
  strategy:
15
15
  matrix:
16
16
  ruby_version: [2.7.7, 3.0.5, 3.1.3, 3.2.0]
17
- bridgetown_version: [1.0.0, 1.1.0]
17
+ bridgetown_version: [1.2.0]
18
18
  continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
19
19
  # Has to be top level to cache properly
20
20
  env:
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # main
2
2
 
3
+ # 2.0.0 / 25-01-2023
4
+
5
+ * Restrict support to Bridgetown v1.2 and newer.
6
+ * Initialize plugin using the new Ruby DSL in Bridgetown v1.2.
7
+
3
8
  # 1.2.0 / 23-01-2023
4
9
 
5
10
  * Require Bridgetown 1.0 or newer.
data/Gemfile CHANGED
@@ -5,13 +5,8 @@ gemspec
5
5
 
6
6
  gem "bridgetown", ENV["BRIDGETOWN_VERSION"] if ENV["BRIDGETOWN_VERSION"]
7
7
 
8
- group :development, :test do
9
- gem "byebug"
10
- end
11
-
12
8
  group :test do
13
9
  gem "minitest"
14
10
  gem "minitest-profile"
15
11
  gem "minitest-reporters"
16
- gem "shoulda"
17
12
  end
data/Rakefile CHANGED
@@ -9,4 +9,5 @@ Rake::TestTask.new(:test) do |test|
9
9
  test.libs << "lib" << "test"
10
10
  test.pattern = "test/**/test_*.rb"
11
11
  test.verbose = true
12
+ test.warning = false
12
13
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.required_ruby_version = ">= 2.7.0"
20
20
 
21
- spec.add_dependency "bridgetown", ">= 1.0", "< 2.0"
21
+ spec.add_dependency "bridgetown", ">= 1.2.0", "< 2.0"
22
22
 
23
23
  spec.add_development_dependency "bundler"
24
24
  spec.add_development_dependency "nokogiri"
@@ -36,6 +36,7 @@ create_file "config/content_security_policy.config.rb" do
36
36
  RUBY
37
37
  end
38
38
 
39
- say_status :content_security_policy, "All done! Please add {% content_security_policy %} to the head tag in your layouts."
40
- say_status :content_security_policy, "Please see the new content_security_policy.rb file for details"
39
+ say_status :content_security_policy, "All done! Add `init :\"bridgetown-content-security-policy\"` to your `config/initializers.rb`"
40
+ say_status :content_security_policy, "Add <% content_security_policy %> to the head tag in your layouts to render the CSP."
41
+ say_status :content_security_policy, "See the new content_security_policy.rb file for details"
41
42
  say_status :content_security_policy, "More info available at: https://github.com/ayushn21/bridgetown-content-security-policy"
@@ -22,12 +22,8 @@ module BridgetownContentSecurityPolicy
22
22
  render tag.context["page"]["content_security_policy"]
23
23
  end
24
24
 
25
- helper "_csp" do |policy_name|
26
- render policy_name
27
- end
28
-
29
- helper "content_security_policy", helpers_scope: true do
30
- _csp view.page.data.content_security_policy
25
+ helper "content_security_policy" do
26
+ render helpers.view.page.data.content_security_policy
31
27
  end
32
28
  end
33
29
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgetownContentSecurityPolicy
4
- VERSION = "1.2.0"
4
+ VERSION = "2.0.0"
5
5
  end
@@ -4,4 +4,6 @@ require "bridgetown"
4
4
  require "bridgetown-content-security-policy/policy"
5
5
  require "bridgetown-content-security-policy/builder"
6
6
 
7
- BridgetownContentSecurityPolicy::Builder.register
7
+ Bridgetown.initializer :"bridgetown-content-security-policy" do |config|
8
+ config.builder BridgetownContentSecurityPolicy::Builder
9
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-content-security-policy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ayush Newatia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-23 00:00:00.000000000 Z
11
+ date: 2023-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: 1.2.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '1.0'
29
+ version: 1.2.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2.0'