incr 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +1 -2
- data/lib/incr/command/mix.rb +15 -4
- data/lib/incr/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9afe3ededb1966abd48644e8c02606dadf1a0a29af74b0287deab7079f034cd8
|
4
|
+
data.tar.gz: eb60c16aae7d930ef2ceec4e957bf91f61d722b12f7fc5ea6aa76ed93fca514c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 309db6be2b962833f4302e09ac0c2aca0d38e44937f035044d131a89d0ebfa8599ded9e00b2360acd509ba40b92d01fb123fc27fe375940b70db051cd09769c6
|
7
|
+
data.tar.gz: 0be89efa75da4fc94e76d1ab6a6accff6eff3b5d3e39e11b86b10b9b7969f0595458c48c9702a3b8d4761a2fc848a90e9ebc75c2ea605e3f1f04982bbf698ca1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,8 +6,7 @@
|
|
6
6
|
Incr is a tool to help you easily increment the version number of your NPM or Mix packages.
|
7
7
|
<br /><br />
|
8
8
|
<a href="https://rubygems.org/gems/incr"><img src="http://img.shields.io/gem/v/incr.svg" /></a>
|
9
|
-
|
10
|
-
<a href="https://gemnasium.com/jcouture/incr"><img src="http://img.shields.io/gemnasium/jcouture/incr.svg" /></a>
|
9
|
+
|
11
10
|
<a href="https://travis-ci.org/jcouture/incr"><img src="http://img.shields.io/travis/jcouture/incr.svg" /></a>
|
12
11
|
</p>
|
13
12
|
|
data/lib/incr/command/mix.rb
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
module Incr
|
2
2
|
module Command
|
3
3
|
class Mix
|
4
|
+
VERSION_REGEX = /@?version:?\W*\"(\d*.\d*.\d*)"/
|
5
|
+
VERSION_REPLACEMENT_PATTERNS = [
|
6
|
+
"version: \"%s\"",
|
7
|
+
"@version \"%s\""
|
8
|
+
]
|
9
|
+
|
4
10
|
def initialize(args, global_options)
|
5
11
|
@segment = args[0]
|
6
12
|
@mix_file_filename = File.join('.', global_options[:versionFileDirectory], 'mix.exs')
|
@@ -15,10 +21,10 @@ module Incr
|
|
15
21
|
return
|
16
22
|
end
|
17
23
|
|
18
|
-
file_version = file_content.match(
|
24
|
+
file_version = file_content.match(VERSION_REGEX)[1]
|
19
25
|
old_version = SemVersion.new(file_version)
|
20
26
|
new_version = Incr::Service::Version.increment_segment(old_version, @segment)
|
21
|
-
|
27
|
+
replace_file_version(old_version, new_version)
|
22
28
|
|
23
29
|
new_tag = @tag_pattern % new_version.to_s
|
24
30
|
|
@@ -41,8 +47,13 @@ module Incr
|
|
41
47
|
IO.read(filename)
|
42
48
|
end
|
43
49
|
|
44
|
-
def
|
45
|
-
|
50
|
+
def replace_file_version(old_version, new_version)
|
51
|
+
VERSION_REPLACEMENT_PATTERNS.each do |pattern|
|
52
|
+
old_version_pattern = format(pattern, old_version.to_s)
|
53
|
+
new_version_pattern = format(pattern, new_version.to_s)
|
54
|
+
|
55
|
+
Incr::Service::FileHelper.replace_once(@mix_file_filename, old_version_pattern, new_version_pattern)
|
56
|
+
end
|
46
57
|
end
|
47
58
|
end
|
48
59
|
end
|
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.6.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:
|
11
|
+
date: 2019-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|
@@ -95,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
|
-
|
99
|
-
rubygems_version: 2.7.6
|
98
|
+
rubygems_version: 3.0.3
|
100
99
|
signing_key:
|
101
100
|
specification_version: 4
|
102
101
|
summary: Tasteful utility to increment the version number and create a corresponding
|