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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53c4246187b1561c23ad5a84960dfa3de968b5f2
4
- data.tar.gz: 37406211a96ff040d547c51485342ac4595b5634
3
+ metadata.gz: db1cf2137012772d72050fc4d52ba9c2f8d8aef8
4
+ data.tar.gz: 232edbd0fbbdde7897ce25ff3bbf2f45e6fee88b
5
5
  SHA512:
6
- metadata.gz: fc1ad04545c79f3e4528f6b254dfba6bf54c9835bd24931de6f8b4ae36e3b265123f14999d72771e7d189866ed0c0f0b1db708be1206d66b0b788775721eb65c
7
- data.tar.gz: b9ebba4412af3ad1b1fecc780aa93541ab5b9e3b329a992963b063d9292526e8d09151c387ec032a3f0d153146c533a344cf5c3759498e3d70843e4293f1095a
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
@@ -3,7 +3,6 @@
3
3
 
4
4
  type: Git
5
5
  bump_segment: minor
6
- environment: development
7
6
  prereleases:
8
7
  - alpha
9
8
  - beta
data/Gemfile CHANGED
@@ -4,6 +4,8 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :test do
7
- gem "simplecov"
8
- gem "codeclimate-test-reporter", "~> 1.0.0"
7
+ if RUBY_VERSION > '2'
8
+ gem "simplecov"
9
+ gem "codeclimate-test-reporter", "~> 1.0.0"
10
+ end
9
11
  end
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 production, or --env environment'],
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 (.versioneer.yml)') do |v|
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', 'Environment (production)') do |v|
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
- load 'versioneer/runtime_error.rb'
2
- load 'versioneer/invalid_repo_error.rb'
3
- load 'versioneer/missing_config_error.rb'
4
- load 'versioneer/repo.rb'
5
- load 'versioneer/config.rb'
6
- load 'versioneer/bypass.rb'
7
- load 'versioneer/git.rb'
8
- load 'versioneer/gem_version.rb'
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
@@ -1,4 +1,4 @@
1
- require_relative 'helpers'
1
+ require File.dirname(File.expand_path(__FILE__)) + '/helpers'
2
2
 
3
3
  module Versioneer
4
4
  class Bypass < Repo
@@ -1,6 +1,6 @@
1
- require_relative 'helpers'
2
- require_relative 'runtime_error'
3
- require_relative 'missing_config_error'
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 Dir.exist?(base_dir_or_config_file)
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(repo_options.to_h).merge(params.to_h)
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: version)
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."
@@ -1,4 +1,4 @@
1
- require_relative 'helpers'
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 Dir.exist?(File.join(file_within_repo, '.git'))
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
@@ -26,22 +26,22 @@ module Versioneer
26
26
 
27
27
  def cl_no_stdout
28
28
  {
29
- unix: '>/dev/null',
30
- windows: '>nul'
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: '2>/dev/null',
37
- windows: '2>nul'
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: '>/dev/null 2>&1',
44
- windows: '>nul 2>&1'
43
+ :unix => '>/dev/null 2>&1',
44
+ :windows => '>nul 2>&1'
45
45
  }.fetch(platform)
46
46
  end
47
47
 
@@ -1,4 +1,4 @@
1
- require_relative 'runtime_error'
1
+ require File.dirname(File.expand_path(__FILE__)) + '/runtime_error'
2
2
 
3
3
  module Versioneer
4
4
  class InvalidRepoError < RuntimeError
@@ -1,4 +1,4 @@
1
- require_relative 'runtime_error'
1
+ require File.dirname(File.expand_path(__FILE__)) + '/runtime_error'
2
2
 
3
3
  module Versioneer
4
4
  class MissingConfigError < RuntimeError
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', '~> 10.0'
26
- spec.add_development_dependency 'minitest', '~> 5.0'
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.0
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-02 00:00:00.000000000 Z
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: '10.0'
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: '10.0'
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: