Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Upgrade to initializers system in Bridgetown 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed Oct 9, 2022
1 parent 3ce56a9 commit 8ae2fd3
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.0] - 2022-10-08

- Upgrade to initializers system in Bridgetown 1.2

## [0.3.0] - 2022-06-01

- Support Builder priority feature in Bridgetown 1.1 (fixes #3)
Expand Down
4 changes: 2 additions & 2 deletions bridgetown-prismic.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = ">= 3.0"

spec.add_dependency "bridgetown", ">= 1.0.0.alpha8", "< 2.0"
spec.add_dependency "bridgetown", ">= 1.2.0.beta2", "< 2.0"
spec.add_dependency "prismic.io", ">= 1.8"
spec.add_dependency "async", ">= 1.30", "< 2.0"
spec.add_dependency "async", ">= 2.0"

spec.add_development_dependency "bundler"
spec.add_development_dependency "rake", ">= 13.0"
Expand Down
4 changes: 4 additions & 0 deletions lib/bridgetown-prismic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ def prismic_document
origin.prismic_document
end
end

Bridgetown.initializer :"bridgetown-prismic" do |config|
config.builder BridgetownPrismic::Builder
end
2 changes: 0 additions & 2 deletions lib/bridgetown-prismic/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,3 @@ def load_prismic_documents
end
end
end

BridgetownPrismic::Builder.register
2 changes: 1 addition & 1 deletion lib/bridgetown-prismic/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module BridgetownPrismic
VERSION = "0.3.0"
VERSION = "1.0.0"
end
5 changes: 5 additions & 0 deletions test/fixtures/config/initializers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

Bridgetown.configure do
init :"bridgetown-prismic"
end
3 changes: 3 additions & 0 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
require "minitest/reporters"
require "shoulda"
require "bridgetown"

Bridgetown.begin!

require File.expand_path("../lib/bridgetown-prismic", __dir__)

Bridgetown.logger.log_level = :error
Expand Down
14 changes: 8 additions & 6 deletions test/test_bridgetown_prismic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

class TestBridgetownPrismic < Bridgetown::TestCase
def setup
@site = Bridgetown::Site.new(Bridgetown.configuration(
"root_dir" => root_dir,
"source" => source_dir,
"destination" => dest_dir,
"quiet" => true
))
@config = Bridgetown.configuration(
"root_dir" => root_dir,
"source" => source_dir,
"destination" => dest_dir,
"quiet" => true
)
@config.run_initializers! context: :static
@site = Bridgetown::Site.new(@config)
end

context "post model" do
Expand Down

0 comments on commit 8ae2fd3

Please sign in to comment.