jekyll-paginate 1.0.0 → 1.1.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
  SHA1:
3
- metadata.gz: 62c6e67602e34e45de59f3515fcbbfbc9e0d9d1e
4
- data.tar.gz: 36a70b562afb55ed77810900da0558a4c5c2a864
3
+ metadata.gz: a66b97b63e8efcf07516ec40ca9f5e6112d2d1ab
4
+ data.tar.gz: 28f41a07370b8743ee4643c2bc334e6ea770ab34
5
5
  SHA512:
6
- metadata.gz: 3b36c9b3bfb5fe0d7cda0a34eea2e4963f8c077311bad744fc298b0c93c9e233b15ef674563858a6e02a016f34248d7d929289caee9da20ebfe1c4ec6bdb9ee7
7
- data.tar.gz: fb42df09c3792669988135bf7223cfdb5ab237a1eaf09a5bc73b6137c0b144fa7e9ad4590e7ac4ec8361a99834b5048bf03197bb7905302cfe115aa664497584
6
+ metadata.gz: f6701339a2813c74a86446e6dbe2523fa0586d7f679cb9eac008dad8debdfd91acc023eaba08963334ceb621e50e4bcf7112d5acb6e16b8a2dadd8e4f3bf65cb
7
+ data.tar.gz: f19c99737eafe622e7347d74eba991b3cd6f9f29aa65d966deea05e983589ac66d3e4f8695c8ab24a1cb3b00bf5f9eb3c869883166633bdcdbc934921ef2a99d
@@ -1,5 +1,6 @@
1
1
  language: ruby
2
2
  cache: bundler
3
+ before_install: script/unbundle
3
4
  install:
4
5
  - travis_retry bundle install --path vendor/bundle
5
6
  rvm:
@@ -0,0 +1,9 @@
1
+ ## 1.1.0 / 2014-10-14
2
+
3
+ ### Minor Enhancements
4
+
5
+ * Filter out posts that have `hidden: true` in front matter (#13)
6
+
7
+ ### Development Fixes
8
+
9
+ * Fix tests for rspec 3. (#9)
@@ -20,5 +20,5 @@ Gem::Specification.new do |spec|
20
20
  spec.add_development_dependency "jekyll", "~> 2.0"
21
21
  spec.add_development_dependency "bundler", "~> 1.5"
22
22
  spec.add_development_dependency "rake"
23
- spec.add_development_dependency "rspec"
23
+ spec.add_development_dependency "rspec", "~> 3.0"
24
24
  end
@@ -39,6 +39,7 @@ module Jekyll
39
39
  # "next_page" => <Number> }}
40
40
  def paginate(site, page)
41
41
  all_posts = site.site_payload['site']['posts']
42
+ all_posts = all_posts.reject { |p| p['hidden'] }
42
43
  pages = Pager.calculate_pages(all_posts, site.config['paginate'].to_i)
43
44
  (1..pages).each do |num_page|
44
45
  pager = Pager.new(site, num_page, all_posts, pages)
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Paginate
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+
3
+ RELEASES_URL="https://github.com/jekyll/jekyll/releases"
4
+ JEKYLL_VERSION=`curl http://jekyllrb.com/latest_version.txt`
5
+ JEKYLL_BUNDLE="jekyll-${JEKYLL_VERSION}.tar.gz"
6
+
7
+ wget "${RELEASES_URL}/download/v${JEKYLL_VERSION}/${JEKYLL_BUNDLE}"
8
+ tar -xzvf ${JEKYLL_BUNDLE}
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe(Jekyll::Paginate::Pager) do
3
+ RSpec.describe(Jekyll::Paginate::Pager) do
4
4
 
5
5
  it "calculate number of pages" do
6
6
  expect(described_class.calculate_pages([], '2')).to eql(0)
@@ -60,7 +60,7 @@ describe(Jekyll::Paginate::Pager) do
60
60
  let(:site) { build_site('paginate' => nil) }
61
61
 
62
62
  it "report that pagination is disabled" do
63
- expect(described_class.pagination_enabled?(site)).to be_false
63
+ expect(described_class.pagination_enabled?(site)).to be_falsey
64
64
  end
65
65
  end
66
66
 
@@ -69,7 +69,7 @@ describe(Jekyll::Paginate::Pager) do
69
69
  let(:posts) { site.posts }
70
70
 
71
71
  it "report that pagination is enabled" do
72
- expect(described_class.pagination_enabled?(site)).to be_true
72
+ expect(described_class.pagination_enabled?(site)).to be_truthy
73
73
  end
74
74
 
75
75
  context "with 4 posts" do
@@ -1,12 +1,7 @@
1
1
  require 'jekyll'
2
2
  require File.expand_path("../lib/jekyll-paginate", File.dirname(__FILE__))
3
3
 
4
- RSpec.configure do |config|
5
- config.treat_symbols_as_metadata_keys_with_true_values = true
6
- config.run_all_when_everything_filtered = true
7
- config.filter_run :focus
8
- config.order = 'random'
9
-
4
+ module TestMethods
10
5
  def test_dir(*subdirs)
11
6
  File.join(File.dirname(__FILE__), *subdirs)
12
7
  end
@@ -38,3 +33,65 @@ RSpec.configure do |config|
38
33
  site
39
34
  end
40
35
  end
36
+
37
+ RSpec.configure do |config|
38
+ config.expect_with :rspec do |expectations|
39
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
40
+ end
41
+
42
+ # rspec-mocks config goes here. You can use an alternate test double
43
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
44
+ config.mock_with :rspec do |mocks|
45
+ # Prevents you from mocking or stubbing a method that does not exist on
46
+ # a real object. This is generally recommended, and will default to
47
+ # `true` in RSpec 4.
48
+ mocks.verify_partial_doubles = true
49
+ end
50
+
51
+ # These two settings work together to allow you to limit a spec run
52
+ # to individual examples or groups you care about by tagging them with
53
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
54
+ # get run.
55
+ config.filter_run :focus
56
+ config.run_all_when_everything_filtered = true
57
+
58
+ # Limits the available syntax to the non-monkey patched syntax that is recommended.
59
+ # For more details, see:
60
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
61
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
62
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
63
+ config.disable_monkey_patching!
64
+
65
+ # This setting enables warnings. It's recommended, but in some cases may
66
+ # be too noisy due to issues in dependencies.
67
+ # config.warnings = true
68
+
69
+ # Many RSpec users commonly either run the entire suite or an individual
70
+ # file, and it's useful to allow more verbose output when running an
71
+ # individual spec file.
72
+ if config.files_to_run.one?
73
+ # Use the documentation formatter for detailed output,
74
+ # unless a formatter has already been configured
75
+ # (e.g. via a command-line flag).
76
+ config.default_formatter = 'doc'
77
+ end
78
+
79
+ # Print the 10 slowest examples and example groups at the
80
+ # end of the spec run, to help surface which specs are running
81
+ # particularly slow.
82
+ config.profile_examples = 10
83
+
84
+ # Run specs in random order to surface order dependencies. If you find an
85
+ # order dependency and want to debug it, you can fix the order by providing
86
+ # the seed, which is printed after each run.
87
+ # --seed 1234
88
+ config.order = :random
89
+
90
+ # Seed global randomization in this process using the `--seed` CLI option.
91
+ # Setting this allows you to use `--seed` to deterministically reproduce
92
+ # test failures related to randomization by passing the same `--seed` value
93
+ # as the one that triggered the failure.
94
+ Kernel.srand config.seed
95
+
96
+ include TestMethods
97
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-paginate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-27 00:00:00.000000000 Z
11
+ date: 2014-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '3.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '3.0'
69
69
  description:
70
70
  email:
71
71
  - parkrmoore@gmail.com
@@ -77,6 +77,7 @@ files:
77
77
  - ".rspec"
78
78
  - ".travis.yml"
79
79
  - Gemfile
80
+ - History.markdown
80
81
  - LICENSE.txt
81
82
  - README.md
82
83
  - Rakefile
@@ -87,6 +88,7 @@ files:
87
88
  - lib/jekyll-paginate/version.rb
88
89
  - script/bootstrap
89
90
  - script/cibuild
91
+ - script/unbundle
90
92
  - spec/pager_spec.rb
91
93
  - spec/pagination_spec.rb
92
94
  - spec/source/_posts/2014-05-20-blah.html