summaryrefslogtreecommitdiff
path: root/lib/rubygems
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems')
-rw-r--r--lib/rubygems/commands/build_command.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/rubygems/commands/build_command.rb b/lib/rubygems/commands/build_command.rb
index c7d5fd31f5..0ea5582aae 100644
--- a/lib/rubygems/commands/build_command.rb
+++ b/lib/rubygems/commands/build_command.rb
@@ -57,15 +57,12 @@ Gems can be saved to a specified filename with the output option:
end
def execute
+ gem_name = get_one_optional_argument || find_gemspec
build_gem(gem_name)
end
private
- def gem_name
- get_one_optional_argument || find_gemspec
- end
-
def find_gemspec
gemspecs = Dir.glob("*.gemspec").sort
@@ -77,7 +74,7 @@ Gems can be saved to a specified filename with the output option:
gemspecs.first
end
- def build_gem(gem_name = get_one_optional_argument)
+ def build_gem(gem_name)
gemspec = File.exist?(gem_name) ? gem_name : "#{gem_name}.gemspec"
if File.exist?(gemspec)