open_gem 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.markdown CHANGED
@@ -1,5 +1,8 @@
1
1
  OpenGem
2
2
  ========
3
+ ...
4
+ ---
5
+ * Updating to use GemCutter to host gems now...
3
6
 
4
7
  1.3
5
8
  ----
data/README.markdown CHANGED
@@ -20,10 +20,10 @@ Just install like any normal gem:
20
20
 
21
21
  gem install open_gem
22
22
 
23
- Or for the edge version on GitHub:
23
+ Or for the edge version use GemCutter.org:
24
24
 
25
- gem sources -a http://gems.github.com
26
- gem install adamsanderson-open_gem
25
+ gem sources -a http://gemcutter.org
26
+ gem install open_gem
27
27
 
28
28
  For more help:
29
29
 
data/Rakefile CHANGED
@@ -12,6 +12,7 @@ begin
12
12
  DESC
13
13
  s.email = "netghost@gmail.com"
14
14
  s.homepage = "http://github.com/adamsanderson/open_gem"
15
+ s.rubyforge_project = "opengem"
15
16
  s.authors = ["Adam Sanderson"]
16
17
  s.has_rdoc = false
17
18
  s.files = FileList["[A-Z]*", "{bin,lib,test}/**/*"]
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :minor: 3
3
- :patch: 1
2
+ :minor: 4
3
+ :patch: 0
4
4
  :major: 1
@@ -14,16 +14,29 @@ module OpenGem
14
14
  end
15
15
  end
16
16
 
17
+ def add_exact_match_option
18
+ add_option('-x', '--exact',
19
+ 'Only list exact matches') do |value, options|
20
+ options[:exact] = true
21
+ end
22
+ end
23
+
17
24
  def get_spec(name)
18
- dep = Gem::Dependency.new name, options[:version]
25
+ dep = Gem::Dependency.new(name, options[:version])
19
26
  specs = Gem.source_index.search(dep)
20
27
  if block_given?
21
28
  specs = specs.select{|spec| yield spec}
22
29
  end
23
30
 
24
31
  if specs.length == 0
25
- say "'#{name}' is not available"
26
- return nil
32
+ # If we have not tried to do a pattern match yet, fall back on it.
33
+ if(!options[:exact] && !name.is_a?(Regexp))
34
+ pattern = /#{Regexp.escape name}/
35
+ get_spec(pattern)
36
+ else
37
+ say "#{name.inspect} is not available"
38
+ return nil
39
+ end
27
40
 
28
41
  elsif specs.length == 1 || options[:latest]
29
42
  return specs.last
@@ -12,6 +12,7 @@ class Gem::Commands::OpenCommand < Gem::Command
12
12
  add_command_option
13
13
  add_latest_version_option
14
14
  add_version_option
15
+ add_exact_match_option
15
16
  end
16
17
 
17
18
  def arguments # :nodoc:
@@ -12,6 +12,7 @@ class Gem::Commands::ReadCommand < Gem::Command
12
12
  add_command_option "Application to read rdoc with"
13
13
  add_latest_version_option
14
14
  add_version_option
15
+ add_exact_match_option
15
16
  end
16
17
 
17
18
  def arguments # :nodoc:
@@ -53,7 +54,7 @@ class Gem::Commands::ReadCommand < Gem::Command
53
54
  command_parts << path
54
55
  success = system(*command_parts)
55
56
  if !success
56
- raise Gem::CommandLineError, "Could not run '#{editor} #{path}', exit code: #{$?.exitstatus}"
57
+ raise Gem::CommandLineError, "Could not run '#{rdoc_reader} #{path}', exit code: #{$?.exitstatus}"
57
58
  end
58
59
  end
59
60
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Sanderson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-02 00:00:00 -07:00
12
+ date: 2009-10-09 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -40,7 +40,7 @@ files:
40
40
  - lib/rubygems/commands/read_command.rb
41
41
  - lib/rubygems_plugin.rb
42
42
  - test/open_command_test.rb
43
- has_rdoc: false
43
+ has_rdoc: true
44
44
  homepage: http://github.com/adamsanderson/open_gem
45
45
  licenses: []
46
46
 
@@ -63,8 +63,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  version:
64
64
  requirements: []
65
65
 
66
- rubyforge_project:
67
- rubygems_version: 1.3.2
66
+ rubyforge_project: opengem
67
+ rubygems_version: 1.3.5
68
68
  signing_key:
69
69
  specification_version: 3
70
70
  summary: Gem Command to easily open a ruby gem with the editor of your choice.