diff options
author | Nathan Broadbent <nathan.f77@gmail.com> | 2012-01-30 00:54:17 +0800 |
---|---|---|
committer | Nathan Broadbent <nathan.f77@gmail.com> | 2012-01-30 03:15:49 +0800 |
commit | b31eac56097a0bfc5f5af70de91ad261067a395f (patch) | |
tree | 940fc90f5132122e70e49cb670776f32af41bde9 /actionpack | |
parent | ec4440fd4e886bc491726070b9fc44938f8798ee (diff) | |
download | rails-b31eac56097a0bfc5f5af70de91ad261067a395f.tar.gz rails-b31eac56097a0bfc5f5af70de91ad261067a395f.tar.bz2 rails-b31eac56097a0bfc5f5af70de91ad261067a395f.zip |
Replaced all 'for' loops with Enumerable#each
Diffstat (limited to 'actionpack')
-rwxr-xr-x | actionpack/Rakefile | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/selector.rb | 4 | ||||
-rw-r--r-- | actionpack/test/fixtures/developers.yml | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/Rakefile b/actionpack/Rakefile index effb6badfc..75d16ceb05 100755 --- a/actionpack/Rakefile +++ b/actionpack/Rakefile @@ -55,7 +55,7 @@ end task :lines do lines, codelines, total_lines, total_codelines = 0, 0, 0, 0 - for file_name in FileList["lib/**/*.rb"] + FileList["lib/**/*.rb"].each do |file_name| next if file_name =~ /vendor/ f = File.open(file_name) diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb index 4d963803e6..33796008bd 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb @@ -417,8 +417,8 @@ module ActionDispatch deliveries = ActionMailer::Base.deliveries assert !deliveries.empty?, "No e-mail in delivery list" - for delivery in deliveries - for part in (delivery.parts.empty? ? [delivery] : delivery.parts) + deliveries.each do |delivery| + (delivery.parts.empty? ? [delivery] : delivery.parts).each do |part| if part["Content-Type"].to_s =~ /^text\/html\W/ root = HTML::Document.new(part.body.to_s).root assert_select root, ":root", &block diff --git a/actionpack/test/fixtures/developers.yml b/actionpack/test/fixtures/developers.yml index 308bf75de2..3656564f63 100644 --- a/actionpack/test/fixtures/developers.yml +++ b/actionpack/test/fixtures/developers.yml @@ -8,7 +8,7 @@ jamis: name: Jamis salary: 150000 -<% for digit in 3..10 %> +<% (3..10).each do |digit| %> dev_<%= digit %>: id: <%= digit %> name: fixture_<%= digit %> |