xcodebump 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df99e2870d76ca54ad758987d40008ebafb60086
4
- data.tar.gz: e09b09be204428cbbddfcea492975d0d4e903240
3
+ metadata.gz: 58232dd78fc366e2a761bad6391e7e602d459563
4
+ data.tar.gz: d7da3b1bd4b1a38a8251dee27315a5aa5979285e
5
5
  SHA512:
6
- metadata.gz: ed0e19e0afabc7a5a370edbb019908d9bd7cb90d2a4ba23201af182fdc09db2abb0066c143011a260348f254cb1735dc60d2964c0f52338f1ab71124333d7972
7
- data.tar.gz: 28a30d654b51ca9c38035c9dbc6f2f08c6882c88524e9fe7aa4e67c1513696072697317a7b29bb3a98efe649c85916cfc989bfcbf31cbbb78342e24c08b093a7
6
+ metadata.gz: c133438588f79dc21bd012703b1e6c5e759197104012f44ca94083a64ee996edf4be3e296d6c066e0509e403af25aa11aa1594340dd858077c27866c1323655e
7
+ data.tar.gz: 1ed70462e8103af698c7cd3183809e67df4cde3c3fb12734c49916786f2540fd31323f78bedc25d27ddf701315850a448938961349c98c301f5434813eacf366
data/Gemfile.lock CHANGED
@@ -1,12 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xcodebump (0.0.2)
4
+ xcodebump (0.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ diff-lcs (1.2.5)
10
+ grit (2.5.0)
11
+ diff-lcs (~> 1.1)
12
+ mime-types (~> 1.15)
13
+ posix-spawn (~> 0.3.6)
9
14
  highline (1.6.21)
15
+ mime-types (1.25.1)
16
+ posix-spawn (0.3.8)
10
17
  rake (10.3.2)
11
18
 
12
19
  PLATFORMS
@@ -14,6 +21,7 @@ PLATFORMS
14
21
 
15
22
  DEPENDENCIES
16
23
  bundler (~> 1.6)
24
+ grit
17
25
  highline
18
26
  rake
19
27
  xcodebump!
data/README.md CHANGED
@@ -1,28 +1,28 @@
1
- # Xcodebump
2
-
3
- TODO: Write a gem description
1
+ ![banner](resources/banner.png)
4
2
 
5
3
  ## Installation
6
4
 
7
- Add this line to your application's Gemfile:
8
-
9
- gem 'xcodebump'
5
+ `$ gem install xcodebump`
10
6
 
11
- And then execute:
7
+ ## Usage
12
8
 
13
- $ bundle
9
+ ```bash
10
+ $ cd /path/where/my/project/lives
11
+ $ xcodebump bump (-r, -m, -p)
12
+ ```
14
13
 
15
- Or install it yourself as:
14
+ To bump a version number, you want to pass in one of the three flags in the parentheses above. The one to pass in depends entirely upon which part of the version you want to bump.
16
15
 
17
- $ gem install xcodebump
16
+ **1.2.3**
18
17
 
19
- ## Usage
18
+ * `-r` will bump the Release number, or the 1 above.
19
+ * `-m` will bump the Minor number, or the 2 above.
20
+ * `-p` will bump the Patch number, or the 3 above.
20
21
 
21
- TODO: Write usage instructions here
22
22
 
23
23
  ## Contributing
24
24
 
25
- 1. Fork it ( https://github.com/[my-github-username]/xcodebump/fork )
25
+ 1. Fork it ( https://github.com/intermark/xcodebump/fork )
26
26
  2. Create your feature branch (`git checkout -b my-new-feature`)
27
27
  3. Commit your changes (`git commit -am 'Add some feature'`)
28
28
  4. Push to the branch (`git push origin my-new-feature`)
@@ -9,11 +9,13 @@ command :bump do |c|
9
9
  c.option '-r', '--release', 'Bumps the release version number, or 1 in 1.2.3'
10
10
  c.option '-m', '--minor', 'Bumps the minor version number, or 2 in 1.2.3'
11
11
  c.option '-p', '--patch', 'Bumps the patch version number, or 3 in 1.2.3'
12
+ c.option '-g', '--git', 'Adds the version tag to git and pushes'
12
13
 
13
14
  c.action do |args, options|
14
15
  r = options.release
15
16
  m = options.minor
16
17
  p = options.patch
18
+ g = options.git
17
19
 
18
20
  if r
19
21
  m = nil
@@ -27,6 +29,6 @@ command :bump do |c|
27
29
  else
28
30
  return
29
31
  end
30
- Xcodebump::update_version_number r, m, p
32
+ Xcodebump::update_version_number r, m, p, g
31
33
  end
32
34
  end
@@ -0,0 +1,26 @@
1
+ require 'colors'
2
+ require 'git'
3
+ require 'fileutils'
4
+
5
+ module Xcodebump
6
+ def self.add_new_version_to_git version
7
+
8
+ commit_changes version if Dir.exist? "#{Dir.pwd}/.git"
9
+ add_tag version if Dir.exist? "#{Dir.pwd}/.git"
10
+ push_changes version if Dir.exist? "#{Dir.pwd}/.git"
11
+ end
12
+
13
+ def self.commit_changes version
14
+ `git add .`
15
+ `git commit -m 'Bump: #{version}'`
16
+ end
17
+
18
+ def self.add_tag version
19
+ `git tag -a #{version} -m #{version}`
20
+ `git push --tags`
21
+ end
22
+
23
+ def self.push_changes version
24
+ `git push`
25
+ end
26
+ end
@@ -1,8 +1,9 @@
1
1
  require 'highline/import'
2
2
  require 'colors'
3
+ require 'git'
3
4
 
4
5
  module Xcodebump
5
- def self.update_version_number release, minor, patch
6
+ def self.update_version_number release, minor, patch, git
6
7
  # Find Plist Paths
7
8
  plist_paths = []
8
9
  Dir.glob(Dir.pwd + '/**/*.plist').each do |d|
@@ -57,12 +58,17 @@ module Xcodebump
57
58
  components = path.split('/')
58
59
  plist = components[components.size - 1]
59
60
  Xcodebump::green "\n #{plist} updated to #{new_version}\n"
61
+
62
+ # Save to Git
63
+ Xcodebump::add_new_version_to_git new_version if git
60
64
  end
61
65
 
62
66
 
63
67
  def self.new_version_string v, release, minor, patch
64
68
  v_components = v.split('.')
65
- v_components << '0' if v_components.size < 3
69
+ while v_components.size < 3
70
+ v_components << '0'
71
+ end
66
72
  v_components[0] = (v_components[0].to_i + 1).to_s if release
67
73
  v_components[1] = (v_components[1].to_i + 1).to_s if minor
68
74
  v_components[2] = (v_components[2].to_i + 1).to_s if patch
@@ -1,3 +1,3 @@
1
1
  module Xcodebump
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/xcodebump.rb CHANGED
@@ -2,6 +2,7 @@ require "xcodebump/version"
2
2
  require 'xcodebump/commands'
3
3
  require 'xcodebump/plist'
4
4
  require 'xcodebump/colors'
5
+ require 'xcodebump/git'
5
6
 
6
7
  module Xcodebump
7
8
  # Your code goes here...
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcodebump
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - bennyguitar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-18 00:00:00.000000000 Z
11
+ date: 2014-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: grit
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: Quickly and easily bump your build and version numbers for an Xcode project
56
70
  or workspace.
57
71
  email:
@@ -67,12 +81,14 @@ files:
67
81
  - ./lib/xcodebump/commands/bump.rb
68
82
  - ./lib/xcodebump/commands/install.rb
69
83
  - ./lib/xcodebump/commands.rb
84
+ - ./lib/xcodebump/git.rb
70
85
  - ./lib/xcodebump/plist.rb
71
86
  - ./lib/xcodebump/version.rb
72
87
  - ./lib/xcodebump.rb
73
88
  - ./LICENSE.txt
74
89
  - ./Rakefile
75
90
  - ./README.md
91
+ - ./resources/banner.png
76
92
  - bin/xcodebump
77
93
  homepage: https://github.com/intermark/xcodebump
78
94
  licenses: