gpig 0.0.1
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/MIT-LICENSE +20 -0
- data/README.md +31 -0
- data/Rakefile +6 -0
- data/bin/gpig +45 -0
- data/lib/gpig.rb +4 -0
- data/lib/gpig/engine.rb +5 -0
- data/lib/gpig/version.rb +3 -0
- metadata +70 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2013 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
GPig
|
2
|
+
====
|
3
|
+
|
4
|
+
Usage: gpig <version_file> <git_repo_url>
|
5
|
+
|
6
|
+
This tool helps with gem development. It allows a developer to quickly develop gems by doing the following:
|
7
|
+
|
8
|
+
1. Increments the version of a gem.
|
9
|
+
2. Adds all changed files to the current git repo.
|
10
|
+
3. Commits all those changes to the git repo.
|
11
|
+
4. Pulls any changes from the repo's origin.
|
12
|
+
5. Pushes any changes to the origin.
|
13
|
+
6. Runs gem specific_install to install the gem from the git repo URL.
|
14
|
+
|
15
|
+
Assumptions:
|
16
|
+
|
17
|
+
- Your gemspec references a VERSION variable.
|
18
|
+
- That VERSION variable is referenced in a version file that you give to gpig.
|
19
|
+
|
20
|
+
module Gpig
|
21
|
+
VERSION = '0.0.1'
|
22
|
+
end
|
23
|
+
|
24
|
+
Example:
|
25
|
+
|
26
|
+
- Create a new gem.
|
27
|
+
- Make a change.
|
28
|
+
- Run gpig.
|
29
|
+
- Test the new version of your gem.
|
30
|
+
- Repeat :)
|
31
|
+
|
data/Rakefile
ADDED
data/bin/gpig
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
def increment_version(vfile)
|
4
|
+
str = File.open(vfile).read
|
5
|
+
str.gsub!(/\r\n?/, "\n")
|
6
|
+
str2 = ""
|
7
|
+
str.each_line do |line|
|
8
|
+
if (!line.index('VERSION').nil?)
|
9
|
+
arr = line.split('=')
|
10
|
+
arr = arr[1].gsub('"', '').gsub("'", '').strip.split('.')
|
11
|
+
arr[arr.count-1] = arr[arr.count-1].to_i + 1
|
12
|
+
v = arr.join('.')
|
13
|
+
line = " VERSION = '#{v}'\n"
|
14
|
+
end
|
15
|
+
str2 << line
|
16
|
+
end
|
17
|
+
File.open(vfile, 'w') { |file| file.write(str2) }
|
18
|
+
end
|
19
|
+
|
20
|
+
#===============================================================================
|
21
|
+
|
22
|
+
vfile = ARGV.count > 0 ? ARGV[0] : false
|
23
|
+
repo = ARGV.count > 1 ? ARGV[1] : false
|
24
|
+
|
25
|
+
if (!vfile || !repo || vfile.strip.length == 0 || repo.strip.length == 0)
|
26
|
+
puts "Usage: gpig <version_file> <git_repo_url>\n\n"
|
27
|
+
exit
|
28
|
+
elsif (!File.exists?(vfile))
|
29
|
+
puts "Error: the version file you gave doesn't seem to exist.\n";
|
30
|
+
exit
|
31
|
+
end
|
32
|
+
|
33
|
+
puts "Modifying the version..."
|
34
|
+
increment_version(vfile)
|
35
|
+
puts "Adding files to git repo..."
|
36
|
+
`git add -A`
|
37
|
+
puts "Committing files to git repo..."
|
38
|
+
`git commit -m 'More changes'`
|
39
|
+
puts "Pulling in any changes..."
|
40
|
+
`git pull origin master`
|
41
|
+
puts "Pushing in any changes..."
|
42
|
+
`git push origin master`
|
43
|
+
puts "Installing new version of gem..."
|
44
|
+
`gem specific_install -l #{repo}`
|
45
|
+
puts "Finished!\n\n"
|
data/lib/gpig.rb
ADDED
data/lib/gpig/engine.rb
ADDED
data/lib/gpig/version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gpig
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- William Barry
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-06-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: specific_install
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
description: A tool to quickly add files to a git repo, push, and then use specific_install
|
31
|
+
to install the new gem.
|
32
|
+
email:
|
33
|
+
- william@nine.is
|
34
|
+
executables:
|
35
|
+
- gpig
|
36
|
+
extensions: []
|
37
|
+
extra_rdoc_files: []
|
38
|
+
files:
|
39
|
+
- bin/gpig
|
40
|
+
- lib/gpig/engine.rb
|
41
|
+
- lib/gpig/version.rb
|
42
|
+
- lib/gpig.rb
|
43
|
+
- MIT-LICENSE
|
44
|
+
- Rakefile
|
45
|
+
- README.md
|
46
|
+
homepage: http://github.com/williambarry007/gpig
|
47
|
+
licenses: []
|
48
|
+
post_install_message:
|
49
|
+
rdoc_options: []
|
50
|
+
require_paths:
|
51
|
+
- lib
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ! '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
requirements: []
|
65
|
+
rubyforge_project:
|
66
|
+
rubygems_version: 1.8.25
|
67
|
+
signing_key:
|
68
|
+
specification_version: 3
|
69
|
+
summary: A gem development tool.
|
70
|
+
test_files: []
|