gem-versioner 1.1.0 → 1.1.1

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
- SHA1:
3
- metadata.gz: d3be6b44f3068cc1d1023b4356e7472d12f38abf
4
- data.tar.gz: 423b75d2bedaa76e3583c1e14410a74c384165c8
2
+ SHA256:
3
+ metadata.gz: e84833ae36db6814f9c2bc3129038654b84df1a347b97382bf48e94a6a208def
4
+ data.tar.gz: 218646c36c2b1dd6d0438ad087fd537a6a9433e8ee35ba6c30bdf5146f6cd9d9
5
5
  SHA512:
6
- metadata.gz: 3e475213731a39ea7836f5d72e4c545582360daf6852979fc930d29626c2aa966102f2e5df921f4155bcde228748658d616fe2e04dce8735673c816b041f2d77
7
- data.tar.gz: 168e7b2082c44089ef9db17416c18123cba4f8f43cebf8c89618dadf1348794c0883bfb5ac24711f1c568bd134606be35267ec4aa9e5cf9d9593943a39ea643f
6
+ metadata.gz: 366a0a053ea9d81e580b4478d693705e82c721dfdd5c2dcaa3e20739d5b956e769d5259c52af67624ffe73891707849a4deded34fe71e5ab09887fb5bcc893fb
7
+ data.tar.gz: eb28ece1c127965eee6e359a68a8f244ac22c0c109f47351c4842ea4a8d90275513a26d95b08e5f5297b132a0c4fdf11aee319636c43f17058dc1617142368b3
@@ -0,0 +1,176 @@
1
+ version: 2.1
2
+ commands:
3
+ install-gems:
4
+ description: Steps to install Ruby gems
5
+ steps:
6
+ - run:
7
+ name: Install build packages
8
+ command: apk add --no-cache --no-progress build-base cmake curl-dev
9
+ - restore_cache:
10
+ keys:
11
+ - gem-versioner-{{ arch }}-{{ checksum "gem-versioner.gemspec" }}
12
+ - run:
13
+ name: Install Ruby dependencies
14
+ command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
15
+ - save_cache:
16
+ key: gem-versioner-{{ arch }}-{{ checksum "gem-versioner.gemspec" }}
17
+ paths:
18
+ - vendor/bundle
19
+ pronto:
20
+ description: Runs Pronto and its runners
21
+ steps:
22
+ - setup
23
+ - run:
24
+ name: Run Pronto over commit history
25
+ command: bundle exec pronto run --commit origin/master --exit-code
26
+ rubocop:
27
+ description: Runs RuboCop
28
+ steps:
29
+ - setup
30
+ - run:
31
+ name: Run RuboCop linter
32
+ command: bundle exec rubocop
33
+ setup:
34
+ description: Set up Ruby gems and required packages
35
+ steps:
36
+ - run:
37
+ name: Install git package
38
+ command: apk add --no-cache --no-progress git
39
+ - checkout
40
+ - install-gems
41
+ tests:
42
+ description: Build steps for running the test suite
43
+ steps:
44
+ - setup
45
+ - run:
46
+ name: Install Code Climate test reporter
47
+ command: |
48
+ wget -O ./cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
49
+ chmod +x ./cc-test-reporter
50
+ - run:
51
+ name: Run tests
52
+ command: |
53
+ ./cc-test-reporter before-build
54
+ bundle exec rspec --format documentation --color spec
55
+ ./cc-test-reporter after-build --exit-code $?
56
+ executors:
57
+ ruby:
58
+ parameters:
59
+ tag:
60
+ type: string
61
+ default: "latest"
62
+ docker:
63
+ - image: docker.io/library/ruby:<< parameters.tag >>
64
+ jobs:
65
+ pronto:
66
+ parameters:
67
+ image-tag:
68
+ type: string
69
+ default: "latest"
70
+ executor:
71
+ name: ruby
72
+ tag: << parameters.image-tag >>
73
+ steps:
74
+ - pronto
75
+ working_directory: ~/gem-versioner
76
+ rubocop:
77
+ parameters:
78
+ image-tag:
79
+ type: string
80
+ default: "latest"
81
+ executor:
82
+ name: ruby
83
+ tag: << parameters.image-tag >>
84
+ steps:
85
+ - rubocop
86
+ working_directory: ~/gem-versioner
87
+ tests:
88
+ parameters:
89
+ image-tag:
90
+ type: string
91
+ default: "latest"
92
+ executor:
93
+ name: ruby
94
+ tag: << parameters.image-tag >>
95
+ steps:
96
+ - tests
97
+ working_directory: ~/gem-versioner
98
+ publish-gem:
99
+ docker:
100
+ - image: docker.io/library/ruby:2.5-alpine
101
+ steps:
102
+ - checkout
103
+ - run:
104
+ name: Build gem
105
+ command: gem build $CIRCLE_PROJECT_REPONAME.gemspec
106
+ - run:
107
+ name: Configure RubyGems API key
108
+ command: |
109
+ echo :rubygems_api_key: "$RUBYGEMS_API_KEY" > ~/.gem/credentials
110
+ chmod 0600 ~/.gem/credentials
111
+ - deploy:
112
+ name: Push gem to RubyGems
113
+ command: gem push $CIRCLE_PROJECT_REPONAME-*.gem
114
+ working_directory: ~/gem-versioner
115
+ workflows:
116
+ multiple-ruby-versions:
117
+ jobs:
118
+ - pronto:
119
+ filters:
120
+ tags:
121
+ only: /.*/
122
+ image-tag: "2.6-alpine"
123
+ name: pronto
124
+ - rubocop:
125
+ filters:
126
+ tags:
127
+ only: /.*/
128
+ image-tag: "2.6-alpine"
129
+ name: rubocop
130
+ - tests:
131
+ filters:
132
+ tags:
133
+ only: /.*/
134
+ image-tag: "2.3-alpine"
135
+ name: tests-ruby23
136
+ requires:
137
+ - pronto
138
+ - rubocop
139
+ - tests:
140
+ filters:
141
+ tags:
142
+ only: /.*/
143
+ image-tag: "2.4-alpine"
144
+ name: tests-ruby24
145
+ requires:
146
+ - pronto
147
+ - rubocop
148
+ - tests:
149
+ filters:
150
+ tags:
151
+ only: /.*/
152
+ image-tag: "2.5-alpine"
153
+ name: tests-ruby25
154
+ requires:
155
+ - pronto
156
+ - rubocop
157
+ - tests:
158
+ filters:
159
+ tags:
160
+ only: /.*/
161
+ image-tag: "2.6-alpine"
162
+ name: tests-ruby26
163
+ requires:
164
+ - pronto
165
+ - rubocop
166
+ - publish-gem:
167
+ filters:
168
+ branches:
169
+ ignore: /.*/
170
+ tags:
171
+ only: /v[0-9]+(\.[0-9]+){1,2}$/
172
+ requires:
173
+ - tests-ruby23
174
+ - tests-ruby24
175
+ - tests-ruby25
176
+ - tests-ruby26
data/Gemfile CHANGED
@@ -1,14 +1,19 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  group :development, :test do
4
- gem 'rubocop', require: false
5
- gem 'pry'
6
6
  gem 'pronto', require: false
7
7
  gem 'pronto-brakeman', require: false
8
8
  gem 'pronto-fasterer', require: false
9
9
  gem 'pronto-rails_best_practices', require: false
10
10
  gem 'pronto-rails_schema', require: false
11
- gem 'pronto-rubocop', require: false
11
+ gem 'pry'
12
+ gem 'rubocop', require: false
13
+ end
14
+
15
+ group :test do
16
+ gem 'simplecov', require: false
12
17
  end
13
18
 
14
19
  gemspec
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2016, Funding Circle Ltd
1
+ Copyright (c) 2016, Funding Circle
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
data/README.md CHANGED
@@ -1,27 +1,29 @@
1
- [![Gem Version](https://badge.fury.io/rb/gem-versioner.svg)](https://badge.fury.io/rb/gem-versioner)
2
- [![Circle CI](https://circleci.com/gh/FundingCircle/gem-versioner/tree/master.svg?style=shield)](https://circleci.com/gh/FundingCircle/gem-versioner/tree/master)
3
-
4
1
  # Gem::Versioner
5
2
 
6
- Gem that works as an extension for the build task of a Gem to allow pre release versions
3
+ A plugin for RubyGems which lets you pass in version strings via a environment variable.
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/gem-versioner.svg)](https://badge.fury.io/rb/gem-versioner)
6
+ [![Circle CI](https://circleci.com/gh/FundingCircle/gem-versioner/tree/master.svg?style=shield)](https://circleci.com/gh/FundingCircle/gem-versioner/tree/master)
7
+ [![Maintainability](https://api.codeclimate.com/v1/badges/94f24a962f337d7f77df/maintainability)](https://codeclimate.com/github/FundingCircle/gem-versioner/maintainability)
8
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/94f24a962f337d7f77df/test_coverage)](https://codeclimate.com/github/FundingCircle/gem-versioner/test_coverage)
7
9
 
8
10
  ## Installation
9
11
 
10
- Install it yourself as:
12
+ Install it yourself:
11
13
 
12
14
  $ gem install gem-versioner
13
15
 
14
16
  ## Usage
15
17
 
16
- when you build a gem e.g. `my-gem`
17
- you can specify a pre release version by
18
+ When you build a gem (e.g. `my-gem`) you can specify a pre release version by
18
19
 
19
- $ PRE_RELEASE=foo build my-gem.gemspec
20
+ $ PRE_RELEASE=foo gem build my-gem.gemspec
20
21
 
21
22
  This will build a gem with a version in the following format `${gem_version}.pre.${PRE_RELEASE}.${current_timestamp}` , for example: `0.0.1.pre.foo.20160919174006`
22
23
 
23
24
  ## Publishing
24
- As soon as a new PR is merged to master CircleCI is responsible to publish the new version of the Gem to https://rubygems.org/
25
+
26
+ When a new version is tagged and pushed, CircleCI will build and publish the new version of the gem to https://rubygems.org/gems/gem-versioner.
25
27
 
26
28
  ## Development
27
29
 
@@ -34,7 +36,6 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/Fundin
34
36
 
35
37
  ## License
36
38
 
37
- Copyright © 2016 Funding Circle Ltd.
38
-
39
- Distributed under the BSD 3-Clause License.
39
+ Copyright © 2016 Funding Circle.
40
40
 
41
+ Distributed under the [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause).
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'gem/rubygems_plugin'
@@ -1,5 +1,6 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'rubygems/versioner/version'
5
6
 
@@ -9,13 +10,14 @@ Gem::Specification.new do |spec|
9
10
  spec.authors = 'Funding Circle Engineering'
10
11
  spec.email = 'engineering+gem-versioner@fundingcircle.com'
11
12
 
12
- spec.summary = 'Gem that works as an extension for the build task of a Gem to allow pre release versions'
13
+ spec.summary = 'A plugin for RubyGems which lets you pass in version strings via a environment variable.'
13
14
  spec.homepage = 'https://github.com/FundingCircle/gem-versioner'
14
- spec.license = 'BSD-3'
15
+ spec.license = 'BSD-3-Clause'
15
16
 
16
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
18
  # to allow pushing to a single host or delete this section to allow pushing to any host.
18
19
  raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' unless spec.respond_to?(:metadata)
20
+
19
21
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
20
22
 
21
23
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gem
2
4
  module Versioner
3
5
  def self.release_version(gem_version)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems/versioner'
2
4
  require 'rubygems/package'
3
5
 
@@ -7,9 +9,14 @@ module Gem
7
9
  class << self
8
10
  alias build_original build
9
11
 
10
- def build(spec, skip_validation = false)
12
+ def build(spec, skip_validation = false, strict_validation = false, file_name = nil)
11
13
  spec.version = Gem::Versioner.release_version(spec.version)
12
- build_original(spec, skip_validation)
14
+
15
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('3.0.0')
16
+ build_original(spec, skip_validation, strict_validation, file_name)
17
+ else
18
+ build_original(spec, skip_validation)
19
+ end
13
20
  end
14
21
  end
15
22
  end
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gem
2
4
  # keeps the version of the Versioner
3
5
  module Versioner
4
- VERSION = '1.1.0'.freeze
6
+ VERSION = '1.1.1'.freeze
5
7
  end
6
8
  end
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems/versioner/build_plugin'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-versioner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Funding Circle Engineering
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-20 00:00:00.000000000 Z
11
+ date: 2019-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,6 +58,7 @@ executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
60
60
  files:
61
+ - ".circleci/config.yml"
61
62
  - ".gitignore"
62
63
  - ".rspec"
63
64
  - ".rubocop.yml"
@@ -68,7 +69,6 @@ files:
68
69
  - Rakefile
69
70
  - bin/console
70
71
  - bin/setup
71
- - circle.yml
72
72
  - gem-versioner.gemspec
73
73
  - lib/rubygems/versioner.rb
74
74
  - lib/rubygems/versioner/build_plugin.rb
@@ -76,7 +76,7 @@ files:
76
76
  - lib/rubygems_plugin.rb
77
77
  homepage: https://github.com/FundingCircle/gem-versioner
78
78
  licenses:
79
- - BSD-3
79
+ - BSD-3-Clause
80
80
  metadata:
81
81
  allowed_push_host: https://rubygems.org
82
82
  post_install_message:
@@ -94,10 +94,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubyforge_project:
98
- rubygems_version: 2.4.5.1
97
+ rubygems_version: 3.0.2
99
98
  signing_key:
100
99
  specification_version: 4
101
- summary: Gem that works as an extension for the build task of a Gem to allow pre release
102
- versions
100
+ summary: A plugin for RubyGems which lets you pass in version strings via a environment
101
+ variable.
103
102
  test_files: []
data/circle.yml DELETED
@@ -1,12 +0,0 @@
1
- test:
2
- pre:
3
- - bundle exec rubocop
4
- - bundle exec pronto run --commit origin/master --exit-code
5
- deployment:
6
- rubygems:
7
- branch: master
8
- commands:
9
- - "gem build gem-versioner.gemspec"
10
- - 'echo :rubygems_api_key: ${RUBYGEMS_API_KEY} > ~/.gem/credentials'
11
- - "chmod 0600 ~/.gem/credentials"
12
- - "gem push gem-versioner-*.gem"