git_bumper 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/git_bumper/cli.rb +15 -2
- data/lib/git_bumper/cli_parser.rb +1 -1
- data/lib/git_bumper/version.rb +1 -1
- data/lib/git_bumper.rb +6 -2
- metadata +2 -12
- data/.gitignore +0 -9
- data/.rspec +0 -2
- data/.rubocop.yml +0 -1
- data/.travis.yml +0 -4
- data/CODE_OF_CONDUCT.md +0 -13
- data/Gemfile +0 -6
- data/Rakefile +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -7
- data/git_bumper.gemspec +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 242f97c1afcd0a3b35fdb21a3cdbe077aefb5348
|
4
|
+
data.tar.gz: 6a349f3457a478ed0c43a323e6579604e6ff7b63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ed798d97e37762dbf386d1caf574cf3017c040485e5826ed000263c5fab921d9f0c3fa8518dd24cabe20265f28ffa463ce9e9a0665e19cdcf05da9fbc85f3a1
|
7
|
+
data.tar.gz: fa64bac181c82fad8989a9ee35197025ae9d811a1c7cd97b80c33dec6767a76e528ea0ffd9a513f876a2e287ddcf82d1d35e21da88e343018c42fbe7245cc250
|
data/lib/git_bumper/cli.rb
CHANGED
@@ -2,16 +2,20 @@ module GitBumper
|
|
2
2
|
# This class receives a Hash of options parsed by CLIParser and executes the
|
3
3
|
# requested action.
|
4
4
|
class CLI
|
5
|
+
attr_reader :error_msg
|
6
|
+
|
5
7
|
# @param [Hash]
|
6
8
|
def initialize(options)
|
7
9
|
@options = options
|
10
|
+
@error = false
|
11
|
+
@error_msg = ''
|
8
12
|
end
|
9
13
|
|
10
14
|
def run
|
11
15
|
Git.fetch_tags
|
12
16
|
|
13
17
|
old_tag = greatest_tag
|
14
|
-
|
18
|
+
return error('No tags found.') unless old_tag
|
15
19
|
|
16
20
|
new_tag = old_tag.clone
|
17
21
|
new_tag.increment(@options.fetch(:increment))
|
@@ -20,14 +24,23 @@ module GitBumper
|
|
20
24
|
puts "The new tag will be #{new_tag}"
|
21
25
|
puts 'Push to origin? (y/N)'
|
22
26
|
|
23
|
-
|
27
|
+
return error('Aborted.') unless prompt_yes
|
24
28
|
|
25
29
|
Git.create_tag(new_tag)
|
26
30
|
Git.push_tag(new_tag)
|
27
31
|
end
|
28
32
|
|
33
|
+
def error?
|
34
|
+
@error
|
35
|
+
end
|
36
|
+
|
29
37
|
private
|
30
38
|
|
39
|
+
def error(msg)
|
40
|
+
@error = true
|
41
|
+
@error_msg = msg
|
42
|
+
end
|
43
|
+
|
31
44
|
def prompt_yes
|
32
45
|
STDIN.gets.chomp.to_s =~ /y(es)?/i
|
33
46
|
end
|
data/lib/git_bumper/version.rb
CHANGED
data/lib/git_bumper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_bumper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lenon Marcel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -60,19 +60,9 @@ executables:
|
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
-
- ".gitignore"
|
64
|
-
- ".rspec"
|
65
|
-
- ".rubocop.yml"
|
66
|
-
- ".travis.yml"
|
67
|
-
- CODE_OF_CONDUCT.md
|
68
|
-
- Gemfile
|
69
63
|
- LICENSE.txt
|
70
64
|
- README.md
|
71
|
-
- Rakefile
|
72
|
-
- bin/console
|
73
65
|
- bin/git-bump
|
74
|
-
- bin/setup
|
75
|
-
- git_bumper.gemspec
|
76
66
|
- lib/git_bumper.rb
|
77
67
|
- lib/git_bumper/build_tag.rb
|
78
68
|
- lib/git_bumper/cli.rb
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require: rubocop-rspec
|
data/.travis.yml
DELETED
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# Contributor Code of Conduct
|
2
|
-
|
3
|
-
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
-
|
5
|
-
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
-
|
7
|
-
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
-
|
9
|
-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
-
|
11
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
-
|
13
|
-
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
DELETED
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
require 'git_bumper'
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require 'irb'
|
14
|
-
IRB.start
|
data/bin/setup
DELETED
data/git_bumper.gemspec
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'git_bumper/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'git_bumper'
|
8
|
-
spec.version = GitBumper::VERSION
|
9
|
-
spec.authors = ['Lenon Marcel']
|
10
|
-
spec.email = ['lenon.marcel@gmail.com']
|
11
|
-
|
12
|
-
spec.summary = 'A CLI utility to bump git tags.'
|
13
|
-
spec.description = 'A CLI utility to bump git tags.'
|
14
|
-
spec.homepage = 'https://github.com/lenon/git_bumper'
|
15
|
-
spec.license = 'MIT'
|
16
|
-
|
17
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
-
spec.executables = ['git-bump']
|
19
|
-
spec.require_paths = ['lib']
|
20
|
-
|
21
|
-
spec.add_development_dependency 'bundler', '~> 1.10'
|
22
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
23
|
-
spec.add_development_dependency 'rspec'
|
24
|
-
end
|