summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/hoe.rb4
-rw-r--r--lib/hoe/deps.rb6
-rw-r--r--test/test_hoe.rb6
3 files changed, 8 insertions, 8 deletions
diff --git a/lib/hoe.rb b/lib/hoe.rb
index cc22b71..de519a3 100644
--- a/lib/hoe.rb
+++ b/lib/hoe.rb
@@ -398,12 +398,12 @@ class Hoe
with_config do |config, _|
config_plugins = config["plugins"]
break unless config_plugins
- Hoe.plugins.concat config_plugins.map { |plugin| plugin.intern }
+ Hoe.plugins.concat config_plugins.map(&:intern)
end
Hoe.load_plugins Hoe.plugins
- names = Hoe.constants.map { |s| s.to_s }
+ names = Hoe.constants.map(&:to_s)
names.reject! { |n| n =~ /^[A-Z_]+$/ }
names.each do |name|
diff --git a/lib/hoe/deps.rb b/lib/hoe/deps.rb
index 03229e8..1981650 100644
--- a/lib/hoe/deps.rb
+++ b/lib/hoe/deps.rb
@@ -72,7 +72,7 @@ module Hoe::Deps
puts " dependents:"
unless deps.empty? then
- deps.sort_by { |spec| spec.full_name }.each do |spec|
+ deps.sort_by(&:full_name).each do |spec|
vers = spec.dependencies.find {|s| s.name == name}.requirements_list
puts " %-*s - %s" % [max, spec.full_name, vers.join(", ")]
end
@@ -88,7 +88,7 @@ module Hoe::Deps
abort "Couldn't find gem: #{self.name}" unless gem
deps = self.dependent_upon self.name
- email = deps.map { |s| s.email }.compact.flatten.sort.uniq
+ email = deps.map(&:email).compact.flatten.sort.uniq
email = email.map { |s| s.split(/,\s*/) }.flatten.sort.uniq
email.map! { |s| # don't you people realize how easy this is?
@@ -111,7 +111,7 @@ module Hoe::Deps
mkdir "deps" unless File.directory? "deps"
Dir.chdir "deps" do
begin
- deps.sort_by { |spec| spec.full_name }.each do |spec|
+ deps.sort_by(&:full_name).each do |spec|
full_name = spec.full_name
tgz_name = "#{full_name}.tgz"
gem_name = "#{full_name}.gem"
diff --git a/test/test_hoe.rb b/test/test_hoe.rb
index 5424ee0..cdee94c 100644
--- a/test/test_hoe.rb
+++ b/test/test_hoe.rb
@@ -57,7 +57,7 @@ class TestHoe < Minitest::Test
end
def test_activate_plugins
- initializers = hoe.methods.grep(/^initialize/).map { |s| s.to_s }
+ initializers = hoe.methods.grep(/^initialize/).map(&:to_s)
assert_includes initializers, "initialize_package"
assert_includes initializers, "initialize_publish"
@@ -85,7 +85,7 @@ class TestHoe < Minitest::Test
write_hoerc path, "plugins" => %w[hoerc]
- methods = hoe.methods.grep(/^initialize/).map { |s| s.to_s }
+ methods = hoe.methods.grep(/^initialize/).map(&:to_s)
assert_includes methods, "initialize_hoerc"
assert_includes Hoe.plugins, :hoerc
@@ -268,7 +268,7 @@ class TestHoe < Minitest::Test
assert_equal Gem::RubyGemsVersion, spec.rubygems_version
assert_match(/^Hoe.*Rakefiles$/, spec.summary)
- deps = spec.dependencies.sort_by { |dep| dep.name }
+ deps = spec.dependencies.sort_by(&:name)
expected = [
["hoe", :development, "~> #{Hoe::VERSION.sub(/\.\d+$/, "")}"],