jekyll-theme-open-project-helpers 2.1.7 → 2.1.9

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
  SHA256:
3
- metadata.gz: e4a49b1b98f4b6a8903466391a01dd42cccc0a80d477614b24bafea89d7af97c
4
- data.tar.gz: ff35d3b2783bfa70cd8f72fb2336357a2f1e9a8d15ac48f958d5a1a15f4ac2eb
3
+ metadata.gz: 3b1d4e97d9aad4f03905d45ae68993220d23c8b52fa5bbf3be588c7ed9b11300
4
+ data.tar.gz: 496d9fdb62b4b2e7b44c59e2ab3b6b8142ec11ebd956b54b0423f487f78974ad
5
5
  SHA512:
6
- metadata.gz: 845c40b2a93ab03c99fff74050da48d099329a430625929e1630625be95c55b1321882ba120dbf5670b53b9769be41ad4d9a9c70ce19b24337af756d785fb9b8
7
- data.tar.gz: 715deb4ae224a58c8084f9eb8f538bc0217b7be91601c0a77b7f934dbf52fc8d5c58455c073bd281a1fc1c736783f469bbbe10df23b013af8b6ae99610388e54
6
+ metadata.gz: 4f6ddb7b29aad86b3d71fcff8a424a17b8a62971def177ae1dc99aa1ae2c9b7bc70efa8ca50782f2164d3061724993662442632e860bdd8d80485fc2ec041555
7
+ data.tar.gz: bed4fcefeafea0edd8517733d30ea90b507f7694a10ca2a8cda234255de2c534fde126841c5a1742d5f31d8d3bc31c3347a4792a5cd0cf1539ff7340f1e70249
@@ -0,0 +1,31 @@
1
+ name: rake
2
+
3
+ on:
4
+ push:
5
+ branches: [ master, main ]
6
+ tags: [ v* ]
7
+ pull_request:
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ rake:
12
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
13
+ runs-on: ${{ matrix.os }}
14
+ continue-on-error: ${{ matrix.experimental }}
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
19
+ os: [ ubuntu-latest ]
20
+ experimental: [ false ]
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ with:
24
+ submodules: true
25
+
26
+ - uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: ${{ matrix.ruby }}
29
+ bundler-cache: true
30
+
31
+ - run: bundle exec rake
@@ -0,0 +1,44 @@
1
+ name: release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ next_version:
7
+ description: |
8
+ Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
9
+ required: true
10
+ default: 'skip'
11
+ push:
12
+ tags: [ v* ]
13
+
14
+ jobs:
15
+ release:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+
20
+ - uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: '2.6'
23
+ bundler-cache: true
24
+
25
+ - run: gem install gem-release
26
+
27
+ - run: |
28
+ git config user.name github-actions
29
+ git config user.email github-actions@github.com
30
+
31
+ - if: github.event_name == 'workflow_dispatch' && github.event.inputs.next_version != 'skip'
32
+ run: gem bump --version ${{ github.event.inputs.next_version }} --tag --push
33
+
34
+ - name: publish to rubygems.org
35
+ env:
36
+ RUBYGEMS_API_KEY: ${{secrets.RIBOSE_RUBYGEMS_API_KEY}}
37
+ run: |
38
+ gem install gem-release
39
+ envsubst << 'EOF' > ~/.gem/credentials
40
+ ---
41
+ :rubygems_api_key: ${RUBYGEMS_API_KEY}
42
+ EOF
43
+ chmod 0600 ~/.gem/credentials
44
+ gem release
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ /Gemfile.lock
2
+ /.rubocop-https*
3
+ /.rspec_status
data/.rubocop.yml ADDED
@@ -0,0 +1,10 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ inherit_from:
4
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
5
+
6
+ # local repo-specific modifications
7
+ # ...
8
+
9
+ AllCops:
10
+ TargetRubyVersion: 2.5
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ Encoding.default_external = Encoding::UTF_8
2
+ Encoding.default_internal = Encoding::UTF_8
3
+
4
+ source "https://rubygems.org"
5
+
6
+ gemspec
data/README.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Open Project theme helpers
2
2
 
3
+ [![Build Status](https://github.com/riboseinc/jekyll-theme-open-project-helpers/actions/workflows/rake.yml/badge.svg)](https://github.com/riboseinc/jekyll-theme-open-project-helpers/actions/workflows/rake.yml)
4
+ [![Gem Version](https://img.shields.io/gem/v/jekyll-theme-open-project-helpers.svg)](https://rubygems.org/gems/jekyll-theme-open-project-helpers
5
+ )
6
+ [![Pull Requests](https://img.shields.io/github/issues-pr-raw/riboseinc/jekyll-theme-open-project-helpers.svg)](https://github.com/riboseinc/jekyll-theme-open-project-helpers/pulls)
7
+ [![Commits since latest](https://img.shields.io/github/commits-since/riboseinc/jekyll-theme-open-project-helpers/latest.svg)](https://github.com/riboseinc/jekyll-theme-open-project-helpers/releases)
8
+
9
+
3
10
  Jekyll plugin for the Open Project gem-based Jekyll theme by Ribose.
4
11
 
5
12
  It provides the data reading and page generation capabilities
@@ -11,17 +18,7 @@ fetching open project/software/specification data from their repos.
11
18
 
12
19
  ## Releasing
13
20
 
14
- **Release this helpers gem and theme gem in tandem with matching versions.**
15
- See [Theme gem docs](https://github.com/riboseinc/jekyll-theme-open-project) for more.
16
-
17
-
18
- 1. Inside .gemspec within this repo’s root, update main gem version to the one being released.
19
-
20
- 2. Make a commit for the new release (“chore: Release vX.X.X”).
21
-
22
- 3. Execute `./develop/release`. This does the following:
21
+ ### New approach
23
22
 
24
- * Builds new gem version
25
- * Pushes gem to rubygems.org
26
- * Creates new version tag in this repository
27
- * Pushes changes to GitHub
23
+ Do `git tag ${version-tag}` or, start release manually with the
24
+ [`release.yml` workflow](https://github.com/riboseinc/jekyll-theme-open-project-helpers/actions/workflows/release.yml)
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec]
@@ -1,22 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  Gem::Specification.new do |s|
4
- s.name = 'jekyll-theme-open-project-helpers'
5
- s.version = '2.1.7'
6
- s.authors = ['Ribose Inc.']
7
- s.email = ['open.source@ribose.com']
4
+ s.name = "jekyll-theme-open-project-helpers"
5
+ s.version = "2.1.9"
6
+ s.authors = ["Ribose Inc."]
7
+ s.email = ["open.source@ribose.com"]
8
8
 
9
- s.summary = 'Helpers for the Open Project Jekyll theme'
10
- s.homepage = 'https://github.com/riboseinc/jekyll-theme-open-project-helpers/'
11
- s.license = 'MIT'
9
+ s.summary = "Helpers for the Open Project Jekyll theme"
10
+ s.homepage = "https://github.com/riboseinc/jekyll-theme-open-project-helpers/"
11
+ s.license = "MIT"
12
12
 
13
- s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|spec|features)/!) }
13
+ s.files = `git ls-files -z`.split("\x0").reject do |f|
14
+ f.match(%r!^(test|spec|features)/!)
15
+ end
14
16
 
15
- s.add_runtime_dependency 'jekyll', '~> 4.0'
16
- s.add_runtime_dependency 'git', '~> 1.4'
17
- s.add_runtime_dependency 'fastimage', '~> 2.1.4'
18
- s.add_development_dependency 'rake', '~> 12.0'
19
- s.add_development_dependency 'rubocop', '~> 0.50'
17
+ s.required_ruby_version = ">= 2.5.0"
18
+
19
+ s.add_runtime_dependency "fastimage", "~> 2.1.4"
20
+ s.add_runtime_dependency "git", "~> 1.4"
21
+ s.add_runtime_dependency "jekyll", "~> 4.0"
22
+
23
+ s.add_development_dependency "rake", "~> 13.0"
24
+ s.add_development_dependency "rspec", "~> 3.0"
25
+ s.add_development_dependency "rspec-command", "~> 1.0"
26
+ s.add_development_dependency "rubocop", "~> 1.5.2"
20
27
 
21
28
  s.require_paths = ["lib"]
22
29
  end
@@ -260,7 +260,7 @@ module Jekyll
260
260
  git_dir = File.join(repo_path, '.git')
261
261
  git_info_dir = File.join(git_dir, 'info')
262
262
  git_sparse_checkout_file = File.join(git_dir, 'info', 'sparse-checkout')
263
- unless File.exists? git_dir
263
+ unless File.exist? git_dir
264
264
  newly_initialized = true
265
265
 
266
266
  repo = Git.init(repo_path)
@@ -1,92 +1,131 @@
1
- require 'fastimage'
1
+ require "fastimage"
2
2
 
3
3
  # Recursively go through given list of nav_items, including any nested items,
4
4
  # and return a flat array containing navigation items with path specified.
5
5
  def get_nav_items_with_path(nav_items)
6
6
  items_with_path = []
7
7
 
8
- for item in nav_items do
9
- if item['path']
8
+ nav_items.each do |item|
9
+ if item["path"]
10
10
  items_with_path.push(item)
11
11
  end
12
12
 
13
- if item['items']
14
- items_with_path.concat(get_nav_items_with_path(item['items']))
13
+ if item["items"]
14
+ items_with_path.concat(get_nav_items_with_path(item["items"]))
15
15
  end
16
16
  end
17
17
 
18
- return items_with_path
18
+ items_with_path
19
19
  end
20
20
 
21
- module Builder
21
+ def find_nav_items(diagram_nav_items, png_name_noext)
22
+ diagram_nav_items.select do |item|
23
+ item["path"].start_with?(png_name_noext)
24
+ end
25
+ end
22
26
 
27
+ module Builder
23
28
  class PngDiagramPage < Jekyll::Page
24
- def initialize(site, base, dir, data)
29
+ EXTRA_STYLESHEETS = [{
30
+ "href" => "https://unpkg.com/leaflet@1.3.4/dist/leaflet.css",
31
+ "integrity" => "sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA==", # rubocop:disable Layout/LineLength
32
+ "crossorigin" => "",
33
+ }].freeze
34
+
35
+ EXTRA_SCRIPTS = [{
36
+ "src" => "https://unpkg.com/leaflet@1.3.4/dist/leaflet.js",
37
+ "integrity" => "sha512-nMMmRyTVoLYqjP9hrbed9S+FzjZHW5gY1TWCHA5ckwXZBadntCNs8kEqAWdrb9O7rxbCaA4lKTIWjDXZxflOcA==", # rubocop:disable Layout/LineLength
38
+ "crossorigin" => "",
39
+ }].freeze
40
+
41
+ def initialize(site, base, dir, data) # rubocop:disable Lint/MissingSuper
25
42
  @site = site
26
43
  @base = base
27
44
  @dir = dir
28
- @name = 'index.html'
45
+ @name = "index.html"
29
46
 
30
- self.process(@name)
47
+ process(@name)
31
48
  self.data ||= data
32
49
 
33
- self.data['extra_stylesheets'] = [{
34
- "href" => "https://unpkg.com/leaflet@1.3.4/dist/leaflet.css",
35
- "integrity" => "sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA==",
36
- "crossorigin" => "",
37
- }]
50
+ self.data["extra_stylesheets"] = EXTRA_STYLESHEETS
51
+ self.data["extra_scripts"] = EXTRA_SCRIPTS
52
+ self.data["layout"] = "spec"
53
+ end
54
+ end
38
55
 
39
- self.data['extra_scripts'] = [{
40
- "src" => "https://unpkg.com/leaflet@1.3.4/dist/leaflet.js",
41
- "integrity" => "sha512-nMMmRyTVoLYqjP9hrbed9S+FzjZHW5gY1TWCHA5ckwXZBadntCNs8kEqAWdrb9O7rxbCaA4lKTIWjDXZxflOcA==",
42
- "crossorigin" => "",
43
- }]
56
+ def build_spec_pages(site, spec_info, source, dest, _opts)
57
+ nav_items = get_nav_items_with_path(
58
+ spec_info.data["navigation"]["items"],
59
+ )
44
60
 
45
- self.data['layout'] = 'spec'
61
+ pages, not_found_items = process_spec_images(site, source, nav_items,
62
+ dest, spec_info)
63
+
64
+ not_found_items.each do |item|
65
+ warn "SPECIFIED PNG NOT FOUND: #{item['title']}.png not found " \
66
+ "at source as specified at (#{dest})."
46
67
  end
68
+
69
+ pages
47
70
  end
48
71
 
49
- def build_spec_pages(site, spec_info, source, destination, opts)
50
- images_path = source
51
- spec_root = destination
52
- stub_path = "#{File.dirname(__FILE__)}/png_diagram.html"
72
+ def process_spec_images(site, source, nav_items, dest, spec_info)
53
73
  pages = []
74
+ not_found_items = nav_items.dup
54
75
 
55
- diagram_nav_items = get_nav_items_with_path(spec_info.data['navigation']['items'])
56
-
57
- Dir.glob("#{images_path}/*.png") do |pngfile|
76
+ Dir.glob("#{source}/*.png") do |pngfile|
58
77
  png_name = File.basename(pngfile)
59
78
  png_name_noext = File.basename(png_name, File.extname(png_name))
60
79
 
61
- nav_item = diagram_nav_items.select { |item|
62
- item['path'].start_with?(png_name_noext)
63
- } [0].clone
64
-
65
- png_dimensions = FastImage.size(pngfile)
66
- data = spec_info.data.clone
67
- data['image_path'] = "/#{spec_root}/images/#{png_name}"
68
- data['image_width'] = png_dimensions[0]
69
- data['image_height'] = png_dimensions[1]
80
+ nav_item = find_nav_items(nav_items, png_name_noext)[0].clone
70
81
 
71
82
  if nav_item == nil
72
- raise "Navigation item matching #{png_name} (#{spec_root}) was not found"
83
+ warn "UNUSED PNG: #{File.basename(pngfile)} detected at source " \
84
+ "without a corresponding navigation item at (#{dest})."
85
+ next
73
86
  end
74
87
 
75
- data = data.merge(nav_item)
88
+ not_found_items.delete_if { |item| item["title"] == nav_item["title"] }
76
89
 
77
- data['title'] = "#{spec_info['title']}: #{nav_item['title']}"
78
- data['article_header_title'] = "#{nav_item['title']}"
90
+ data = build_spec_page_data(pngfile, dest, png_name, nav_item,
91
+ spec_info)
79
92
 
80
- page = PngDiagramPage.new(
81
- site,
82
- site.source,
83
- File.join(spec_root, png_name_noext),
84
- data)
85
- page.content = File.read(stub_path)
86
- pages << page
93
+ pages << build_spec_page(site, dest, png_name_noext, data)
87
94
  end
88
95
 
89
- return pages
96
+ [pages, not_found_items]
90
97
  end
91
98
 
99
+ def build_spec_page(site, spec_root, png_name_noext, data)
100
+ page = PngDiagramPage.new(
101
+ site,
102
+ site.source,
103
+ File.join(spec_root, png_name_noext),
104
+ data,
105
+ )
106
+
107
+ stub_path = "#{File.dirname(__FILE__)}/png_diagram.html"
108
+ page.content = File.read(stub_path)
109
+
110
+ page
111
+ end
112
+
113
+ def build_spec_page_data(pngfile, spec_root, png_name, nav_item, spec_info)
114
+ data = fill_image_data(pngfile, spec_info, spec_root, png_name)
115
+ .merge(nav_item)
116
+
117
+ data["title"] = "#{spec_info['title']}: #{nav_item['title']}"
118
+ data["article_header_title"] = nav_item["title"].to_s
119
+
120
+ data
121
+ end
122
+
123
+ def fill_image_data(pngfile, spec_info, spec_root, png_name)
124
+ png_dimensions = FastImage.size(pngfile)
125
+ data = spec_info.data.clone
126
+ data["image_path"] = "/#{spec_root}/images/#{png_name}"
127
+ data["image_width"] = png_dimensions[0]
128
+ data["image_height"] = png_dimensions[1]
129
+ data
130
+ end
92
131
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-open-project-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.7
4
+ version: 2.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-08 00:00:00.000000000 Z
11
+ date: 2023-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: jekyll
14
+ name: fastimage
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: 2.1.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '4.0'
26
+ version: 2.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: git
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,57 +39,90 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.4'
41
41
  - !ruby/object:Gem::Dependency
42
- name: fastimage
42
+ name: jekyll
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.1.4
47
+ version: '4.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.1.4
54
+ version: '4.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '12.0'
61
+ version: '13.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: '12.0'
68
+ version: '13.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec-command
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: rubocop
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
101
  - - "~>"
74
102
  - !ruby/object:Gem::Version
75
- version: '0.50'
103
+ version: 1.5.2
76
104
  type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
108
  - - "~>"
81
109
  - !ruby/object:Gem::Version
82
- version: '0.50'
83
- description:
110
+ version: 1.5.2
111
+ description:
84
112
  email:
85
113
  - open.source@ribose.com
86
114
  executables: []
87
115
  extensions: []
88
116
  extra_rdoc_files: []
89
117
  files:
118
+ - ".github/workflows/rake.yml"
119
+ - ".github/workflows/release.yml"
120
+ - ".gitignore"
121
+ - ".rubocop.yml"
122
+ - Gemfile
90
123
  - LICENSE.txt
91
124
  - README.md
92
- - develop/release
125
+ - Rakefile
93
126
  - jekyll-theme-open-project-helpers.gemspec
94
127
  - lib/jekyll-theme-open-project-helpers.rb
95
128
  - lib/jekyll-theme-open-project-helpers/blog_index.rb
@@ -104,7 +137,7 @@ homepage: https://github.com/riboseinc/jekyll-theme-open-project-helpers/
104
137
  licenses:
105
138
  - MIT
106
139
  metadata: {}
107
- post_install_message:
140
+ post_install_message:
108
141
  rdoc_options: []
109
142
  require_paths:
110
143
  - lib
@@ -112,15 +145,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
145
  requirements:
113
146
  - - ">="
114
147
  - !ruby/object:Gem::Version
115
- version: '0'
148
+ version: 2.5.0
116
149
  required_rubygems_version: !ruby/object:Gem::Requirement
117
150
  requirements:
118
151
  - - ">="
119
152
  - !ruby/object:Gem::Version
120
153
  version: '0'
121
154
  requirements: []
122
- rubygems_version: 3.0.6
123
- signing_key:
155
+ rubygems_version: 3.0.3.1
156
+ signing_key:
124
157
  specification_version: 4
125
158
  summary: Helpers for the Open Project Jekyll theme
126
159
  test_files: []
data/develop/release DELETED
@@ -1,41 +0,0 @@
1
- #!/bin/sh
2
- # Tag and push a release.
3
-
4
- set -e
5
-
6
- # Make sure we're in the project root.
7
-
8
- cd $(dirname "$0")/..
9
-
10
- # Make sure the darn thing works? Meh.
11
- # bundle update
12
-
13
- # Build a new gem archive.
14
-
15
- rm -rf jekyll-theme-open-project-helpers-*.gem
16
- gem build -q jekyll-theme-open-project-helpers.gemspec
17
-
18
- # Make sure we're on the master branch.
19
-
20
- (git branch | grep -q 'master') || {
21
- echo "Only release from the master branch."
22
- exit 1
23
- }
24
-
25
- # Figure out what version we're releasing.
26
-
27
- tag=v`ls jekyll-theme-open-project-helpers-*.gem | sed 's/^jekyll-theme-open-project-helpers-\(.*\)\.gem$/\1/'`
28
-
29
- # Make sure we haven't released this version before.
30
-
31
- git fetch -t origin
32
-
33
- (git tag -l | grep -q "$tag") && {
34
- echo "Whoops, there's already a '${tag}' tag."
35
- exit 1
36
- }
37
-
38
- # Tag it and bag it.
39
-
40
- gem push jekyll-theme-open-project-helpers-*.gem && git tag "$tag" &&
41
- git push origin master && git push origin "$tag"