middleman-blog 4.0.2 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +69 -0
- data/.travis.yml +20 -28
- data/CHANGELOG.md +4 -4
- data/Gemfile +20 -21
- data/Gemfile-4.x +38 -0
- data/README.md +0 -6
- data/Rakefile +14 -12
- data/features/summary.feature +3 -6
- data/features/support/env.rb +7 -10
- data/features/support/time_steps.rb +7 -10
- data/features/tags.feature +1 -1
- data/fixtures/article-dirs-app/config-directory-indexes.rb +2 -2
- data/fixtures/article-dirs-app/config-permalink-with-dot.rb +2 -2
- data/fixtures/article-dirs-app/config.rb +2 -2
- data/fixtures/blog-sources-app/config.rb +2 -5
- data/fixtures/blog-sources-no-date-app/config.rb +2 -5
- data/fixtures/blog-sources-no-day-app/config.rb +2 -5
- data/fixtures/blog-sources-no-title-app/config.rb +1 -4
- data/fixtures/blog-sources-subdirs-app/config.rb +3 -6
- data/fixtures/calendar-and-tag-app/config-directory-indexes.rb +3 -3
- data/fixtures/calendar-and-tag-app/config.rb +4 -4
- data/fixtures/calendar-app/config-directory-indexes.rb +5 -7
- data/fixtures/calendar-app/config-only-year.rb +7 -9
- data/fixtures/calendar-app/config.rb +5 -7
- data/fixtures/calendar-multiblog-app/config.rb +12 -12
- data/fixtures/custom-collections-app/config-blog-prefix.rb +7 -7
- data/fixtures/custom-collections-app/config-directory-indexes.rb +6 -6
- data/fixtures/custom-collections-app/config.rb +6 -6
- data/fixtures/custom-collections-multiblog-app/config.rb +14 -14
- data/fixtures/custom-collections-sources-app/config.rb +5 -5
- data/fixtures/custom-permalinks-app/config-directory-indexes.rb +3 -3
- data/fixtures/custom-permalinks-app/config.rb +3 -3
- data/fixtures/default-template-app/Gemfile +5 -5
- data/fixtures/default-template-app/config.rb +11 -11
- data/fixtures/filename-date-app/config.rb +1 -1
- data/fixtures/future-date-app/config.rb +2 -2
- data/fixtures/indexes-app/config.rb +2 -2
- data/fixtures/lang-path-app/config.rb +2 -2
- data/fixtures/layouts-app/config.rb +1 -1
- data/fixtures/paginate-app/config-directory-indexes.rb +12 -14
- data/fixtures/paginate-app/config-paginate-off.rb +12 -14
- data/fixtures/paginate-app/config.rb +12 -14
- data/fixtures/paginate-multiblog-app/config.rb +13 -13
- data/fixtures/permalink-app/config.rb +3 -6
- data/fixtures/preview-app/config.rb +2 -2
- data/fixtures/published-app/config.rb +2 -2
- data/fixtures/tags-app/config-directory-indexes.rb +5 -5
- data/fixtures/tags-app/config.rb +5 -5
- data/fixtures/tags-multiblog-app/config.rb +10 -10
- data/lib/middleman-blog.rb +6 -8
- data/lib/middleman-blog/blog_article.rb +20 -40
- data/lib/middleman-blog/blog_data.rb +20 -27
- data/lib/middleman-blog/calendar_pages.rb +8 -14
- data/lib/middleman-blog/commands/article.rb +54 -63
- data/lib/middleman-blog/custom_pages.rb +8 -9
- data/lib/middleman-blog/extension.rb +7 -8
- data/lib/middleman-blog/helpers.rb +17 -26
- data/lib/middleman-blog/paginator.rb +5 -4
- data/lib/middleman-blog/tag_pages.rb +11 -23
- data/lib/middleman-blog/truncate_html.rb +8 -7
- data/lib/middleman-blog/uri_templates.rb +31 -17
- data/lib/middleman-blog/version.rb +1 -3
- data/lib/middleman_extension.rb +1 -1
- data/middleman-blog.gemspec +15 -15
- data/spec/spec_helper.rb +1 -4
- data/spec/uri_templates_spec.rb +23 -30
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 02acc65e0b298f6a99ef12beb14728ce8b38a62d7bd4efb7f18c19c9a374bde0
|
4
|
+
data.tar.gz: 87d8c68a9f577326e49297d95e13cb38ec768b138c882debfab26caa0263eef7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff9a0742dd98a22d3709c787977fbf23337b1fde7bebe42cd47ce7fd3f3ec9bef2dde7b2607775a660af381034fb5f82a4a220a74116c30428b976c008de610c
|
7
|
+
data.tar.gz: 68847383fc5fbce0753ac74ebf66b1f7988ea59a08ee7010a52fd19ea5fecd1e2723be23363d5300b098d6903df67cce1758b000d972d46f96c5c649b8337363
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.3
|
3
|
+
Include:
|
4
|
+
- '**/*.rb'
|
5
|
+
- '**/Rakefile'
|
6
|
+
- '**/Gemfile'
|
7
|
+
- '**/config.ru'
|
8
|
+
Exclude:
|
9
|
+
- 'vendor/**/*'
|
10
|
+
- '**/tmp/**/*'
|
11
|
+
- 'middleman-cli/lib/middleman-cli/templates/**/*'
|
12
|
+
Security/YAMLLoad:
|
13
|
+
Enabled: false
|
14
|
+
Style/GuardClause:
|
15
|
+
Enabled: false
|
16
|
+
Metrics/LineLength:
|
17
|
+
Enabled: false
|
18
|
+
Metrics/MethodLength:
|
19
|
+
Enabled: false
|
20
|
+
Style/Documentation:
|
21
|
+
Enabled: false
|
22
|
+
Metrics/AbcSize:
|
23
|
+
Enabled: false
|
24
|
+
Metrics/CyclomaticComplexity:
|
25
|
+
Enabled: false
|
26
|
+
Metrics/BlockLength:
|
27
|
+
Enabled: false
|
28
|
+
Metrics/ModuleLength:
|
29
|
+
Enabled: false
|
30
|
+
Metrics/PerceivedComplexity:
|
31
|
+
Enabled: false
|
32
|
+
Metrics/ClassLength:
|
33
|
+
Enabled: false
|
34
|
+
Lint/AmbiguousRegexpLiteral:
|
35
|
+
Enabled: false
|
36
|
+
Lint/AmbiguousBlockAssociation:
|
37
|
+
Enabled: false
|
38
|
+
Lint/UriEscapeUnescape:
|
39
|
+
Enabled: false
|
40
|
+
Lint/HandleExceptions:
|
41
|
+
Enabled: false
|
42
|
+
Lint/ShadowedException:
|
43
|
+
Enabled: false
|
44
|
+
Naming/FileName:
|
45
|
+
Enabled: false
|
46
|
+
Naming/UncommunicativeMethodParamName:
|
47
|
+
Enabled: false
|
48
|
+
Naming/MemoizedInstanceVariableName:
|
49
|
+
Enabled: false
|
50
|
+
Naming/HeredocDelimiterNaming:
|
51
|
+
Enabled: false
|
52
|
+
Security/Eval:
|
53
|
+
Enabled: false
|
54
|
+
Style/RegexpLiteral:
|
55
|
+
Enabled: false
|
56
|
+
Style/ClassAndModuleChildren:
|
57
|
+
Enabled: false
|
58
|
+
Style/MissingRespondToMissing:
|
59
|
+
Enabled: false
|
60
|
+
Style/MethodMissingSuper:
|
61
|
+
Enabled: false
|
62
|
+
Style/FrozenStringLiteralComment:
|
63
|
+
Enabled: false
|
64
|
+
Style/EvalWithLocation:
|
65
|
+
Enabled: false
|
66
|
+
Style/ClassVars:
|
67
|
+
Enabled: false
|
68
|
+
Style/GlobalVars:
|
69
|
+
Enabled: false
|
data/.travis.yml
CHANGED
@@ -1,38 +1,30 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
##
|
1
|
+
language: ruby
|
2
|
+
cache: bundler
|
4
3
|
|
5
|
-
|
6
|
-
sudo : false
|
7
|
-
cache : bundler
|
8
|
-
|
9
|
-
before_script :
|
10
|
-
- bundle update
|
11
|
-
|
12
|
-
rvm :
|
4
|
+
rvm:
|
13
5
|
- ruby-head
|
14
|
-
- 2.
|
15
|
-
- 2.3
|
16
|
-
- 2.
|
6
|
+
- 2.6.0
|
7
|
+
- 2.5.3
|
8
|
+
- 2.4.5
|
9
|
+
- 2.3.8
|
17
10
|
|
18
|
-
os
|
11
|
+
os:
|
19
12
|
- linux
|
20
|
-
# - osx
|
21
13
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
- rvm : ruby-head
|
14
|
+
gemfile:
|
15
|
+
- Gemfile
|
16
|
+
- Gemfile-4.x
|
26
17
|
|
27
|
-
|
28
|
-
|
18
|
+
matrix :
|
19
|
+
fast_finish: true
|
20
|
+
allow_failures:
|
21
|
+
- rvm: ruby-head
|
29
22
|
|
30
|
-
script
|
23
|
+
script: bundle exec rake test
|
31
24
|
|
32
|
-
env
|
33
|
-
global
|
25
|
+
env:
|
26
|
+
global:
|
34
27
|
- TEST=true
|
35
|
-
# - CODECLIMATE_REPO_TOKEN=81787f7b1c3bfa937edadcafbc94f807bf5af5c1142c7b793f2d9969a271de1f
|
36
28
|
|
37
|
-
|
38
|
-
|
29
|
+
notifications:
|
30
|
+
email: false
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
$ gem build middleman-blog.gemspec
|
4
|
-
$ gem push middleman-blog-4.0.2.gem
|
5
|
-
|
6
3
|
## 4.0.3
|
7
4
|
|
8
|
-
*
|
5
|
+
* Loosen dependencies and test against Middlman v5 betas
|
6
|
+
* Adapt to core Rubocop standards
|
7
|
+
* Title should be always a string (#351)
|
8
|
+
* Fixed multibyte tags.
|
9
9
|
|
10
10
|
## 4.0.2
|
11
11
|
|
data/Gemfile
CHANGED
@@ -1,38 +1,37 @@
|
|
1
|
-
##
|
2
|
-
# If you do not have OpenSSL installed, change
|
3
|
-
# the following line to use 'http://'
|
4
|
-
##
|
5
1
|
source 'https://rubygems.org'
|
6
2
|
|
7
3
|
# Middleman Gems
|
8
|
-
gem
|
9
|
-
gem
|
4
|
+
gem 'middleman-cli', git: 'https://github.com/middleman/middleman.git', branch: 'master'
|
5
|
+
gem 'middleman-core', git: 'https://github.com/middleman/middleman.git', branch: 'master'
|
10
6
|
|
11
7
|
# Specify your gem's dependencies in middleman-blog.gemspec
|
12
8
|
gemspec
|
13
9
|
|
14
10
|
# Build and doc tools
|
15
|
-
gem 'rake', '~>
|
16
|
-
gem 'yard', '~> 0.
|
11
|
+
gem 'rake', '~> 12.3', require: false
|
12
|
+
gem 'yard', '~> 0.9.11', require: false
|
17
13
|
|
18
14
|
# Test tools
|
19
|
-
gem '
|
20
|
-
gem '
|
21
|
-
gem 'capybara', '~> 2.5.0', require: false
|
22
|
-
gem '
|
23
|
-
gem '
|
15
|
+
gem 'aruba', '~> 0.14.0', require: false
|
16
|
+
gem 'byebug'
|
17
|
+
gem 'capybara', '~> 2.5.0', require: false
|
18
|
+
gem 'cucumber', '~> 3.0', require: false
|
19
|
+
gem 'rspec', '~> 3.0', require: false
|
24
20
|
|
25
|
-
|
26
|
-
gem
|
27
|
-
gem
|
21
|
+
# Pry tools
|
22
|
+
gem 'pry'
|
23
|
+
gem 'pry-rescue'
|
24
|
+
gem 'pry-stack_explorer'
|
25
|
+
|
26
|
+
gem 'kramdown'
|
27
|
+
gem 'nokogiri', '~> 1.9.1'
|
28
|
+
gem 'timecop', '~> 0.6.3'
|
28
29
|
|
29
30
|
# Code Quality
|
30
|
-
gem 'rubocop',
|
31
|
-
gem 'simplecov',
|
32
|
-
gem 'coveralls', '~> 0.8', require: false # Latest 0.8.19
|
33
|
-
gem 'codeclimate-test-reporter', '~> 0.3', require: false, group: :test # Latest 1.0.8
|
31
|
+
gem 'rubocop', '~> 0.61.1', require: false
|
32
|
+
gem 'simplecov', '~> 0.10', require: false
|
34
33
|
|
35
34
|
# Set the ruby platform - not windows
|
36
35
|
platforms :ruby do
|
37
|
-
gem
|
36
|
+
gem 'redcarpet', '~> 3.1' # Latest 3.4.0
|
38
37
|
end
|
data/Gemfile-4.x
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
|
2
|
+
source 'https://rubygems.org'
|
3
|
+
|
4
|
+
# Middleman Gems
|
5
|
+
gem 'middleman-cli', '~> 4.2'
|
6
|
+
gem 'middleman-core', '~> 4.2'
|
7
|
+
|
8
|
+
# Specify your gem's dependencies in middleman-blog.gemspec
|
9
|
+
gemspec
|
10
|
+
|
11
|
+
# Build and doc tools
|
12
|
+
gem 'rake', '~> 12.3', require: false
|
13
|
+
gem 'yard', '~> 0.9.11', require: false
|
14
|
+
|
15
|
+
# Test tools
|
16
|
+
gem 'aruba', '~> 0.14.0', require: false
|
17
|
+
gem 'byebug'
|
18
|
+
gem 'capybara', '~> 2.5.0', require: false
|
19
|
+
gem 'cucumber', '~> 3.0', require: false
|
20
|
+
gem 'rspec', '~> 3.0', require: false
|
21
|
+
|
22
|
+
# Pry tools
|
23
|
+
gem 'pry'
|
24
|
+
gem 'pry-rescue'
|
25
|
+
gem 'pry-stack_explorer'
|
26
|
+
|
27
|
+
gem 'kramdown'
|
28
|
+
gem 'nokogiri', '~> 1.9.1'
|
29
|
+
gem 'timecop', '~> 0.6.3'
|
30
|
+
|
31
|
+
# Code Quality
|
32
|
+
gem 'rubocop', '~> 0.61.1', require: false
|
33
|
+
gem 'simplecov', '~> 0.10', require: false
|
34
|
+
|
35
|
+
# Set the ruby platform - not windows
|
36
|
+
platforms :ruby do
|
37
|
+
gem 'redcarpet', '~> 3.1' # Latest 3.4.0
|
38
|
+
end
|
data/README.md
CHANGED
@@ -38,9 +38,6 @@ Additionally, up-to-date generated code documentation is available on [RubyDoc].
|
|
38
38
|
|
39
39
|
[![Gem Version](https://badge.fury.io/rb/middleman-blog.svg)][gem]
|
40
40
|
[![Build Status](https://travis-ci.org/middleman/middleman-blog.svg)][travis]
|
41
|
-
[![Dependency Status](https://gemnasium.com/middleman/middleman-blog.svg?travis)][gemnasium]
|
42
|
-
[![Code Quality](https://codeclimate.com/github/middleman/middleman-blog.svg)][codeclimate]
|
43
|
-
[![Code Coverage](https://coveralls.io/repos/middleman/middleman-blog/badge.svg?branch=master)][coveralls]
|
44
41
|
|
45
42
|
## Community
|
46
43
|
|
@@ -98,8 +95,5 @@ Copyright (c) 2010-2017 Thomas Reynolds. MIT Licensed, see [LICENSE] for details
|
|
98
95
|
[middleman]: http://middlemanapp.com
|
99
96
|
[gem]: https://rubygems.org/gems/middleman-blog
|
100
97
|
[travis]: http://travis-ci.org/middleman/middleman-blog
|
101
|
-
[gemnasium]: https://gemnasium.com/middleman/middleman-blog
|
102
|
-
[codeclimate]: https://codeclimate.com/github/middleman/middleman-blog
|
103
|
-
[coveralls]: https://coveralls.io/r/middleman/middleman-blog
|
104
98
|
[rubydoc]: http://rubydoc.info/github/middleman/middleman-blog/master
|
105
99
|
[LICENSE]: https://github.com/middleman/middleman-blog/blob/master/LICENSE.md
|
data/Rakefile
CHANGED
@@ -5,31 +5,33 @@ require 'cucumber/rake/task'
|
|
5
5
|
|
6
6
|
require 'middleman-core'
|
7
7
|
|
8
|
-
Cucumber::Rake::Task.new(
|
9
|
-
ENV[
|
8
|
+
Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
|
9
|
+
ENV['TEST'] = 'true'
|
10
10
|
|
11
|
-
exempt_tags =
|
12
|
-
exempt_tags <<
|
11
|
+
exempt_tags = ''
|
12
|
+
exempt_tags << '--tags ~@nojava ' if RUBY_PLATFORM == 'java'
|
13
13
|
|
14
|
-
t.cucumber_opts = "--color --tags ~@wip #{
|
14
|
+
t.cucumber_opts = "--color --tags ~@wip #{exempt_tags} --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
|
15
15
|
end
|
16
16
|
|
17
17
|
require 'rake/clean'
|
18
18
|
|
19
|
-
desc
|
20
|
-
task test: [
|
19
|
+
desc 'Run tests, both RSpec and Cucumber'
|
20
|
+
task test: %i[rubocop spec cucumber]
|
21
21
|
|
22
22
|
require 'rspec/core/rake_task'
|
23
23
|
|
24
|
-
desc
|
25
|
-
|
26
|
-
RSpec::Core::RakeTask.new do | spec |
|
24
|
+
desc 'Run RSpec'
|
25
|
+
RSpec::Core::RakeTask.new do |spec|
|
27
26
|
spec.pattern = 'spec/**/*_spec.rb'
|
28
|
-
spec.rspec_opts = [
|
27
|
+
spec.rspec_opts = ['--color', '--format documentation']
|
29
28
|
end
|
30
29
|
|
31
|
-
|
30
|
+
require 'rubocop/rake_task'
|
31
|
+
desc 'Run RuboCop to check code consistency'
|
32
|
+
RuboCop::RakeTask.new(:rubocop)
|
32
33
|
|
34
|
+
desc 'Build HTML documentation'
|
33
35
|
task :doc do
|
34
36
|
sh 'bundle exec yard'
|
35
37
|
end
|
data/features/summary.feature
CHANGED
@@ -83,14 +83,11 @@ Feature: Article summary generation
|
|
83
83
|
|
84
84
|
Scenario: Summary limited by length only
|
85
85
|
Given a fixture app "summary-app"
|
86
|
-
And a file named "config.rb" with:
|
87
|
-
"""
|
88
|
-
activate :blog
|
89
|
-
"""
|
90
86
|
And a file named "source/index.html.erb" with:
|
91
87
|
"""
|
92
88
|
<% @i = 0 %>
|
93
|
-
|
89
|
+
<%= blog.articles.size %>
|
90
|
+
<% blog.articles.sort_by(&:title).each do |article| %>
|
94
91
|
<article>
|
95
92
|
<%= article.summary(7, (@i += 1).to_s) %>
|
96
93
|
</article>
|
@@ -101,6 +98,6 @@ Feature: Article summary generation
|
|
101
98
|
Then I should see "Summary1"
|
102
99
|
Then I should see "Summary2"
|
103
100
|
Then I should see "Summary3"
|
101
|
+
Then I should see "Summary4"
|
104
102
|
# it has a custom separator, which overrides explicit length, so we show up to the separator
|
105
103
|
Then I should see "Summary from article with separator."
|
106
|
-
Then I should see "Summary5"
|
data/features/support/env.rb
CHANGED
@@ -1,18 +1,15 @@
|
|
1
1
|
require 'simplecov'
|
2
2
|
|
3
3
|
SimpleCov.start do
|
4
|
-
add_filter
|
4
|
+
add_filter '/features/'
|
5
5
|
end
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
ENV['TEST'] = 'true'
|
8
|
+
ENV['AUTOLOAD_SPROCKETS'] = 'false'
|
9
9
|
|
10
|
-
|
11
|
-
ENV[ "AUTOLOAD_SPROCKETS" ] = "false"
|
10
|
+
PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
|
12
11
|
|
13
|
-
|
12
|
+
require 'middleman-core'
|
13
|
+
require 'middleman-core/step_definitions'
|
14
14
|
|
15
|
-
require
|
16
|
-
require "middleman-core/step_definitions"
|
17
|
-
|
18
|
-
require File.join( PROJECT_ROOT_PATH, 'lib', 'middleman-blog' )
|
15
|
+
require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-blog')
|
@@ -1,28 +1,25 @@
|
|
1
1
|
require 'timecop'
|
2
2
|
require 'active_support/core_ext/time/calculations'
|
3
3
|
|
4
|
-
Time.zone =
|
4
|
+
Time.zone = 'UTC' if Time.zone.nil?
|
5
5
|
|
6
|
-
Given /the timezone is "(.+?)"$/ do |
|
7
|
-
|
6
|
+
Given /the timezone is "(.+?)"$/ do |zone|
|
7
|
+
Time.zone = zone
|
8
8
|
end
|
9
9
|
|
10
|
-
Given /the (date|time|date and time) is (.+?)$/ do |
|
10
|
+
Given /the (date|time|date and time) is (.+?)$/ do |datetime, value|
|
11
11
|
time = case datetime
|
12
|
-
when
|
12
|
+
when 'date'
|
13
13
|
Date.parse(value)
|
14
|
-
when
|
14
|
+
when 'time'
|
15
15
|
Time.parse(value)
|
16
|
-
when
|
16
|
+
when 'date and time'
|
17
17
|
Time.zone.parse(value)
|
18
18
|
end
|
19
19
|
|
20
20
|
Timecop.travel time
|
21
|
-
|
22
21
|
end
|
23
22
|
|
24
23
|
After do
|
25
|
-
|
26
24
|
Timecop.return
|
27
|
-
|
28
25
|
end
|
data/features/tags.feature
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
activate :blog do |blog|
|
2
|
-
blog.permalink =
|
3
|
-
blog.sources =
|
2
|
+
blog.permalink = '{year}/{month}/{day}/{title}'
|
3
|
+
blog.sources = 'blog/:year-:month-:day-:title.html'
|
4
4
|
end
|
5
5
|
|
6
6
|
activate :directory_indexes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
activate :blog do |blog|
|
2
|
-
blog.permalink =
|
3
|
-
blog.sources =
|
2
|
+
blog.permalink = '{year}.{month}.{day}/{title}'
|
3
|
+
blog.sources = 'blog/:year-:month-:day-:title.html'
|
4
4
|
end
|
5
5
|
|
6
6
|
activate :directory_indexes
|
@@ -1,3 +1,3 @@
|
|
1
1
|
activate :blog do |blog|
|
2
|
-
blog.sources =
|
3
|
-
end
|
2
|
+
blog.sources = 'blog/:year-:month-:day-:title.html'
|
3
|
+
end
|