gpig 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +11 -1
  2. data/bin/gpig +33 -4
  3. data/lib/gpig/version.rb +1 -1
  4. metadata +1 -1
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  GPig
2
2
  ====
3
3
 
4
- Usage: gpig <version_file> <git_repo_url>
4
+ Usage: gpig &lt;version_file&gt; &lt;git_repo_url&gt;
5
5
 
6
6
  This tool helps with gem development. It allows a developer to quickly develop gems by doing the following:
7
7
 
@@ -15,11 +15,21 @@ This tool helps with gem development. It allows a developer to quickly develop
15
15
  Assumptions:
16
16
 
17
17
  - Your gemspec references a VERSION variable.
18
+
19
+ <pre>
20
+ Gem::Specification.new do |s|
21
+ s.name = "gpig"
22
+ s.version = Gpig::VERSION
23
+ ...
24
+ </pre>
25
+
18
26
  - That VERSION variable is referenced in a version file that you give to gpig.
19
27
 
28
+ <pre>
20
29
  module Gpig
21
30
  VERSION = '0.0.1'
22
31
  end
32
+ </pre>
23
33
 
24
34
  Example:
25
35
 
data/bin/gpig CHANGED
@@ -17,16 +17,45 @@ def increment_version(vfile)
17
17
  File.open(vfile, 'w') { |file| file.write(str2) }
18
18
  end
19
19
 
20
+ class PigConfig
21
+ def self.vfile=(str)
22
+ @@vfile = str
23
+ end
24
+ def self.vfile
25
+ return @@vfile
26
+ end
27
+ def self.repo=(str)
28
+ @@repo = str
29
+ end
30
+ def self.repo
31
+ return @@repo
32
+ end
33
+ end
34
+
20
35
  #===============================================================================
21
36
 
22
- vfile = ARGV.count > 0 ? ARGV[0] : false
23
- repo = ARGV.count > 1 ? ARGV[1] : false
37
+ PigConfig.vfile = ARGV.count > 0 ? ARGV[0] : false
38
+ PigConfig.repo = ARGV.count > 1 ? ARGV[1] : false
24
39
 
25
- if (!vfile || !repo || vfile.strip.length == 0 || repo.strip.length == 0)
40
+ if (ARGV.count == 0 && File.exists?(File.join(Dir.pwd, '.gpig')))
41
+ load File.join(Dir.pwd, '.gpig')
42
+ end
43
+
44
+ vfile = PigConfig.vfile
45
+ repo = PigConfig.repo
46
+
47
+ if (!vfile || !repo || vfile.strip.length == 0 || repo.strip.length == 0)
26
48
  puts "Usage: gpig <version_file> <git_repo_url>\n\n"
49
+ puts " or have a .gpig config file with those arguments on the first line."
27
50
  exit
28
51
  elsif (!File.exists?(vfile))
29
- puts "Error: the version file you gave doesn't seem to exist.\n";
52
+ puts "Error: the version file (#{vfile}) doesn't seem to exist.\n";
53
+ exit
54
+ end
55
+
56
+ str = `git status`
57
+ if (!str.index('nothing to commit').nil?)
58
+ puts "There aren't any changes in the working directory.\n\n"
30
59
  exit
31
60
  end
32
61
 
data/lib/gpig/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gpig
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gpig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: