jekyll-tagging-related_posts 0.2.1 → 0.2.2

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: 0f1f4e45c248fb2a69a91c54d829d2fdce540980
4
- data.tar.gz: c8e4c1f144d58ba34ee8dc134c54729bf490a708
3
+ metadata.gz: 20d16d60d5daee079c042abaa2a37ea5e3839bcf
4
+ data.tar.gz: 528f966fe4c266d05cd7fcc5bfd5b06d325242f4
5
5
  SHA512:
6
- metadata.gz: 4536688752437f4a1eb131493c4db0ddfeb4535c45f5ecf9e901d819e643f791d0015a033ea988537e9b8786f91313c6536c4c432c005104876c8b6c54e4f4a0
7
- data.tar.gz: f550ea9146e83bb23ed5ab1e7c0571aaa22dc0b43f72cc3426b0d3272a90d2929030df431d6f6e862ff580009b46a18e0f8de0d1e814fd115f26a032fc579c24
6
+ metadata.gz: d324224e3870d0c23e6035c41536a5edabd0def554696ea96fde5dfce7151a1d274ba649bdbac5dac466b46f9d4c5ea8a09515022ed208d56299932f821266ef
7
+ data.tar.gz: 7406365a3047033d44784a5f8629f7448db52f73d63e01d1afea0e5b406f09ace9769b7501e0802171d2caee1c319c863fa43eee5946d5d6a78cef467dfe3aa9
data/.travis.yml CHANGED
@@ -1,6 +1,14 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
  rvm:
3
4
  - 2.0
4
5
  - 2.1
5
6
  - 2.2
6
- before_install: gem install bundler -v 1.10.6
7
+ - 2.3.1
8
+ - 2.4.0
9
+ gemfile:
10
+ - gemfiles/jekyll_3.3.gemfile
11
+ - gemfiles/jekyll_3.2.gemfile
12
+ - gemfiles/jekyll_3.1.gemfile
13
+ - gemfiles/jekyll_3.gemfile
14
+ before_install: gem update bundler
data/Appraisals ADDED
@@ -0,0 +1,15 @@
1
+ appraise "jekyll-3.3" do
2
+ gem "jekyll", "3.3.1"
3
+ end
4
+
5
+ appraise "jekyll-3.2" do
6
+ gem "jekyll", "3.2.1"
7
+ end
8
+
9
+ appraise "jekyll-3.1" do
10
+ gem "jekyll", "3.1.2"
11
+ end
12
+
13
+ appraise "jekyll-3" do
14
+ gem "jekyll", "3.0.3"
15
+ end
data/CHANGELOG.md ADDED
@@ -0,0 +1 @@
1
+ Changelog is maintained under [Github Releases](https://github.com/toshimaru/jekyll-tagging-related_posts/releases).
data/Gemfile CHANGED
@@ -1,9 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
-
5
- group :test do
6
- gem "codeclimate-test-reporter"
7
- gem "minitest"
8
- gem "minitest-reporters"
9
- end
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  Jekyll `related_posts` function based on tags (works on Jekyll3). It replaces original Jekyll's `related_posts` function to use tags to calculate relationships.
10
10
 
11
- The calculation algorithm is based on [LawrenceWoodman/related\_posts-jekyll\_plugin](https://github.com/LawrenceWoodman/related_posts-jekyll_plugin) by @LawrenceWoodman.
11
+ The calculation algorithm is based on [related\_posts-jekyll\_plugin](https://github.com/LawrenceWoodman/related_posts-jekyll_plugin) by [@LawrenceWoodman](https://github.com/LawrenceWoodman).
12
12
 
13
13
  ## Requirements
14
14
  * Ruby 2.x
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "jekyll", "3.1.2"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "jekyll", "3.2.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "jekyll", "3.3.1"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "jekyll", "3.0.3"
6
+
7
+ gemspec :path => "../"
@@ -19,9 +19,16 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
+ spec.required_ruby_version = ">= 2.0"
23
+
22
24
  spec.add_runtime_dependency "jekyll", "~> 3.0"
23
25
  spec.add_runtime_dependency "jekyll-tagging", "~> 1.0.0"
26
+
27
+ spec.add_development_dependency "appraisal"
24
28
  spec.add_development_dependency "bundler", "~> 1.10"
25
- spec.add_development_dependency "rake", "~> 10.0"
26
29
  spec.add_development_dependency "byebug"
30
+ spec.add_development_dependency "codeclimate-test-reporter", "~> 1.0"
31
+ spec.add_development_dependency "minitest-reporters"
32
+ spec.add_development_dependency "minitest"
33
+ spec.add_development_dependency "rake", "~> 10.0"
27
34
  end
@@ -1,9 +1,9 @@
1
+ # require `jekyll/document` first to overide `Jekyll::Document`
2
+ require "jekyll/document"
3
+
1
4
  require "jekyll/tagging/related_posts/version"
2
5
  require "jekyll/tagging/related_posts"
3
6
 
4
- # require `Jekyll::Document` first to overide
5
- require "jekyll/document"
6
-
7
7
  module Jekyll
8
8
  class Document
9
9
  include ::Jekyll::Tagging::RelatedPosts
@@ -12,6 +12,7 @@ module Jekyll
12
12
  # Returns [<Post>]
13
13
  def related_posts
14
14
  return [] unless docs.count > 1
15
+
15
16
  highest_freq = tag_freq.values.max
16
17
  related_scores = Hash.new(0)
17
18
 
@@ -33,7 +34,7 @@ module Jekyll
33
34
  # Returns {tag => freq, tag => freq, ...}
34
35
  def tag_freq
35
36
  @tag_freq ||= docs.inject(Hash.new(0)) do |tag_freq, doc|
36
- doc.data["tags"].each {|tag| tag_freq[tag] += 1 }
37
+ doc.data["tags"].each { |tag| tag_freq[tag] += 1 }
37
38
  tag_freq
38
39
  end
39
40
  end
@@ -49,7 +50,7 @@ module Jekyll
49
50
  else
50
51
  b[0].date <=> a[0].date
51
52
  end
52
- end.collect {|post, freq| post}
53
+ end.collect { |post, freq| post }
53
54
  end
54
55
 
55
56
  def docs
@@ -1,7 +1,7 @@
1
1
  module Jekyll
2
2
  module Tagging
3
3
  module RelatedPosts
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-tagging-related_posts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - toshimaru
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-28 00:00:00.000000000 Z
11
+ date: 2017-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.0.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: appraisal
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -53,21 +67,35 @@ dependencies:
53
67
  - !ruby/object:Gem::Version
54
68
  version: '1.10'
55
69
  - !ruby/object:Gem::Dependency
56
- name: rake
70
+ name: byebug
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: codeclimate-test-reporter
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
87
  - - "~>"
60
88
  - !ruby/object:Gem::Version
61
- version: '10.0'
89
+ version: '1.0'
62
90
  type: :development
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
94
  - - "~>"
67
95
  - !ruby/object:Gem::Version
68
- version: '10.0'
96
+ version: '1.0'
69
97
  - !ruby/object:Gem::Dependency
70
- name: byebug
98
+ name: minitest-reporters
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
101
  - - ">="
@@ -80,6 +108,34 @@ dependencies:
80
108
  - - ">="
81
109
  - !ruby/object:Gem::Version
82
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: minitest
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rake
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '10.0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '10.0'
83
139
  description: Jekyll `related_posts` function based on tags (works on Jekyll3). It
84
140
  replaces original Jekyll's `related_posts` function to use tags to calculate relationships.
85
141
  email:
@@ -90,12 +146,18 @@ extra_rdoc_files: []
90
146
  files:
91
147
  - ".gitignore"
92
148
  - ".travis.yml"
149
+ - Appraisals
150
+ - CHANGELOG.md
93
151
  - Gemfile
94
152
  - LICENSE.txt
95
153
  - README.md
96
154
  - Rakefile
97
155
  - bin/console
98
156
  - bin/setup
157
+ - gemfiles/jekyll_3.1.gemfile
158
+ - gemfiles/jekyll_3.2.gemfile
159
+ - gemfiles/jekyll_3.3.gemfile
160
+ - gemfiles/jekyll_3.gemfile
99
161
  - jekyll-tagging-related_posts.gemspec
100
162
  - lib/jekyll-tagging-related_posts.rb
101
163
  - lib/jekyll/tagging/related_posts.rb
@@ -112,7 +174,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
174
  requirements:
113
175
  - - ">="
114
176
  - !ruby/object:Gem::Version
115
- version: '0'
177
+ version: '2.0'
116
178
  required_rubygems_version: !ruby/object:Gem::Requirement
117
179
  requirements:
118
180
  - - ">="
@@ -120,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
182
  version: '0'
121
183
  requirements: []
122
184
  rubyforge_project:
123
- rubygems_version: 2.4.5
185
+ rubygems_version: 2.5.2
124
186
  signing_key:
125
187
  specification_version: 4
126
188
  summary: Jekyll `related_posts` function based on tags (works on Jekyll3)