pod-bump 0.0.1 → 0.0.2

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: 4d73b515b211edb4de45ab6de4149e6979df7e7c
4
- data.tar.gz: 15eb710f425f97f8c9315a232f51a0140cdc476a
3
+ metadata.gz: 3b1236002423aa96145725addc4de5f3fc104540
4
+ data.tar.gz: 276dcfdde26540f7a84815c8e079cfb99696718d
5
5
  SHA512:
6
- metadata.gz: '09e92652d041c7cf521811fa5f4fce821a0defecc90835ebb0091aea6dbff5b6dcb02c7367443f694d32aff38c851713cdbf6ccedb47362b01a2e1004cfbe4db'
7
- data.tar.gz: c6cf4035dfda965715098274c3115c1c61205e75ac2824fab14b5fc92131bc16b3d93789f2535d66752e564109acc85a9e6dcfa7955f65969d62f73d9d4f48ab
6
+ metadata.gz: e292d39ad388c089135c41f78a4edc42f03de0c64420f608a652187e2d6e6e98e00c4ef8f3b76e945aa9500f2bb77419106e3259ad86e0f6622f8841da6e1bcd
7
+ data.tar.gz: 1b8e0aadcb126f8a2cddfb0598fe47789b96dd3404ef73f5808d10b7778fc820d062d5957ae0fc0447f507a9a7f767a351851ea35f1b841d5b6aa11f6d48fb20
data/bin/pod-bump CHANGED
@@ -15,13 +15,11 @@ OptionParser.new do |opt|
15
15
  pod-bump set (1.2.3) [options] # set the version number to the given value
16
16
  Options:
17
17
  BANNER
18
- opt.on("-s", "--specs_repository [REPO]", "Specs repository to push. Default 'trunk'.") { |o| options[:spec_repository] = o }
19
- opt.on("-m", "--message [MSG]", "Commit message. Default 'Bumped Version [Vesion]' ") { |o| options[:commit_message] = o }
20
- opt.on("--no-commit", "Do not commit after version bump.") { options[:no_commit] = true }
18
+ opt.on("-s", "--specs_repository [REPO_URL]", "Specs repository to push. Default 'trunk'.") { |o| options[:spec_repository] = o }
19
+ opt.on("-m", "--commit-message [MSG]", "Commit message. Default 'Bumped Version [Vesion]' ") { |o| options[:commit_message] = o }
20
+ opt.on("--no-commit", "Do not commit after version bump") { options[:no_commit] = true }
21
+ opt.on("--version", "Print current version") { options[:print_version] = true }
21
22
  end.parse!
22
23
 
23
24
  options[:version] = ARGV[1] if ARGV[0] == "set"
24
-
25
- status = PodBump.run(ARGV, options)
26
- # puts "Exit status " + status
27
- # exit status
25
+ status = PodBump.run(ARGV, options)
data/lib/pod-bump.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'pod-bump/version'
2
+ require 'pod-bump/version_model'
2
3
  require 'pod-bump/version_update_type'
3
4
  require 'git'
4
5
  require 'digest/sha1'
@@ -136,7 +137,7 @@ module PodBump
136
137
  end
137
138
 
138
139
  def PodBump.get_version_string_to_update(bump_type, options, version_string)
139
- version = Version.new(version_string)
140
+ version = VersionModel.new(version_string)
140
141
  version_to_update = nil
141
142
 
142
143
  if bump_type == VersionUpdateType::MAJOR
@@ -158,6 +159,11 @@ module PodBump
158
159
  end
159
160
 
160
161
  def PodBump.run(arguments, options)
162
+ if options[:print_version] == true
163
+ puts "pod-bump version " + PodBump::VERSION
164
+ return
165
+ end
166
+
161
167
  if arguments.size > 2 || (arguments.size == 2 && options[:version] == nil)
162
168
  puts "Invalid parameters. Please check documentation"
163
169
  return
@@ -1,40 +1,3 @@
1
1
  module PodBump
2
-
3
- class Version
4
-
5
- def initialize(version_string)
6
- versions = version_string.split(".")
7
- @major = versions[0].to_i
8
- @minor = versions[1].to_i
9
- @patch = versions[2].to_i
10
- end
11
-
12
- def major
13
- return @major
14
- end
15
-
16
- def minor
17
- return @minor
18
- end
19
-
20
- def patch
21
- return @patch
22
- end
23
-
24
- def increase_major
25
- @major += 1
26
- end
27
-
28
- def increase_minor
29
- @minor += 1
30
- end
31
-
32
- def increase_patch
33
- @patch += 1
34
- end
35
-
36
- def to_string_version
37
- @major.to_s + "." + @minor.to_s + "." + @patch.to_s
38
- end
39
- end
40
- end
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,40 @@
1
+ module PodBump
2
+
3
+ class VersionModel
4
+
5
+ def initialize(version_string)
6
+ versions = version_string.split(".")
7
+ @major = versions[0].to_i
8
+ @minor = versions[1].to_i
9
+ @patch = versions[2].to_i
10
+ end
11
+
12
+ def major
13
+ return @major
14
+ end
15
+
16
+ def minor
17
+ return @minor
18
+ end
19
+
20
+ def patch
21
+ return @patch
22
+ end
23
+
24
+ def increase_major
25
+ @major += 1
26
+ end
27
+
28
+ def increase_minor
29
+ @minor += 1
30
+ end
31
+
32
+ def increase_patch
33
+ @patch += 1
34
+ end
35
+
36
+ def to_string_version
37
+ @major.to_s + "." + @minor.to_s + "." + @patch.to_s
38
+ end
39
+ end
40
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pod-bump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maksim Kita
@@ -35,6 +35,7 @@ files:
35
35
  - bin/pod-bump
36
36
  - lib/pod-bump.rb
37
37
  - lib/pod-bump/version.rb
38
+ - lib/pod-bump/version_model.rb
38
39
  - lib/pod-bump/version_update_type.rb
39
40
  homepage: https://github.com/kitaisreal/pod-bump
40
41
  licenses: