summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbronzdoc <lsagastume1990@gmail.com>2019-08-23 15:19:54 -0600
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-09-05 18:43:29 +0900
commit92be07b1e1a9ca3b0e2588817629c23ab1201701 (patch)
tree9f2ea37e33a3af54a32738455e3547e7ad50b94c
parentb11cfed4c4fae51f7111c6cc0a3ec436a9c8faa3 (diff)
[rubygems/rubygems] Remove unnecessary gem_name method
https://github.com/rubygems/rubygems/commit/d1bb122651
-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)