Commit f9e55386198e53e05a871fb84e0439f100c96d68
1 parent
82b30ccd
Exists in
master
and in
27 other branches
rails3: change from lambda to proc
Showing
11 changed files
with
22 additions
and
22 deletions
Show diff stats
app/models/folder.rb
@@ -35,7 +35,7 @@ class Folder < Article | @@ -35,7 +35,7 @@ class Folder < Article | ||
35 | include ActionView::Helpers::TagHelper | 35 | include ActionView::Helpers::TagHelper |
36 | def to_html(options = {}) | 36 | def to_html(options = {}) |
37 | folder = self | 37 | folder = self |
38 | - lambda do | 38 | + proc do |
39 | render :file => 'content_viewer/folder', :locals => {:folder => folder} | 39 | render :file => 'content_viewer/folder', :locals => {:folder => folder} |
40 | end | 40 | end |
41 | end | 41 | end |
app/models/forum.rb
@@ -17,7 +17,7 @@ class Forum < Folder | @@ -17,7 +17,7 @@ class Forum < Folder | ||
17 | 17 | ||
18 | include ActionView::Helpers::TagHelper | 18 | include ActionView::Helpers::TagHelper |
19 | def to_html(options = {}) | 19 | def to_html(options = {}) |
20 | - lambda do | 20 | + proc do |
21 | render :file => 'content_viewer/forum_page' | 21 | render :file => 'content_viewer/forum_page' |
22 | end | 22 | end |
23 | end | 23 | end |
app/models/gallery.rb
@@ -15,7 +15,7 @@ class Gallery < Folder | @@ -15,7 +15,7 @@ class Gallery < Folder | ||
15 | include ActionView::Helpers::TagHelper | 15 | include ActionView::Helpers::TagHelper |
16 | def to_html(options={}) | 16 | def to_html(options={}) |
17 | article = self | 17 | article = self |
18 | - lambda do | 18 | + proc do |
19 | render :file => 'content_viewer/image_gallery', :locals => {:article => article} | 19 | render :file => 'content_viewer/image_gallery', :locals => {:article => article} |
20 | end | 20 | end |
21 | end | 21 | end |
test/functional/account_controller_test.rb
@@ -770,12 +770,12 @@ class AccountControllerTest < ActionController::TestCase | @@ -770,12 +770,12 @@ class AccountControllerTest < ActionController::TestCase | ||
770 | should 'add extra content on signup forms from plugins' do | 770 | should 'add extra content on signup forms from plugins' do |
771 | class Plugin1 < Noosfero::Plugin | 771 | class Plugin1 < Noosfero::Plugin |
772 | def signup_extra_contents | 772 | def signup_extra_contents |
773 | - lambda {"<strong>Plugin1 text</strong>"} | 773 | + proc {"<strong>Plugin1 text</strong>"} |
774 | end | 774 | end |
775 | end | 775 | end |
776 | class Plugin2 < Noosfero::Plugin | 776 | class Plugin2 < Noosfero::Plugin |
777 | def signup_extra_contents | 777 | def signup_extra_contents |
778 | - lambda {"<strong>Plugin2 text</strong>"} | 778 | + proc {"<strong>Plugin2 text</strong>"} |
779 | end | 779 | end |
780 | end | 780 | end |
781 | 781 | ||
@@ -885,12 +885,12 @@ class AccountControllerTest < ActionController::TestCase | @@ -885,12 +885,12 @@ class AccountControllerTest < ActionController::TestCase | ||
885 | should 'add extra content on login form from plugins' do | 885 | should 'add extra content on login form from plugins' do |
886 | class Plugin1 < Noosfero::Plugin | 886 | class Plugin1 < Noosfero::Plugin |
887 | def login_extra_contents | 887 | def login_extra_contents |
888 | - lambda {"<strong>Plugin1 text</strong>"} | 888 | + proc {"<strong>Plugin1 text</strong>"} |
889 | end | 889 | end |
890 | end | 890 | end |
891 | class Plugin2 < Noosfero::Plugin | 891 | class Plugin2 < Noosfero::Plugin |
892 | def login_extra_contents | 892 | def login_extra_contents |
893 | - lambda {"<strong>Plugin2 text</strong>"} | 893 | + proc {"<strong>Plugin2 text</strong>"} |
894 | end | 894 | end |
895 | end | 895 | end |
896 | 896 |
test/functional/application_controller_test.rb
@@ -516,7 +516,7 @@ class ApplicationControllerTest < ActionController::TestCase | @@ -516,7 +516,7 @@ class ApplicationControllerTest < ActionController::TestCase | ||
516 | { :type => 'before_filter', | 516 | { :type => 'before_filter', |
517 | :method_name => 'filter_plugin', | 517 | :method_name => 'filter_plugin', |
518 | :options => {:only => 'some_method'}, | 518 | :options => {:only => 'some_method'}, |
519 | - :block => lambda {'plugin block called'} } | 519 | + :block => proc {'plugin block called'} } |
520 | end | 520 | end |
521 | end | 521 | end |
522 | 522 |
test/functional/catalog_controller_test.rb
@@ -82,13 +82,13 @@ class CatalogControllerTest < ActionController::TestCase | @@ -82,13 +82,13 @@ class CatalogControllerTest < ActionController::TestCase | ||
82 | should 'include extra content supplied by plugins on catalog item extras' do | 82 | should 'include extra content supplied by plugins on catalog item extras' do |
83 | class Plugin1 < Noosfero::Plugin | 83 | class Plugin1 < Noosfero::Plugin |
84 | def catalog_item_extras(product) | 84 | def catalog_item_extras(product) |
85 | - lambda {"<span id='plugin1'>This is Plugin1 speaking!</span>"} | 85 | + proc {"<span id='plugin1'>This is Plugin1 speaking!</span>"} |
86 | end | 86 | end |
87 | end | 87 | end |
88 | 88 | ||
89 | class Plugin2 < Noosfero::Plugin | 89 | class Plugin2 < Noosfero::Plugin |
90 | def catalog_item_extras(product) | 90 | def catalog_item_extras(product) |
91 | - lambda {"<span id='plugin2'>This is Plugin2 speaking!</span>"} | 91 | + proc {"<span id='plugin2'>This is Plugin2 speaking!</span>"} |
92 | end | 92 | end |
93 | end | 93 | end |
94 | 94 |
test/functional/content_viewer_controller_test.rb
@@ -1229,14 +1229,14 @@ class ContentViewerControllerTest < ActionController::TestCase | @@ -1229,14 +1229,14 @@ class ContentViewerControllerTest < ActionController::TestCase | ||
1229 | should 'add extra content on comment form from plugins' do | 1229 | should 'add extra content on comment form from plugins' do |
1230 | class Plugin1 < Noosfero::Plugin | 1230 | class Plugin1 < Noosfero::Plugin |
1231 | def comment_form_extra_contents(args) | 1231 | def comment_form_extra_contents(args) |
1232 | - lambda { | 1232 | + proc { |
1233 | hidden_field_tag('comment[some_field_id]', 1) | 1233 | hidden_field_tag('comment[some_field_id]', 1) |
1234 | } | 1234 | } |
1235 | end | 1235 | end |
1236 | end | 1236 | end |
1237 | class Plugin2 < Noosfero::Plugin | 1237 | class Plugin2 < Noosfero::Plugin |
1238 | def comment_form_extra_contents(args) | 1238 | def comment_form_extra_contents(args) |
1239 | - lambda { | 1239 | + proc { |
1240 | hidden_field_tag('comment[another_field_id]', 1) | 1240 | hidden_field_tag('comment[another_field_id]', 1) |
1241 | } | 1241 | } |
1242 | end | 1242 | end |
test/functional/home_controller_test.rb
@@ -99,12 +99,12 @@ class HomeControllerTest < ActionController::TestCase | @@ -99,12 +99,12 @@ class HomeControllerTest < ActionController::TestCase | ||
99 | should 'provide a link to make the user authentication' do | 99 | should 'provide a link to make the user authentication' do |
100 | class Plugin1 < Noosfero::Plugin | 100 | class Plugin1 < Noosfero::Plugin |
101 | def alternative_authentication_link | 101 | def alternative_authentication_link |
102 | - lambda {"<a href='plugin1'>Plugin1 link</a>"} | 102 | + proc {"<a href='plugin1'>Plugin1 link</a>"} |
103 | end | 103 | end |
104 | end | 104 | end |
105 | class Plugin2 < Noosfero::Plugin | 105 | class Plugin2 < Noosfero::Plugin |
106 | def alternative_authentication_link | 106 | def alternative_authentication_link |
107 | - lambda {"<a href='plugin2'>Plugin2 link</a>"} | 107 | + proc {"<a href='plugin2'>Plugin2 link</a>"} |
108 | end | 108 | end |
109 | end | 109 | end |
110 | 110 |
test/functional/manage_products_controller_test.rb
@@ -440,12 +440,12 @@ class ManageProductsControllerTest < ActionController::TestCase | @@ -440,12 +440,12 @@ class ManageProductsControllerTest < ActionController::TestCase | ||
440 | should 'include extra content supplied by plugins on products info extras' do | 440 | should 'include extra content supplied by plugins on products info extras' do |
441 | class TestProductInfoExtras1Plugin < Noosfero::Plugin | 441 | class TestProductInfoExtras1Plugin < Noosfero::Plugin |
442 | def product_info_extras(p) | 442 | def product_info_extras(p) |
443 | - lambda {"<span id='plugin1'>This is Plugin1 speaking!</span>"} | 443 | + proc {"<span id='plugin1'>This is Plugin1 speaking!</span>"} |
444 | end | 444 | end |
445 | end | 445 | end |
446 | class TestProductInfoExtras2Plugin < Noosfero::Plugin | 446 | class TestProductInfoExtras2Plugin < Noosfero::Plugin |
447 | def product_info_extras(p) | 447 | def product_info_extras(p) |
448 | - lambda { "<span id='plugin2'>This is Plugin2 speaking!</span>" } | 448 | + proc { "<span id='plugin2'>This is Plugin2 speaking!</span>" } |
449 | end | 449 | end |
450 | end | 450 | end |
451 | 451 |
test/functional/profile_controller_test.rb
@@ -1235,13 +1235,13 @@ class ProfileControllerTest < ActionController::TestCase | @@ -1235,13 +1235,13 @@ class ProfileControllerTest < ActionController::TestCase | ||
1235 | should 'display plugins tabs' do | 1235 | should 'display plugins tabs' do |
1236 | class Plugin1 < Noosfero::Plugin | 1236 | class Plugin1 < Noosfero::Plugin |
1237 | def profile_tabs | 1237 | def profile_tabs |
1238 | - {:title => 'Plugin1 tab', :id => 'plugin1_tab', :content => lambda { 'Content from plugin1.' }} | 1238 | + {:title => 'Plugin1 tab', :id => 'plugin1_tab', :content => proc { 'Content from plugin1.' }} |
1239 | end | 1239 | end |
1240 | end | 1240 | end |
1241 | 1241 | ||
1242 | class Plugin2 < Noosfero::Plugin | 1242 | class Plugin2 < Noosfero::Plugin |
1243 | def profile_tabs | 1243 | def profile_tabs |
1244 | - {:title => 'Plugin2 tab', :id => 'plugin2_tab', :content => lambda { 'Content from plugin2.' }} | 1244 | + {:title => 'Plugin2 tab', :id => 'plugin2_tab', :content => proc { 'Content from plugin2.' }} |
1245 | end | 1245 | end |
1246 | end | 1246 | end |
1247 | 1247 |
test/functional/profile_editor_controller_test.rb
@@ -902,12 +902,12 @@ class ProfileEditorControllerTest < ActionController::TestCase | @@ -902,12 +902,12 @@ class ProfileEditorControllerTest < ActionController::TestCase | ||
902 | should 'add extra content on person info from plugins' do | 902 | should 'add extra content on person info from plugins' do |
903 | class Plugin1 < Noosfero::Plugin | 903 | class Plugin1 < Noosfero::Plugin |
904 | def profile_info_extra_contents | 904 | def profile_info_extra_contents |
905 | - lambda {"<strong>Plugin1 text</strong>"} | 905 | + proc {"<strong>Plugin1 text</strong>"} |
906 | end | 906 | end |
907 | end | 907 | end |
908 | class Plugin2 < Noosfero::Plugin | 908 | class Plugin2 < Noosfero::Plugin |
909 | def profile_info_extra_contents | 909 | def profile_info_extra_contents |
910 | - lambda {"<strong>Plugin2 text</strong>"} | 910 | + proc {"<strong>Plugin2 text</strong>"} |
911 | end | 911 | end |
912 | end | 912 | end |
913 | 913 | ||
@@ -923,12 +923,12 @@ class ProfileEditorControllerTest < ActionController::TestCase | @@ -923,12 +923,12 @@ class ProfileEditorControllerTest < ActionController::TestCase | ||
923 | should 'add extra content on organization info from plugins' do | 923 | should 'add extra content on organization info from plugins' do |
924 | class Plugin1 < Noosfero::Plugin | 924 | class Plugin1 < Noosfero::Plugin |
925 | def profile_info_extra_contents | 925 | def profile_info_extra_contents |
926 | - lambda {"<strong>Plugin1 text</strong>"} | 926 | + proc {"<strong>Plugin1 text</strong>"} |
927 | end | 927 | end |
928 | end | 928 | end |
929 | class Plugin2 < Noosfero::Plugin | 929 | class Plugin2 < Noosfero::Plugin |
930 | def profile_info_extra_contents | 930 | def profile_info_extra_contents |
931 | - lambda {"<strong>Plugin2 text</strong>"} | 931 | + proc {"<strong>Plugin2 text</strong>"} |
932 | end | 932 | end |
933 | end | 933 | end |
934 | 934 |