gitver 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.
- data/.gitignore +1 -0
- data/README.md +33 -0
- data/Rakefile +21 -0
- data/bin/gitver +33 -0
- metadata +53 -0
data/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/pkg
|
data/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
GitVers - Ruby Gem Auto Versioning
|
|
2
|
+
==================================
|
|
3
|
+
|
|
4
|
+
Usage
|
|
5
|
+
-----
|
|
6
|
+
|
|
7
|
+
I got tired of messing with ruby gem versioning, so
|
|
8
|
+
in my normal fashion I automated it. Now when I want
|
|
9
|
+
to make a ruby gem I do the following.
|
|
10
|
+
|
|
11
|
+
* Create the remote on github (eg: https://github.com/floomby/gemness)
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
git clone https://github.com/floomby/gemness.git
|
|
15
|
+
cd gemness
|
|
16
|
+
gitvers install
|
|
17
|
+
```
|
|
18
|
+
* Then edit the Rakefile to suit you needs
|
|
19
|
+
* Code your gem
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
git add <files>
|
|
23
|
+
git commit -m "Release 1.0.0"
|
|
24
|
+
rake package && gem install pkg/gemness-1.0.0.gem
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
TODO
|
|
28
|
+
----
|
|
29
|
+
|
|
30
|
+
* Using the github api to grab the description and
|
|
31
|
+
website for the gem would be neat
|
|
32
|
+
* Add install target to Rakefile
|
|
33
|
+
|
data/Rakefile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'rubygems/package_task'
|
|
3
|
+
|
|
4
|
+
spec = Gem::Specification.new do |gem|
|
|
5
|
+
gem.name = File.basename(`git rev-parse --show-toplevel`).chop
|
|
6
|
+
gem.version = `gitvers version`
|
|
7
|
+
|
|
8
|
+
gem.author = `git config --get user.name`
|
|
9
|
+
gem.email = `git config --get user.email`
|
|
10
|
+
gem.homepage = "https://github.com/floomby/gitver.git"
|
|
11
|
+
gem.summary = "Ruby gem integration with git"
|
|
12
|
+
gem.description = "Does versioning, releasing and testing of rubygems with git"
|
|
13
|
+
|
|
14
|
+
gem.files = `git ls-files`.split($\).select { |f| !(f =~ /templates/) }
|
|
15
|
+
|
|
16
|
+
gem.executables = ["gitver"]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
Gem::PackageTask.new(spec) do |pkg|
|
|
20
|
+
pkg.gem_spec = spec
|
|
21
|
+
end
|
data/bin/gitver
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# Simple gem auto versioning with git
|
|
4
|
+
|
|
5
|
+
class GitVer
|
|
6
|
+
|
|
7
|
+
def self.install
|
|
8
|
+
`wget https://raw.githubusercontent.com/floomby/gitver/master/templates/Rakefile`
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# get the last release
|
|
12
|
+
def self.version
|
|
13
|
+
a = /^[^ ]+ [^ ]+ ([^ ]+)$/.match `git log --oneline -i --grep=^release -1`
|
|
14
|
+
if a
|
|
15
|
+
puts a[1]
|
|
16
|
+
else
|
|
17
|
+
exit 1
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
end # class GitVer
|
|
23
|
+
|
|
24
|
+
abort "Usage: gitver <install|version>\n" unless ARGV.length == 1
|
|
25
|
+
|
|
26
|
+
case ARGV[0]
|
|
27
|
+
when 'install'
|
|
28
|
+
GitVer.install
|
|
29
|
+
when 'version'
|
|
30
|
+
GitVer.version
|
|
31
|
+
else
|
|
32
|
+
abort "Usage: gitver <install|version>\n"
|
|
33
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: gitver
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.2
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- ! 'floomby
|
|
9
|
+
|
|
10
|
+
'
|
|
11
|
+
autorequire:
|
|
12
|
+
bindir: bin
|
|
13
|
+
cert_chain: []
|
|
14
|
+
date: 2014-04-22 00:00:00.000000000 Z
|
|
15
|
+
dependencies: []
|
|
16
|
+
description: Does versioning, releasing and testing of rubygems with git
|
|
17
|
+
email: ! 'floomby@nmt.edu
|
|
18
|
+
|
|
19
|
+
'
|
|
20
|
+
executables:
|
|
21
|
+
- gitver
|
|
22
|
+
extensions: []
|
|
23
|
+
extra_rdoc_files: []
|
|
24
|
+
files:
|
|
25
|
+
- .gitignore
|
|
26
|
+
- README.md
|
|
27
|
+
- Rakefile
|
|
28
|
+
- bin/gitver
|
|
29
|
+
homepage: https://github.com/floomby/gitver.git
|
|
30
|
+
licenses: []
|
|
31
|
+
post_install_message:
|
|
32
|
+
rdoc_options: []
|
|
33
|
+
require_paths:
|
|
34
|
+
- lib
|
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
36
|
+
none: false
|
|
37
|
+
requirements:
|
|
38
|
+
- - ! '>='
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
42
|
+
none: false
|
|
43
|
+
requirements:
|
|
44
|
+
- - ! '>='
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
requirements: []
|
|
48
|
+
rubyforge_project:
|
|
49
|
+
rubygems_version: 1.8.23
|
|
50
|
+
signing_key:
|
|
51
|
+
specification_version: 3
|
|
52
|
+
summary: Ruby gem integration with git
|
|
53
|
+
test_files: []
|