zendesk_apps_tools 1.23.1 → 1.24.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
2
  SHA1:
3
- metadata.gz: 24c945d27b6b7e9369a65a8d5c37ef143c80690b
4
- data.tar.gz: f4cf272fce981529bfbd6cd38f5893103b220557
3
+ metadata.gz: c415a57b078b48bafed32526b7a1050496bd5fe6
4
+ data.tar.gz: 7940d222e7e47aaf3a96fb208a760501f710187b
5
5
  SHA512:
6
- metadata.gz: 6e61222241a9f05b70db69e26ab21af6d0a74b2afee4975b29215733efd525459be1686aff65aabb28f1507ec2d213e1116ddd84290837415ad5a5b074a73f3c
7
- data.tar.gz: 1fdaa83b54c4a8c3136342ee560c61aef5db00096553913353fea97b53f3a25706bfdc1247fe9eb9c755079869168bf4f0cae066934f010b1d82508fafc0baf5
6
+ metadata.gz: d64876bb06c0f1861a9d61d847cb8fb88472ebcb6c3b20f11b48e156c0bba1e96bf597ca844c8bca165eb17ca91a0b0c12399925652a32fc2dc830e91f806d0f
7
+ data.tar.gz: 6f2cf9a2901c55d4fb1cf4c6479f3303abcb316e27927f96c4df6f8e6b6fc12098254a37da6bd8fe06d9387c95f77c4fb5c8ffe05813406584aa9606666aabea
@@ -8,7 +8,14 @@ module ZendeskAppsTools
8
8
  include Thor::Actions
9
9
  prepend ManifestHandler
10
10
 
11
+ SHARED_OPTIONS = {
12
+ ['commit', '-c'] => false,
13
+ ['message', '-m'] => nil,
14
+ ['tag', '-t'] => false
15
+ }
16
+
11
17
  desc 'major', 'Bump major version'
18
+ method_options SHARED_OPTIONS
12
19
  def major
13
20
  semver[:major] += 1
14
21
  semver[:minor] = 0
@@ -16,16 +23,38 @@ module ZendeskAppsTools
16
23
  end
17
24
 
18
25
  desc 'minor', 'Bump minor version'
26
+ method_options SHARED_OPTIONS
19
27
  def minor
20
28
  semver[:minor] += 1
21
29
  semver[:patch] = 0
22
30
  end
23
31
 
24
32
  desc 'patch', 'Bump patch version'
33
+ method_options SHARED_OPTIONS
25
34
  def patch
26
35
  semver[:patch] += 1
27
36
  end
28
37
 
29
38
  default_task :patch
39
+
40
+ private
41
+
42
+ def post_actions
43
+ return tag if options[:tag]
44
+ commit if options[:commit]
45
+ end
46
+
47
+ def commit
48
+ `git commit -am #{commit_message}`
49
+ end
50
+
51
+ def commit_message
52
+ options[:message] || version(v: true)
53
+ end
54
+
55
+ def tag
56
+ commit
57
+ `git tag #{version(v: true)}`
58
+ end
30
59
  end
31
60
  end
@@ -14,6 +14,7 @@ module ZendeskAppsTools
14
14
  super()
15
15
  update_version
16
16
  write_manifest
17
+ post_actions
17
18
  end
18
19
  end
19
20
 
@@ -57,9 +58,9 @@ module ZendeskAppsTools
57
58
  v.match(/\A(?<v>v)?(?<major>\d+)(?:\.(?<minor>\d+)(?:\.(?<patch>\d+))?)?\Z/)
58
59
  end
59
60
 
60
- def version
61
+ def version(v: false)
61
62
  [
62
- semver[:v],
63
+ v ? 'v' : semver[:v],
63
64
  [
64
65
  semver[:major],
65
66
  semver[:minor],
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_apps_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.23.1
4
+ version: 1.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James A. Rosen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-06-02 00:00:00.000000000 Z
14
+ date: 2015-06-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor