Skip to content

Commit b7fe789

Browse files
authored
Bring Ruby dependencies up to date (#715)
* Bump Sinatra and associates to v4.0 * Bump minimum required Ruby version to Ruby 2.7 * Misc. updates to the Ruby side of dev environment
1 parent 36fe05b commit b7fe789

File tree

6 files changed

+42
-37
lines changed

6 files changed

+42
-37
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
ruby_version: ["2.7"]
20+
ruby_version: ["2.7", "3.3"]
2121
jekyll_version:
2222
- "~> 3.9"
2323
- "~> 4.0"

Gemfile

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,29 @@
22

33
source "https://rubygems.org"
44

5-
# Specify the gem's dependencies in jekyll-admin.gemspec
5+
# Specify the gem's runtime dependencies in jekyll-admin.gemspec
66
gemspec
77

8-
# To allow testing with specific Jekyll versions
9-
gem "jekyll", ENV["JEKYLL_VERSION"] if ENV["JEKYLL_VERSION"]
10-
gem "kramdown-parser-gfm" if ENV["JEKYLL_VERSION"] == "~> 3.9"
8+
group :development do
9+
gem "gem-release", "~> 0.7"
1110

12-
# Fixture site dependencies
13-
gem "jekyll-redirect-from"
11+
# Fixture site dependencies
12+
gem "jekyll-redirect-from"
13+
gem "sinatra-cross_origin", "~> 0.3"
14+
end
1415

15-
# Site dependencies
16-
gem "jekyll-seo-tag"
17-
gem "jekyll-sitemap"
16+
group :docs do
17+
gem "jekyll-seo-tag"
18+
gem "jekyll-sitemap"
19+
end
20+
21+
group :test do
22+
# To allow testing with specific Jekyll versions
23+
gem "jekyll", ENV["JEKYLL_VERSION"] if ENV["JEKYLL_VERSION"]
24+
gem "kramdown-parser-gfm" if ENV["JEKYLL_VERSION"] == "~> 3.9"
25+
26+
gem "rack-test", "~> 2.0"
27+
gem "rake", ">= 10.0"
28+
gem "rspec", "~> 3.4"
29+
gem "rubocop-jekyll", "~> 0.14.0"
30+
end

jekyll-admin.gemspec

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

3-
lib = File.expand_path("lib", __dir__)
4-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5-
require "jekyll-admin/version"
3+
require_relative "lib/jekyll-admin/version"
64

75
Gem::Specification.new do |spec|
86
spec.name = "jekyll-admin"
@@ -17,28 +15,16 @@ Gem::Specification.new do |spec|
1715

1816
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
1917
# to allow pushing to a single host or delete this section to allow pushing to any host.
20-
if spec.respond_to?(:metadata)
21-
spec.metadata["allowed_push_host"] = "https://rubygems.org"
22-
else
23-
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
24-
end
18+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
2519

2620
spec.files = Dir.glob("lib/**/*").concat(%w(LICENSE README.md))
27-
spec.bindir = "exe"
28-
spec.executables = spec.files.grep(%r!^exe/!) { |f| File.basename(f) }
2921
spec.require_paths = ["lib"]
3022

31-
spec.required_ruby_version = ">= 2.3.0"
23+
spec.required_ruby_version = ">= 2.7.0"
24+
spec.required_rubygems_version = ">= 2.7.0"
3225

3326
spec.add_dependency "jekyll", ">= 3.7", "< 5.0"
34-
spec.add_dependency "sinatra", ">= 1.4"
35-
spec.add_dependency "sinatra-contrib", ">= 1.4"
36-
37-
spec.add_development_dependency "bundler", ">= 1.7"
38-
spec.add_development_dependency "gem-release", "~> 0.7"
39-
spec.add_development_dependency "rack-test", "~> 1.0"
40-
spec.add_development_dependency "rake", "~> 10.0"
41-
spec.add_development_dependency "rspec", "~> 3.4"
42-
spec.add_development_dependency "rubocop-jekyll", "~> 0.10.0"
43-
spec.add_development_dependency "sinatra-cross_origin", "~> 0.3"
27+
spec.add_dependency "rackup", "~> 2.0"
28+
spec.add_dependency "sinatra", "~> 4.0"
29+
spec.add_dependency "sinatra-contrib", "~> 4.0"
4430
end

lib/jekyll/commands/serve.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ def start_up_webrick(opts, destination)
2020
end
2121

2222
def jekyll_admin_monkey_patch
23-
@server.mount "/admin", Rack::Handler::WEBrick, JekyllAdmin::StaticServer
24-
@server.mount "/_api", Rack::Handler::WEBrick, JekyllAdmin::Server
23+
Jekyll::External.require_with_graceful_fail "rackup"
24+
25+
@server.mount "/admin", Rackup::Handler::WEBrick, JekyllAdmin::StaticServer
26+
@server.mount "/_api", Rackup::Handler::WEBrick, JekyllAdmin::Server
2527
Jekyll.logger.info "JekyllAdmin mode:", ENV["RACK_ENV"] || "production"
2628
end
2729
end

spec/jekyll-admin/integration_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
context "Jekyll site" do
2424
let(:path) { "/" }
2525

26-
it "serves the Jekyll site", :skip => Gem.win_platform? do
26+
it "serves the Jekyll site", :skip => skip_integration_condition do
2727
expect(response.code).to eql("200")
2828
expect(response.body).to match("You're probably looking for")
2929
end
@@ -32,7 +32,7 @@
3232
context "Admin site" do
3333
let(:path) { "/admin" }
3434

35-
it "serves the Jekyll site", :skip => Gem.win_platform? do
35+
it "serves the Jekyll site", :skip => skip_integration_condition do
3636
with_index_stubbed do
3737
expect(response.code).to eql("200")
3838
expect(response.body).to match("Jekyll Admin")
@@ -43,14 +43,14 @@
4343
context "API" do
4444
let(:path) { "/_api" }
4545

46-
it "serves the Jekyll site", :skip => Gem.win_platform? do
46+
it "serves the Jekyll site", :skip => skip_integration_condition do
4747
expect(response.code).to eql("200")
4848
expect(response.body).to match("collections_api")
4949
end
5050
end
5151

5252
context "watching" do
53-
it "Jekyll isn't watching", :skip => Gem.win_platform? do
53+
it "Jekyll isn't watching", :skip => skip_integration_condition do
5454
File.open(File.join(source, "page.md"), "a") do |f|
5555
f.puts "peek-a-boo"
5656
end

spec/spec_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ def write_file(path, content = "---\n---\n\n# test")
7070
path
7171
end
7272

73+
def skip_integration_condition
74+
Gem.win_platform? || ENV["CI"]
75+
end
76+
7377
RSpec::Matchers.define :be_an_existing_file do
7478
match do |path|
7579
path = in_source_dir(path)

0 commit comments

Comments
 (0)