Permalink
Browse files

You can now specify a version

  • Loading branch information...
1 parent e375837 commit 8c6e2ae4bd624510a83d87907c9d143547ae54b6 @adamsanderson adamsanderson committed Apr 26, 2009
Showing with 13 additions and 6 deletions.
  1. +8 −2 lib/rubygems/commands/open_command.rb
  2. +5 −4 open_gem.gemspec
@@ -1,13 +1,19 @@
require 'rubygems/command'
require 'rubygems/dependency'
+require 'rubygems/version_option'
class Gem::Commands::OpenCommand < Gem::Command
+ include Gem::VersionOption
+
def initialize
- super 'open', "Opens the gem's source directory with $EDITOR", :command => nil
+ super 'open', "Opens the gem's source directory with $EDITOR", :command => nil, :version=>Gem::Requirement.default
+
add_option('-c', '--command COMMAND',
'Execute command at path of the rubygem') do |value, options|
options[:command] = value
end
+
+ add_version_option
end
def arguments # :nodoc:
@@ -17,7 +23,7 @@ def arguments # :nodoc:
def execute
name = get_one_gem_name
- dep = Gem::Dependency.new name, Gem::Requirement.default
+ dep = Gem::Dependency.new name, options[:version]
specs = Gem.source_index.search dep
if specs.length == 0
View
@@ -2,19 +2,20 @@
Gem::Specification.new do |s|
s.name = %q{open_gem}
- s.version = "0.0.0"
+ s.version = "0.2.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Adam Sanderson"]
- s.date = %q{2009-04-25}
- s.description = %q{Easily open a ruby gem with the editor of your choice.}
+ s.date = %q{2009-04-26}
+ s.description = %q{Gem Command to easily open a ruby gem with the editor of your choice.}
s.email = %q{netghost@gmail.com}
s.extra_rdoc_files = [
"README.markdown"
]
s.files = [
"README.markdown",
"Rakefile",
+ "VERSION.yml",
"lib/rubygems/commands/open_command.rb",
"lib/rubygems_plugin.rb"
]
@@ -23,7 +24,7 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.2}
- s.summary = %q{Easily open a ruby gem with the editor of your choice.}
+ s.summary = %q{Gem Command to easily open a ruby gem with the editor of your choice.}
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION

0 comments on commit 8c6e2ae

Please sign in to comment.