gem-release 0.0.4 → 0.0.5
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/README.textile +20 -1
- data/lib/gem_release/version.rb +1 -1
- data/lib/rubygems_plugin.rb +8 -8
- metadata +2 -2
data/README.textile
CHANGED
@@ -2,4 +2,23 @@ h1. gem release
|
|
2
2
|
|
3
3
|
This gem plugin adds a `release` command to the rubygems `gem` command which
|
4
4
|
|
5
|
-
* builds
|
5
|
+
* builds a gem from your gemspec and
|
6
|
+
* pushes it to rubygems.org
|
7
|
+
* deletes the gem file
|
8
|
+
|
9
|
+
h2. Installation
|
10
|
+
|
11
|
+
Obviously ...
|
12
|
+
|
13
|
+
<pre>
|
14
|
+
$ gem install gem-release
|
15
|
+
</pre>
|
16
|
+
|
17
|
+
h2. Usage
|
18
|
+
|
19
|
+
<pre>
|
20
|
+
$ gem release path/to/your.gemspec
|
21
|
+
$ gem release
|
22
|
+
</pre>
|
23
|
+
|
24
|
+
If you don't specify a gemspec filename the first \*.gemspec file found in your current working directory will be used.
|
data/lib/gem_release/version.rb
CHANGED
data/lib/rubygems_plugin.rb
CHANGED
@@ -7,39 +7,39 @@ class Gem::Commands::ReleaseCommand < Gem::Command
|
|
7
7
|
super 'release', 'Build a gem from a gemspec and push to rubygems.org'
|
8
8
|
end
|
9
9
|
|
10
|
-
def arguments
|
10
|
+
def arguments
|
11
11
|
"GEMSPEC_FILE optional (will use the first *.gemspec if not specified)"
|
12
12
|
end
|
13
13
|
|
14
|
-
def usage
|
14
|
+
def usage
|
15
15
|
"#{program_name} [GEMSPEC_FILE]"
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
def execute
|
19
19
|
filename = build
|
20
20
|
push(filename)
|
21
21
|
remove(filename)
|
22
22
|
say "All done, thanks buddy."
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def build
|
26
26
|
command = Gem::Commands::BuildCommand.new
|
27
27
|
command.handle_options([gemspec])
|
28
28
|
command.execute
|
29
|
-
command.load_gemspecs(gemspec).first.
|
29
|
+
command.load_gemspecs(gemspec).first.file_name
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
def push(filename)
|
33
33
|
command = Gem::Commands::PushCommand.new
|
34
34
|
command.handle_options([filename])
|
35
35
|
command.execute
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def remove(filename)
|
39
39
|
`rm #{filename}`
|
40
40
|
say "Deleting left over gem file #{filename}"
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
def gemspec
|
44
44
|
@gemspec ||= begin
|
45
45
|
gemspec = Array(options[:args]).first
|