algoliasearch-jekyll 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 988cac4f048353fd0b0b65f9598025a6a485a10e
4
- data.tar.gz: 3294a5aa8c00fbd16ba894d37164046ef785b594
3
+ metadata.gz: 070750a5b303f2b76e2b770acbd21c02f77a304e
4
+ data.tar.gz: 128b7107d03baee293780d9cd53ca1890ecdb143
5
5
  SHA512:
6
- metadata.gz: abf5b3df4f3eaa6dba8773179887b0e261a0bd3ee2eed293861efc3d005ccc88566fedbef124e4b859000dab67439021d1b73a075dc505cc2e4c689e11ee59a7
7
- data.tar.gz: d7f1b31dfcb09e4510f4c36d68f65989e62b5c45f51a301ee18745196bc83fc2802db287e8b434d66f4c7d5b8cade3ac266715027f30553d4865347f50b9a8a0
6
+ metadata.gz: 6e730a8bbc0814c2f8b37d746c57ec391f91f2be32402039ccd6dc47b0b7bdb94b3731c2e08ce3df0707c3b194b414afffc2d6fd70e0f56793c2f68b9081b5bc
7
+ data.tar.gz: 0bccada9786e7e7c1a2a4878b6e2ee28458a28db3a47d21208cb811c1f1036b79cd1ebd29e4c82409284b89dc6b6ff56f665b2f08105aa86ac1676795bebab85
@@ -2,11 +2,11 @@
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.5.1 ruby lib
5
+ # stub: algoliasearch-jekyll 0.5.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "algoliasearch-jekyll"
9
- s.version = "0.5.1"
9
+ s.version = "0.5.2"
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"]
@@ -36,6 +36,7 @@ Gem::Specification.new do |s|
36
36
  "lib/push.rb",
37
37
  "lib/record_extractor.rb",
38
38
  "lib/version.rb",
39
+ "scripts/bump_version",
39
40
  "scripts/check_flay",
40
41
  "scripts/check_flog",
41
42
  "scripts/git_hooks/pre-commit",
data/lib/version.rb CHANGED
@@ -1,11 +1,6 @@
1
1
  # Expose gem version
2
2
  class AlgoliaSearchJekyllVersion
3
- MAJOR = 0
4
- MINOR = 5
5
- PATCH = 1
6
- BUILD = nil
7
-
8
3
  def self.to_s
9
- [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
4
+ '0.5.2'
10
5
  end
11
6
  end
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../lib/version.rb'
3
+
4
+ class BumpVersion
5
+ def initialize(*args)
6
+ @type = args[0]
7
+ if !valid_type?(@type)
8
+ puts "Invalid bump type: #{@type}"
9
+ exit 1
10
+ end
11
+ end
12
+
13
+ def valid_type?(type)
14
+ %w(major minor patch).include?(type)
15
+ end
16
+
17
+ def bump(current_version, type)
18
+ major, minor, patch = current_version.split('.').map(&:to_i)
19
+ if type == 'major'
20
+ major += 1
21
+ minor = 0
22
+ patch = 0
23
+ end
24
+ if type == 'minor'
25
+ minor += 1
26
+ patch = 0
27
+ end
28
+ patch += 1 if type == 'patch'
29
+ "#{major}.#{minor}.#{patch}"
30
+ end
31
+
32
+ def run
33
+ old_version = AlgoliaSearchJekyllVersion.to_s
34
+ new_version = bump(old_version, @type)
35
+
36
+ script_dir = File.expand_path(File.dirname(__FILE__))
37
+ file = File.join(script_dir, '../lib/version.rb')
38
+ old_content = File.read(file)
39
+ new_content = old_content.gsub(old_version, new_version)
40
+ File.write(file, new_content)
41
+
42
+ `git add #{file}`
43
+ `git commit -m "chore(bump): Version bump to #{new_version}"`
44
+ end
45
+
46
+ end
47
+ BumpVersion.new(*ARGV).run
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Carry
@@ -218,6 +218,7 @@ files:
218
218
  - lib/push.rb
219
219
  - lib/record_extractor.rb
220
220
  - lib/version.rb
221
+ - scripts/bump_version
221
222
  - scripts/check_flay
222
223
  - scripts/check_flog
223
224
  - scripts/git_hooks/pre-commit