show_gem 0.0.1 → 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/README.rdoc +12 -14
- data/Rakefile +1 -1
- data/lib/rubygems/commands/show.rb +9 -19
- data/lib/rubygems_plugin.rb +0 -2
- metadata +29 -14
data/README.rdoc
CHANGED
@@ -1,32 +1,30 @@
|
|
1
1
|
= show_gem
|
2
2
|
|
3
|
-
* http://github.com
|
3
|
+
* http://github.com/bmaland/show_gem
|
4
4
|
|
5
5
|
== DESCRIPTION:
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
== FEATURES/PROBLEMS:
|
10
|
-
|
11
|
-
* FIX (list of features or problems)
|
7
|
+
Gem Command to easily display information about a ruby gem.
|
12
8
|
|
13
9
|
== SYNOPSIS:
|
14
10
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
$ gem show rake
|
12
|
+
AUTHORS: Jim Weirich
|
13
|
+
DOWNLOADS: 103575
|
14
|
+
INFO: Rake is a Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax.
|
15
|
+
NAME: rake
|
16
|
+
RUBYFORGE_PROJECT: rake
|
17
|
+
VERSION: 0.8.7
|
20
18
|
|
21
19
|
== INSTALL:
|
22
20
|
|
23
|
-
|
21
|
+
gem install show_gem
|
24
22
|
|
25
23
|
== LICENSE:
|
26
24
|
|
27
25
|
(The MIT License)
|
28
26
|
|
29
|
-
Copyright (c) 2009
|
27
|
+
Copyright (c) 2009-2010 Bjørn Arild Mæland
|
30
28
|
|
31
29
|
Permission is hereby granted, free of charge, to any person obtaining
|
32
30
|
a copy of this software and associated documentation files (the
|
@@ -45,4 +43,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
45
43
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
46
44
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
47
45
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
48
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
46
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ begin
|
|
9
9
|
s.description = <<-DESC
|
10
10
|
Shows information about a gem, fetched from the Gemcutter site.
|
11
11
|
DESC
|
12
|
-
s.version = '0.0.
|
12
|
+
s.version = '0.0.2'
|
13
13
|
s.email = "bjorn.maeland@gmail.com"
|
14
14
|
s.homepage = "http://github.com/bmaland/show_gem"
|
15
15
|
s.rubyforge_project = "showgem"
|
@@ -1,4 +1,9 @@
|
|
1
|
-
|
1
|
+
require 'rubygems/gemcutter_utilities'
|
2
|
+
require 'json/pure' unless defined?(JSON::JSON_LOADED)
|
3
|
+
|
4
|
+
class Gem::Commands::ShowCommand < Gem::Command
|
5
|
+
|
6
|
+
include Gem::GemcutterUtilities
|
2
7
|
|
3
8
|
attr_reader :rubygem
|
4
9
|
|
@@ -11,16 +16,14 @@ class Gem::Commands::ShowCommand < Gem::AbstractCommand
|
|
11
16
|
end
|
12
17
|
|
13
18
|
def usage
|
14
|
-
"#{program_name} GEM"
|
19
|
+
"#{program_name} [GEM]"
|
15
20
|
end
|
16
21
|
|
17
22
|
def initialize
|
18
23
|
super 'show', description
|
19
|
-
add_proxy_option
|
20
24
|
end
|
21
25
|
|
22
26
|
def execute
|
23
|
-
setup
|
24
27
|
show_gem
|
25
28
|
end
|
26
29
|
|
@@ -30,21 +33,8 @@ class Gem::Commands::ShowCommand < Gem::AbstractCommand
|
|
30
33
|
end
|
31
34
|
|
32
35
|
def find(name)
|
33
|
-
|
34
|
-
|
35
|
-
response = make_request(:get, "gems/#{name}.json")
|
36
|
-
|
37
|
-
case response
|
38
|
-
when Net::HTTPSuccess
|
39
|
-
begin
|
40
|
-
@rubygem = JSON.parse(response.body)
|
41
|
-
rescue JSON::ParserError => json_error
|
42
|
-
say "There was a problem parsing the data: #{json_error}"
|
43
|
-
terminate_interaction
|
44
|
-
end
|
45
|
-
else
|
46
|
-
say "This gem is currently not hosted on Gemcutter."
|
47
|
-
terminate_interaction
|
36
|
+
with_response(rubygems_api_request(:get, "api/v1/gems/#{name}.json")) do |r|
|
37
|
+
@rubygem = JSON.parse(r.body)
|
48
38
|
end
|
49
39
|
end
|
50
40
|
|
data/lib/rubygems_plugin.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: show_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- "Bj\xC3\xB8rn Arild M\xC3\xA6land"
|
@@ -9,29 +14,37 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-05-14 00:00:00 +02:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: json_pure
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 2
|
30
|
+
- 0
|
23
31
|
version: 1.2.0
|
24
|
-
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
- !ruby/object:Gem::Dependency
|
26
35
|
name: gemcutter
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
38
|
requirements:
|
31
39
|
- - ">="
|
32
40
|
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
- 2
|
44
|
+
- 1
|
33
45
|
version: 0.2.1
|
34
|
-
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
35
48
|
description: " Shows information about a gem, fetched from the Gemcutter site.\n"
|
36
49
|
email: bjorn.maeland@gmail.com
|
37
50
|
executables: []
|
@@ -47,7 +60,7 @@ files:
|
|
47
60
|
- lib/rubygems_plugin.rb
|
48
61
|
- test/test_helper.rb
|
49
62
|
- test/test_show_gem.rb
|
50
|
-
has_rdoc:
|
63
|
+
has_rdoc: true
|
51
64
|
homepage: http://github.com/bmaland/show_gem
|
52
65
|
licenses: []
|
53
66
|
|
@@ -60,18 +73,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
60
73
|
requirements:
|
61
74
|
- - ">="
|
62
75
|
- !ruby/object:Gem::Version
|
76
|
+
segments:
|
77
|
+
- 0
|
63
78
|
version: "0"
|
64
|
-
version:
|
65
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
80
|
requirements:
|
67
81
|
- - ">="
|
68
82
|
- !ruby/object:Gem::Version
|
83
|
+
segments:
|
84
|
+
- 0
|
69
85
|
version: "0"
|
70
|
-
version:
|
71
86
|
requirements: []
|
72
87
|
|
73
88
|
rubyforge_project: showgem
|
74
|
-
rubygems_version: 1.3.
|
89
|
+
rubygems_version: 1.3.6
|
75
90
|
signing_key:
|
76
91
|
specification_version: 3
|
77
92
|
summary: Gem Command to easily display information about a ruby gem.
|