Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
inherit_gem:
jekyll: .rubocop.yml

Lint/ShadowingOuterLocalVariable:
Exclude:
- lib/jekyll-archives.rb

Metrics/BlockLength:
Exclude:
- test/**/*.rb

Metrics/LineLength:
Exclude:
- test/**/*.rb
- lib/jekyll-archives.rb
- lib/jekyll-archives/archive.rb
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ sudo: false
before_install: gem update --system

rvm:
- 2.1
- 2.2
- 2.3
- 2.4

env:
- ""
- JEKYLL_VERSION=3.4
- JEKYLL_VERSION=3.1

matrix:
include:
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ require "rake/testtask"
Rake::TestTask.new(:test) do |test|
test.libs << "lib" << "test"
test.pattern = "test/**/test_*.rb"
test.warning = false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do? Suppress ruby warnings in the test output?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

end

task :default => "test"
Expand Down
6 changes: 4 additions & 2 deletions jekyll-archives.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ Gem::Specification.new do |s|

s.homepage = "https://github.com/jekyll/jekyll-archives"
s.licenses = ["MIT"]
s.files = ["lib/jekyll-archives.rb", "lib/jekyll-archives/archive.rb"]

s.add_dependency "jekyll", ">= 2.4"
all_files = `git ls-files -z`.split("\x0")
s.files = all_files.grep(%r!^(lib)/!)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use Dir globbing instead of git to get the file list? There's a growing practice of folks not depending on git to get the file list for gems in order to avoid putting git on production like systems.


s.add_dependency "jekyll", ">= 3.1"

s.add_development_dependency "minitest"
s.add_development_dependency "rake"
Expand Down
6 changes: 1 addition & 5 deletions lib/jekyll-archives.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ class Archives < Jekyll::Generator
}.freeze

def initialize(config = nil)
@config = if config["jekyll-archives"].nil?
DEFAULTS
else
Utils.deep_merge_hashes(DEFAULTS, config["jekyll-archives"])
end
@config = Utils.deep_merge_hashes(DEFAULTS, config.fetch("jekyll-archives", {}))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️
Hash#fetch is my jam

end

def generate(site)
Expand Down