incr 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 990244b97a22582412b854aeef90bd9ec4098a79
4
- data.tar.gz: 91f01973dac745680d3c2a482e47c4baf39fbf7c
2
+ SHA256:
3
+ metadata.gz: c4896689095379204d0697a39423ce3c15b87f4920164314bc86c2121f22154b
4
+ data.tar.gz: 9f008d7fbf98ff81278ba1cb4851fee1cdea1327890428e234a85c3487c983c3
5
5
  SHA512:
6
- metadata.gz: acbd123ad551512a014ce37772d7da580212b1fba0e0e1e5dd6784f56bda7d8845d976cd86a3488093ae57e9b51343b1e95765e4e7138f3fa72e9f9fdbd24473
7
- data.tar.gz: 973123c4bc4d3210f82d3d2bd8e5c57e342d2eb461e98e2d4d21faf7cc5b4ccad6cb74d148433d88482ea3991ff770f5246350f2525f8ef5213230375c6037a5
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)}
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Incr
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
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.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-07-26 00:00:00.000000000 Z
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.13
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