algoliasearch-jekyll 0.4.2 → 0.4.3

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: 958dac73432790cf98b7d3e94fcbedc3be399b5e
4
- data.tar.gz: 0d31b043d45af8e0a6760c51832bf7c2a77a3c58
3
+ metadata.gz: bf63cc151be2bbb9c5dea8881f110703cc5ab95f
4
+ data.tar.gz: 9cdd47f72d3446b48df5492b1a68f405e7607ffb
5
5
  SHA512:
6
- metadata.gz: 9c8b32b5c817cb4c40c731442fb26dda3beec23e51ac95d4c745d8445bbb70ffef2215873404d739a705267dfb5e47fecd7a65104a617132b3b1577a8fcb3c62
7
- data.tar.gz: 3952045733b2e53c41a3321f2a4bf7332e9d6eed481a2073854c254f54df0bb0f11fc92c5c50d51a05ad59412cc38fe55087bab3043475f8f526688156faadc1
6
+ metadata.gz: 01fc966406a3e1f7866e7dd045182cd0c343b44f0f64201026b13401fb0544a992f3202c9504481f44eca7ce4f20b517f9afc4e34c5e6662f2f8561ffa98765f
7
+ data.tar.gz: b92a131ce8b29c1b691669f01881d9853446cdc103dffa88fc6c777eb568a363b951d5b4cafc4b49187df0a8c24a9a3f6ec2d7f6a6b7faf8929ff2f1133bbf04
data/Rakefile CHANGED
@@ -12,10 +12,12 @@ end
12
12
  require 'rake'
13
13
 
14
14
  require 'jeweler'
15
+ require_relative 'lib/version'
15
16
  Jeweler::Tasks.new do |gem|
16
17
  # gem is a Gem::Specification... see
17
18
  # http://guides.rubygems.org/specification-reference/ for more options
18
19
  gem.name = 'algoliasearch-jekyll'
20
+ gem.version = AlgoliaSearchJekyllVersion.to_s
19
21
  gem.homepage = 'https://github.com/algolia/algoliasearch-jekyll'
20
22
  gem.license = 'MIT'
21
23
  gem.summary = 'AlgoliaSearch for Jekyll'
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: algoliasearch-jekyll 0.4.2 ruby lib
5
+ # stub: algoliasearch-jekyll 0.4.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "algoliasearch-jekyll"
9
- s.version = "0.4.2"
9
+ s.version = "0.4.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Tim Carry"]
14
- s.date = "2015-07-28"
14
+ s.date = "2015-07-29"
15
15
  s.description = "Index all your pages and posts to an Algolia index with `jekyll algolia push`"
16
16
  s.email = "tim@pixelastic.com"
17
17
  s.extra_rdoc_files = [
@@ -28,12 +28,12 @@ Gem::Specification.new do |s|
28
28
  "LICENSE.txt",
29
29
  "README.md",
30
30
  "Rakefile",
31
- "VERSION",
32
31
  "algoliasearch-jekyll.gemspec",
33
32
  "lib/algoliasearch-jekyll.rb",
34
33
  "lib/credential_checker.rb",
35
34
  "lib/push.rb",
36
35
  "lib/record_extractor.rb",
36
+ "lib/version.rb",
37
37
  "scripts/check_flay",
38
38
  "scripts/check_flog",
39
39
  "scripts/git_hooks/pre-commit",
@@ -70,7 +70,6 @@ Gem::Specification.new do |s|
70
70
  "spec/spec_helper.rb",
71
71
  "spec/spec_helper_jekyll.rb",
72
72
  "spec/spec_helper_simplecov.rb",
73
- "todo",
74
73
  "txt/api_key_missing",
75
74
  "txt/application_id_missing",
76
75
  "txt/index_name_missing"
@@ -3,7 +3,8 @@ require 'bundler/setup'
3
3
 
4
4
  require 'awesome_print'
5
5
 
6
- require_relative './push.rb'
6
+ require_relative './version'
7
+ require_relative './push'
7
8
 
8
9
  # `jekyll algolia` main entry
9
10
  class AlgoliaSearchJekyll < Jekyll::Command
data/lib/push.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  require 'algoliasearch'
2
2
  require 'nokogiri'
3
3
  require 'json'
4
- require_relative './record_extractor.rb'
5
- require_relative './credential_checker.rb'
4
+ require_relative './version'
5
+ require_relative './record_extractor'
6
+ require_relative './credential_checker'
6
7
 
7
8
  # `jekyll algolia push` command
8
9
  class AlgoliaSearchJekyllPush < Jekyll::Command
@@ -126,7 +127,7 @@ class AlgoliaSearchJekyllPush < Jekyll::Command
126
127
 
127
128
  # Change the User-Agent header to isolate calls from this plugin
128
129
  def set_user_agent_header
129
- version = Gem::Specification.load('algoliasearch-jekyll.gemspec').version
130
+ version = AlgoliaSearchJekyllVersion.to_s
130
131
  Algolia.set_extra_header('User-Agent', "Algolia for Jekyll #{version}")
131
132
  end
132
133
 
data/lib/version.rb ADDED
@@ -0,0 +1,11 @@
1
+ # Expose gem version
2
+ class AlgoliaSearchJekyllVersion
3
+ MAJOR = 0
4
+ MINOR = 4
5
+ PATCH = 3
6
+ BUILD = nil
7
+
8
+ def self.to_s
9
+ [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
10
+ end
11
+ end
data/spec/push_spec.rb CHANGED
@@ -185,12 +185,13 @@ describe(AlgoliaSearchJekyllPush) do
185
185
  end
186
186
 
187
187
  describe 'set_user_agent_header' do
188
+ before(:each) do
189
+ allow(Algolia).to receive(:set_extra_header)
190
+ end
191
+
188
192
  it 'should set a User-Agent with the plugin name and version' do
189
193
  # Given
190
- expected = '48.1516.2342'
191
- spec = Gem::Specification.load('algoliasearch-jekyll.gemspec')
192
- spec.version = expected
193
- allow(Algolia).to receive(:set_extra_header)
194
+ allow(AlgoliaSearchJekyllVersion).to receive(:to_s).and_return '99.42'
194
195
 
195
196
  # When
196
197
  push.set_user_agent_header
@@ -198,11 +199,7 @@ describe(AlgoliaSearchJekyllPush) do
198
199
  # Then
199
200
  expect(Algolia).to have_received(:set_extra_header).with(
200
201
  'User-Agent',
201
- /Jekyll/
202
- )
203
- expect(Algolia).to have_received(:set_extra_header).with(
204
- 'User-Agent',
205
- /#{expected}/
202
+ /Jekyll(.*)99.42/
206
203
  )
207
204
  end
208
205
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Carry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-28 00:00:00.000000000 Z
11
+ date: 2015-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: algoliasearch
@@ -210,12 +210,12 @@ files:
210
210
  - LICENSE.txt
211
211
  - README.md
212
212
  - Rakefile
213
- - VERSION
214
213
  - algoliasearch-jekyll.gemspec
215
214
  - lib/algoliasearch-jekyll.rb
216
215
  - lib/credential_checker.rb
217
216
  - lib/push.rb
218
217
  - lib/record_extractor.rb
218
+ - lib/version.rb
219
219
  - scripts/check_flay
220
220
  - scripts/check_flog
221
221
  - scripts/git_hooks/pre-commit
@@ -252,7 +252,6 @@ files:
252
252
  - spec/spec_helper.rb
253
253
  - spec/spec_helper_jekyll.rb
254
254
  - spec/spec_helper_simplecov.rb
255
- - todo
256
255
  - txt/api_key_missing
257
256
  - txt/application_id_missing
258
257
  - txt/index_name_missing
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.4.2
data/todo DELETED
@@ -1,2 +0,0 @@
1
- Add User-Agent when indexing
2
-