rubygems-desc 1.0.0 → 1.1.0

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.rdoc +4 -0
  2. data/VERSION +1 -0
  3. data/lib/rubygems_plugin.rb +10 -6
  4. metadata +2 -1
@@ -11,6 +11,10 @@ gem plugin to describe a gem by name
11
11
  bump version in a commit by itself I can ignore when I pull)
12
12
  * Send me a pull request.
13
13
 
14
+ == TODO
15
+
16
+ Remote gem descriptions
17
+
14
18
  == Copyright
15
19
 
16
20
  Copyright (c) 2009 Chad Fowler. See LICENSE for details.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.1.0
@@ -2,17 +2,14 @@ require 'rubygems/command'
2
2
 
3
3
  class Gem::Commands::DescCommand < Gem::Command
4
4
 
5
- include Gem::VersionOption
6
5
 
7
6
  def initialize
8
7
  super 'desc', 'Get description of a gem given its name',
9
8
  :version => Gem::Requirement.default
10
-
11
- add_version_option
12
9
  end
13
10
 
14
11
  def arguments # :nodoc:
15
- 'GEMNAME name of an installed gem to describe'
12
+ 'GEMNAME name of a gem to describe'
16
13
  end
17
14
 
18
15
  def usage # :nodoc:
@@ -26,8 +23,15 @@ class Gem::Commands::DescCommand < Gem::Command
26
23
  specs = Gem.source_index.search dep
27
24
 
28
25
  if specs.empty? then
29
- alert_error "No installed gem #{dep}"
30
- terminate_interaction 1
26
+ #try remote
27
+ fetcher = Gem::SpecFetcher.fetcher
28
+ specs = (fetcher.fetch dep, false, false, false)
29
+ specs = specs.first
30
+ if specs.nil? || specs.empty?
31
+ alert_error "No gem found: #{dep}"
32
+ terminate_interaction 1
33
+ end
34
+ specs = [specs.first]
31
35
  end
32
36
 
33
37
  spec = specs.last
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-desc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Fowler
@@ -37,6 +37,7 @@ files:
37
37
  - LICENSE
38
38
  - README.rdoc
39
39
  - Rakefile
40
+ - VERSION
40
41
  - lib/rubygems_plugin.rb
41
42
  - test/rubygems-desc_test.rb
42
43
  - test/test_helper.rb