versioneer 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -1
- data/.versioneer.yml +0 -1
- data/Gemfile +4 -2
- data/README.md +1 -1
- data/bin/versioneer +4 -7
- data/lib/versioneer.rb +12 -8
- data/lib/versioneer/bypass.rb +1 -1
- data/lib/versioneer/config.rb +7 -6
- data/lib/versioneer/git.rb +2 -2
- data/lib/versioneer/helpers.rb +6 -6
- data/lib/versioneer/invalid_repo_error.rb +1 -1
- data/lib/versioneer/missing_config_error.rb +1 -1
- data/versioneer.gemspec +2 -3
- metadata +8 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db1cf2137012772d72050fc4d52ba9c2f8d8aef8
|
4
|
+
data.tar.gz: 232edbd0fbbdde7897ce25ff3bbf2f45e6fee88b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6b50c09098f98afdab48d376a669e76210efe28397cb44af17ee8a9212574a3fc0b13081bbb0b7a1b764d5705fe233035d86c51b3aae9c900389f65d4ced652
|
7
|
+
data.tar.gz: 9f7ea747337ff8e2c90ea786c5d8336ecea9a6ee753a32ed6b8b1b132c4ce61ef28c4a84f6079725e1b3a8ce750bfe05cb6e5201b6da78f5998479b6d4410a85
|
data/.travis.yml
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
sudo: false
|
2
|
+
matrix:
|
3
|
+
fast_finish: true
|
2
4
|
language: ruby
|
3
5
|
rvm:
|
4
6
|
- 2.3.1
|
7
|
+
- 1.9.2
|
8
|
+
- 1.8.7
|
5
9
|
before_install:
|
6
10
|
- gem update bundler
|
7
11
|
after_success:
|
8
|
-
- bundle exec codeclimate-test-reporter
|
12
|
+
- ruby -e 'exit RUBY_VERSION > "2"' && bundle exec codeclimate-test-reporter
|
13
|
+
notifications:
|
14
|
+
email: false
|
data/.versioneer.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,7 @@ __Dynamic project versioning (alpha/beta/rc) from commits since last Git Tag.__
|
|
10
10
|
|
11
11
|
Versioneer **determines a project's version** from the latest source-control tag, then **adjusts automatically** by adding/bumping prereleases based on changes made since the last tagged release.
|
12
12
|
|
13
|
-
Integration tested on **UNIX/macOS and Windows**.
|
13
|
+
Integration tested on **UNIX/macOS and Windows**. Matrix testing for **Ruby** ` 1.8` — `2.3`
|
14
14
|
|
15
15
|
## Overview
|
16
16
|
|
data/bin/versioneer
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require 'bundler/setup'
|
4
3
|
require 'optparse'
|
5
4
|
require 'versioneer'
|
6
5
|
|
7
6
|
cli_opts = {}
|
8
|
-
repo_opts = {
|
9
|
-
environment: 'production'
|
10
|
-
}
|
7
|
+
repo_opts = {}
|
11
8
|
|
12
9
|
opparser = OptionParser.new do |opts|
|
13
10
|
opts.banner = [
|
@@ -17,7 +14,7 @@ opparser = OptionParser.new do |opts|
|
|
17
14
|
'-------------------------------------',
|
18
15
|
' Actions',
|
19
16
|
' %-33s%s' % ['status', 'Report on versions for all environments (default action)'],
|
20
|
-
' %-33s%s' % ['print', 'Print version number for
|
17
|
+
' %-33s%s' % ['print', 'Print version number for current environment'],
|
21
18
|
' %-33s%s' % ['init', 'Generate default configuration file'],
|
22
19
|
' %-33s%s' % ['lock', 'Lock (save) current version (for deployments without VCS repo)'],
|
23
20
|
' %-33s%s' % ['unlock', 'Unlock (discard) previously saved version'],
|
@@ -27,10 +24,10 @@ opparser = OptionParser.new do |opts|
|
|
27
24
|
'',
|
28
25
|
' Options',
|
29
26
|
].join("\n")
|
30
|
-
opts.on('-c FILE', '--config=FILE', 'Config file
|
27
|
+
opts.on('-c FILE', '--config=FILE', 'Config file, default: .versioneer.yml') do |v|
|
31
28
|
cli_opts[:config] = v
|
32
29
|
end
|
33
|
-
opts.on('-e ENVIRONMENT', '--env=ENVIRONMENT', '
|
30
|
+
opts.on('-e ENVIRONMENT', '--env=ENVIRONMENT', '(development|production) ... overrides system vars, see guide') do |v|
|
34
31
|
repo_opts[:environment] = v
|
35
32
|
end
|
36
33
|
opts.on('-q', '--quiet', 'Silence action output') do |v|
|
data/lib/versioneer.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
%w{
|
2
|
+
runtime_error
|
3
|
+
invalid_repo_error
|
4
|
+
missing_config_error
|
5
|
+
repo
|
6
|
+
config
|
7
|
+
bypass
|
8
|
+
git
|
9
|
+
gem_version
|
10
|
+
}.each do |f|
|
11
|
+
load "#{File.dirname(File.expand_path(__FILE__))}/versioneer/#{f}.rb"
|
12
|
+
end
|
9
13
|
|
10
14
|
module Versioneer
|
11
15
|
end
|
data/lib/versioneer/bypass.rb
CHANGED
data/lib/versioneer/config.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
require File.dirname(File.expand_path(__FILE__)) + '/helpers'
|
2
|
+
require File.dirname(File.expand_path(__FILE__)) + '/runtime_error'
|
3
|
+
require File.dirname(File.expand_path(__FILE__)) + '/missing_config_error'
|
4
4
|
require 'yaml'
|
5
5
|
|
6
6
|
module Versioneer
|
@@ -11,8 +11,9 @@ module Versioneer
|
|
11
11
|
|
12
12
|
def initialize(base_dir_or_config_file, repo_options=nil)
|
13
13
|
base_dir_or_config_file = base_dir_or_config_file.to_s
|
14
|
+
repo_options = Hash.new unless repo_options.is_a? Hash
|
14
15
|
|
15
|
-
if
|
16
|
+
if File.directory?(base_dir_or_config_file)
|
16
17
|
@config_base = base_dir_or_config_file
|
17
18
|
@config_file = File.join(base_dir_or_config_file, DEFAULT_FILE)
|
18
19
|
unless File.exist?(@config_file)
|
@@ -32,7 +33,7 @@ module Versioneer
|
|
32
33
|
@lock_file = File.join(@config_base, params.delete(:lock_file) || DEFAULT_LOCK)
|
33
34
|
@repo = nil
|
34
35
|
@repo_type = (params.delete(:type) || DEFAULT_TYPE).capitalize.to_sym
|
35
|
-
@repo_options = Hash.new().merge(
|
36
|
+
@repo_options = Hash.new().merge(params).merge(repo_options)
|
36
37
|
end
|
37
38
|
|
38
39
|
attr_reader :config_file, :lock_file
|
@@ -41,7 +42,7 @@ module Versioneer
|
|
41
42
|
return @repo unless @repo.nil?
|
42
43
|
@repo = case locked?
|
43
44
|
when true
|
44
|
-
Bypass.new(@config_base, release
|
45
|
+
Bypass.new(@config_base, :release => version)
|
45
46
|
else
|
46
47
|
unless ::Versioneer.const_defined? @repo_type
|
47
48
|
raise RuntimeError, "Versioneer::#{@repo_type} is an unknown VCS type."
|
data/lib/versioneer/git.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require File.dirname(File.expand_path(__FILE__)) + '/helpers'
|
2
2
|
|
3
3
|
module Versioneer
|
4
4
|
class Git < Repo
|
@@ -6,7 +6,7 @@ module Versioneer
|
|
6
6
|
|
7
7
|
def initialize(file_within_repo, options=nil)
|
8
8
|
super
|
9
|
-
unless
|
9
|
+
unless File.directory?(File.join(file_within_repo, '.git'))
|
10
10
|
unless H.lines? `git ls-files #{file_within_repo} --error-unmatch #{H.cl_no_stderr}`
|
11
11
|
raise InvalidRepoError, "Not inside a Git repo. (#{file_within_repo})"
|
12
12
|
end
|
data/lib/versioneer/helpers.rb
CHANGED
@@ -26,22 +26,22 @@ module Versioneer
|
|
26
26
|
|
27
27
|
def cl_no_stdout
|
28
28
|
{
|
29
|
-
unix
|
30
|
-
windows
|
29
|
+
:unix => '>/dev/null',
|
30
|
+
:windows => '>nul'
|
31
31
|
}.fetch(platform)
|
32
32
|
end
|
33
33
|
|
34
34
|
def cl_no_stderr
|
35
35
|
{
|
36
|
-
unix
|
37
|
-
windows
|
36
|
+
:unix => '2>/dev/null',
|
37
|
+
:windows => '2>nul'
|
38
38
|
}.fetch(platform)
|
39
39
|
end
|
40
40
|
|
41
41
|
def cl_silence
|
42
42
|
{
|
43
|
-
unix
|
44
|
-
windows
|
43
|
+
:unix => '>/dev/null 2>&1',
|
44
|
+
:windows => '>nul 2>&1'
|
45
45
|
}.fetch(platform)
|
46
46
|
end
|
47
47
|
|
data/versioneer.gemspec
CHANGED
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.13'
|
25
|
-
spec.add_development_dependency 'rake'
|
26
|
-
spec.add_development_dependency 'minitest'
|
27
|
-
spec.add_development_dependency 'pry', '~> 0'
|
25
|
+
spec.add_development_dependency 'rake'
|
26
|
+
spec.add_development_dependency 'minitest'
|
28
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: versioneer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BinaryBabel OSS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,42 +28,28 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '5.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '5.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: pry
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
45
|
+
- - ">="
|
60
46
|
- !ruby/object:Gem::Version
|
61
47
|
version: '0'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - "
|
52
|
+
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: '0'
|
69
55
|
description:
|