Skip to content

Commit bede786

Browse files
committed
use Jekyll >= 3.6 to identify custom config files
1 parent 8f61ca4 commit bede786

File tree

4 files changed

+8
-22
lines changed

4 files changed

+8
-22
lines changed

.rubocop.yml

+2
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ AllCops:
1111

1212
Metrics/BlockLength:
1313
Enabled: false
14+
Style/FrozenStringLiteralComment:
15+
Enabled: false

jekyll-admin.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
2727
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
2828
spec.require_paths = ["lib"]
2929

30-
spec.add_dependency "jekyll", "~> 3.3"
30+
spec.add_dependency "jekyll", "~> 3.6"
3131
spec.add_dependency "sinatra", "~> 1.4"
3232
spec.add_dependency "sinatra-contrib", "~> 1.4"
3333
spec.add_dependency "addressable", "~> 2.4"

lib/jekyll-admin/server/configuration.rb

+5-7
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ def parsed_configuration
3131
configuration.read_config_file(configuration_path)
3232
end
3333

34-
def custom_configs
35-
Jekyll::Commands::Serve.custom_configs
36-
end
37-
3834
# Raw configuration content, as it sits on disk
3935
def raw_configuration
4036
File.read(
@@ -43,10 +39,12 @@ def raw_configuration
4339
)
4440
end
4541

46-
# Returns the path to the *first* config file discovered
42+
# Returns the path to the *first* config file from the list passed to terminal
43+
# switch +--config+ or the first of default config files to be discovered at the
44+
# site's source directory.
4745
def configuration_path
48-
if custom_configs
49-
sanitized_path custom_configs.first
46+
if site.config["config"]
47+
sanitized_path site.config["config"].first
5048
else
5149
sanitized_path configuration.config_files(overrides).first
5250
end

lib/jekyll/commands/serve.rb

-14
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,6 @@ module Jekyll
22
module Commands
33
class Serve < Command
44
class << self
5-
def process(opts)
6-
@overrides = opts["config"] if opts["config"]
7-
8-
opts = configuration_from_options(opts)
9-
destination = opts["destination"]
10-
setup(destination)
11-
12-
start_up_webrick(opts, destination)
13-
end
14-
15-
def custom_configs
16-
@custom_configs ||= @overrides
17-
end
18-
195
def start_up_webrick(opts, destination)
206
server = WEBrick::HTTPServer.new(webrick_opts(opts)).tap { |o| o.unmount("") }
217
server.mount(opts["baseurl"], Servlet, destination, file_handler_opts)

0 commit comments

Comments
 (0)