n42gitversion 0.3.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ce55b831e0d7321f3b475f172673a8b1abe45f6f
4
+ data.tar.gz: 4a5b2edb4d6ef05ed9ad37e3a2ec58e3669b310e
5
+ SHA512:
6
+ metadata.gz: 9d98d03ed57c70d062060ffe2370126a5daca3b908019aeee9883399eaa91112ee279d4418fb2f9cdc8643028419406b8e286210147aa7ab481f84573c159c68
7
+ data.tar.gz: c5904e6bdb1bc76d18755b86f43f206528951d53aaa5b12930238fe2e4b9842f0f039c43de7df090a3de24c0842bf4303c8a212ee3d9e314c7dde7efb9e04579
data/.gitignore ADDED
@@ -0,0 +1,23 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
23
+ .DS_Store
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.2
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # 0.1.0
2
+
3
+ * use HEAD instead of master branch for buildNumber
4
+
5
+ # 0.0.3
6
+
7
+ * add majorVersion in front of fullVersion aka Build Version
8
+
9
+ # 0.0.2
10
+
11
+ * initial release
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in n42gitversion.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Number42
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # N42gitversion
2
+
3
+ a tool to manage iOS versions based on git tags
4
+
5
+ ## Installation
6
+
7
+ Requirements:
8
+ * rbenv is installed via homebrew
9
+ * correct ruby version is installed
10
+ * bundler is installed
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ gem "n42gitversion", git: "git@bitbucket.org:number42/n42-gitversion-ruby.git"
15
+
16
+ And then execute:
17
+
18
+ bundle binstubs n42gitversion
19
+
20
+ Add run script build phase:
21
+
22
+ export PATH="/usr/local/opt/rbenv/shims:$PATH"
23
+ INFO_PLIST="${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Info"
24
+ defaults write "$INFO_PLIST" CFBundleShortVersionString $(bundle exec n42gitversion shortVersion)
25
+ defaults write "$INFO_PLIST" CFBundleVersion $(bundle exec n42gitversion fullVersion)
26
+
27
+ ## Usage
28
+
29
+ Commands:
30
+
31
+ n42gitversion fullVersion # prints the full version
32
+ n42gitversion help [COMMAND] # Describe available commands or one specific command
33
+ n42gitversion shortVersion # prints the short version
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/n42gitversion ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'n42gitversion'
4
+
5
+ N42gitversion::VersionCLI.start( ARGV )
@@ -0,0 +1,20 @@
1
+ require "n42gitversion/version"
2
+ require "n42gitversion/cli"
3
+
4
+ module N42gitversion
5
+ class Versioner
6
+ def fullVersion
7
+ "#{shortVersion}.#{buildNumber}"
8
+ end
9
+
10
+ def shortVersion
11
+ `git --git-dir=".git" --work-tree="." describe --tags --abbrev=0 | sed -e 's/^v//'`.strip
12
+ end
13
+
14
+ private
15
+
16
+ def buildNumber
17
+ `git --git-dir=".git" --work-tree="." rev-list HEAD | wc -l`.strip
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,17 @@
1
+ require 'thor'
2
+
3
+ module N42gitversion
4
+ class VersionCLI < Thor
5
+ N42gitversion
6
+
7
+ desc "shortVersion", "prints the short version"
8
+ def shortVersion
9
+ puts N42gitversion::Versioner.new.shortVersion
10
+ end
11
+
12
+ desc "fullVersion", "prints the full version"
13
+ def fullVersion
14
+ puts N42gitversion::Versioner.new.fullVersion
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,3 @@
1
+ module N42gitversion
2
+ VERSION = "0.3.0"
3
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'n42gitversion/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "n42gitversion"
8
+ spec.version = N42gitversion::VERSION
9
+ spec.authors = ["Wolfgang Lutz"]
10
+ spec.email = ["wlut@num42.de"]
11
+ spec.summary = %q{Get the Version of Software from the Git tags.}
12
+ spec.description = %q{Get the Version of Software from the Git tags. Supports branches.}
13
+ spec.homepage = "http://www.num42.de"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency 'thor', "~> 0.19.1"
22
+ spec.add_development_dependency "bundler", "~> 1.6"
23
+ spec.add_development_dependency "rake", '~> 10.4'
24
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: n42gitversion
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ platform: ruby
6
+ authors:
7
+ - Wolfgang Lutz
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.19.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.19.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.4'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.4'
55
+ description: Get the Version of Software from the Git tags. Supports branches.
56
+ email:
57
+ - wlut@num42.de
58
+ executables:
59
+ - n42gitversion
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".ruby-version"
65
+ - CHANGELOG.md
66
+ - Gemfile
67
+ - LICENSE
68
+ - README.md
69
+ - Rakefile
70
+ - bin/n42gitversion
71
+ - lib/n42gitversion.rb
72
+ - lib/n42gitversion/cli.rb
73
+ - lib/n42gitversion/version.rb
74
+ - n42gitversion.gemspec
75
+ homepage: http://www.num42.de
76
+ licenses:
77
+ - MIT
78
+ metadata: {}
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 2.4.5
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: Get the Version of Software from the Git tags.
99
+ test_files: []