incr 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +4 -2
- data/bin/incr +5 -2
- data/lib/incr/command/mix.rb +4 -2
- data/lib/incr/command/npm.rb +4 -2
- data/lib/incr/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c4896689095379204d0697a39423ce3c15b87f4920164314bc86c2121f22154b
|
4
|
+
data.tar.gz: 9f008d7fbf98ff81278ba1cb4851fee1cdea1327890428e234a85c3487c983c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 426b80a1277e931264e19c8305d92e6a04a2615ff5f20152a0ffac3ffe1ea67dbff34adabc05ff556bf07d73492e7ee6f1280e87dc09ca860be071989a0b8744
|
7
|
+
data.tar.gz: 397eef5e1e50727872a09a223d9487252f98e808eca019d8ba999006068b5323de33684cafbd713e1fc167ca5d4dd343876b83e6e51f5cb90a84730f0b3cc5b3
|
data/README.md
CHANGED
@@ -46,16 +46,18 @@ To increment the minor segment of your Mix package version number:
|
|
46
46
|
Here are some arguments that can be used with `incr`:
|
47
47
|
- `-d` : Directory where to search for the version files (default: `.`)
|
48
48
|
- `-t` : Tag name pattern, where `%s` will be replaced with the new version (default: `v%s`)
|
49
|
+
- `--[no-]commit` : Commit changes. (default: enabled)
|
50
|
+
- `--[no-]tag` : Create a git tag. (default: enabled)
|
49
51
|
|
50
52
|
Example:
|
51
53
|
```shell
|
52
|
-
~> incr npm patch -d ./subprojects/web/ -t MyCustomTagPrefix/%s
|
54
|
+
~> incr --no-tag npm patch -d ./subprojects/web/ -t MyCustomTagPrefix/%s
|
53
55
|
```
|
54
56
|
|
55
57
|
This will :
|
56
58
|
- Search for `package.json` and `package-lock.json` files inside `./subprojects/web/` and update the patch version
|
57
|
-
- Create a tag named `MyCustomTagPrefix/2.3.4`
|
58
59
|
- Commit the changes under the message `MyCustomTagPrefix/2.3.4`
|
60
|
+
- Not create a tag with the new version
|
59
61
|
|
60
62
|
## Contributing
|
61
63
|
|
data/bin/incr
CHANGED
@@ -10,8 +10,11 @@ include GLI::App
|
|
10
10
|
program_desc('Tasteful utility to increment the version number and create a corresponding git tag.')
|
11
11
|
version(Incr::VERSION)
|
12
12
|
|
13
|
-
flag [:d, :versionFileDirectory], :default_value => '.', :desc => 'Directory where to search for version file
|
14
|
-
flag [:t, :tagNamePattern], :default_value => 'v%s'
|
13
|
+
flag [:d, :versionFileDirectory], :default_value => '.', :desc => 'Directory where to search for version file'
|
14
|
+
flag [:t, :tagNamePattern], :default_value => 'v%s', :desc => 'Pattern for the tag name'
|
15
|
+
|
16
|
+
switch :commit, :default_value => true, :desc => 'Commit changes'
|
17
|
+
switch :tag, :default_value => true, :desc => 'Create a git tag'
|
15
18
|
|
16
19
|
pre do |global, command, options, args|
|
17
20
|
if args.length != 1 || !['major', 'minor', 'patch'].any? {|segment| args.include?(segment)}
|
data/lib/incr/command/mix.rb
CHANGED
@@ -5,6 +5,8 @@ module Incr
|
|
5
5
|
@segment = args[0]
|
6
6
|
@mix_file_filename = File.join('.', global_options[:versionFileDirectory], 'mix.exs')
|
7
7
|
@tag_pattern = global_options[:tagNamePattern]
|
8
|
+
@commit = global_options[:commit]
|
9
|
+
@tag = global_options[:tag]
|
8
10
|
end
|
9
11
|
|
10
12
|
def execute
|
@@ -24,8 +26,8 @@ module Incr
|
|
24
26
|
|
25
27
|
repository = Incr::Service::Repository.new('.')
|
26
28
|
repository.add(@mix_file_filename)
|
27
|
-
repository.commit(new_tag)
|
28
|
-
repository.tag(new_tag)
|
29
|
+
repository.commit(new_tag) if @commit
|
30
|
+
repository.tag(new_tag) if @tag
|
29
31
|
end
|
30
32
|
|
31
33
|
private
|
data/lib/incr/command/npm.rb
CHANGED
@@ -11,6 +11,8 @@ module Incr
|
|
11
11
|
@package_json_filename = File.join('.', global_options[:versionFileDirectory], 'package.json')
|
12
12
|
@package_json_lock_filename = File.join('.', global_options[:versionFileDirectory], 'package-lock.json')
|
13
13
|
@tag_pattern = global_options[:tagNamePattern]
|
14
|
+
@commit = global_options[:commit]
|
15
|
+
@tag = global_options[:tag]
|
14
16
|
end
|
15
17
|
|
16
18
|
def execute
|
@@ -33,8 +35,8 @@ module Incr
|
|
33
35
|
repository = Incr::Service::Repository.new('.')
|
34
36
|
repository.add(@package_json_filename)
|
35
37
|
repository.add(@package_json_lock_filename)
|
36
|
-
repository.commit(new_tag)
|
37
|
-
repository.tag(new_tag)
|
38
|
+
repository.commit(new_tag) if @commit
|
39
|
+
repository.tag(new_tag) if @tag
|
38
40
|
end
|
39
41
|
|
40
42
|
private
|
data/lib/incr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: incr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Philippe Couture
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.6
|
99
|
+
rubygems_version: 2.7.6
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: Tasteful utility to increment the version number and create a corresponding
|