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
app/models/forum.rb
app/models/gallery.rb
test/functional/account_controller_test.rb
... | ... | @@ -770,12 +770,12 @@ class AccountControllerTest < ActionController::TestCase |
770 | 770 | should 'add extra content on signup forms from plugins' do |
771 | 771 | class Plugin1 < Noosfero::Plugin |
772 | 772 | def signup_extra_contents |
773 | - lambda {"<strong>Plugin1 text</strong>"} | |
773 | + proc {"<strong>Plugin1 text</strong>"} | |
774 | 774 | end |
775 | 775 | end |
776 | 776 | class Plugin2 < Noosfero::Plugin |
777 | 777 | def signup_extra_contents |
778 | - lambda {"<strong>Plugin2 text</strong>"} | |
778 | + proc {"<strong>Plugin2 text</strong>"} | |
779 | 779 | end |
780 | 780 | end |
781 | 781 | |
... | ... | @@ -885,12 +885,12 @@ class AccountControllerTest < ActionController::TestCase |
885 | 885 | should 'add extra content on login form from plugins' do |
886 | 886 | class Plugin1 < Noosfero::Plugin |
887 | 887 | def login_extra_contents |
888 | - lambda {"<strong>Plugin1 text</strong>"} | |
888 | + proc {"<strong>Plugin1 text</strong>"} | |
889 | 889 | end |
890 | 890 | end |
891 | 891 | class Plugin2 < Noosfero::Plugin |
892 | 892 | def login_extra_contents |
893 | - lambda {"<strong>Plugin2 text</strong>"} | |
893 | + proc {"<strong>Plugin2 text</strong>"} | |
894 | 894 | end |
895 | 895 | end |
896 | 896 | ... | ... |
test/functional/application_controller_test.rb
... | ... | @@ -516,7 +516,7 @@ class ApplicationControllerTest < ActionController::TestCase |
516 | 516 | { :type => 'before_filter', |
517 | 517 | :method_name => 'filter_plugin', |
518 | 518 | :options => {:only => 'some_method'}, |
519 | - :block => lambda {'plugin block called'} } | |
519 | + :block => proc {'plugin block called'} } | |
520 | 520 | end |
521 | 521 | end |
522 | 522 | ... | ... |
test/functional/catalog_controller_test.rb
... | ... | @@ -82,13 +82,13 @@ class CatalogControllerTest < ActionController::TestCase |
82 | 82 | should 'include extra content supplied by plugins on catalog item extras' do |
83 | 83 | class Plugin1 < Noosfero::Plugin |
84 | 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 | 86 | end |
87 | 87 | end |
88 | 88 | |
89 | 89 | class Plugin2 < Noosfero::Plugin |
90 | 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 | 92 | end |
93 | 93 | end |
94 | 94 | ... | ... |
test/functional/content_viewer_controller_test.rb
... | ... | @@ -1229,14 +1229,14 @@ class ContentViewerControllerTest < ActionController::TestCase |
1229 | 1229 | should 'add extra content on comment form from plugins' do |
1230 | 1230 | class Plugin1 < Noosfero::Plugin |
1231 | 1231 | def comment_form_extra_contents(args) |
1232 | - lambda { | |
1232 | + proc { | |
1233 | 1233 | hidden_field_tag('comment[some_field_id]', 1) |
1234 | 1234 | } |
1235 | 1235 | end |
1236 | 1236 | end |
1237 | 1237 | class Plugin2 < Noosfero::Plugin |
1238 | 1238 | def comment_form_extra_contents(args) |
1239 | - lambda { | |
1239 | + proc { | |
1240 | 1240 | hidden_field_tag('comment[another_field_id]', 1) |
1241 | 1241 | } |
1242 | 1242 | end | ... | ... |
test/functional/home_controller_test.rb
... | ... | @@ -99,12 +99,12 @@ class HomeControllerTest < ActionController::TestCase |
99 | 99 | should 'provide a link to make the user authentication' do |
100 | 100 | class Plugin1 < Noosfero::Plugin |
101 | 101 | def alternative_authentication_link |
102 | - lambda {"<a href='plugin1'>Plugin1 link</a>"} | |
102 | + proc {"<a href='plugin1'>Plugin1 link</a>"} | |
103 | 103 | end |
104 | 104 | end |
105 | 105 | class Plugin2 < Noosfero::Plugin |
106 | 106 | def alternative_authentication_link |
107 | - lambda {"<a href='plugin2'>Plugin2 link</a>"} | |
107 | + proc {"<a href='plugin2'>Plugin2 link</a>"} | |
108 | 108 | end |
109 | 109 | end |
110 | 110 | ... | ... |
test/functional/manage_products_controller_test.rb
... | ... | @@ -440,12 +440,12 @@ class ManageProductsControllerTest < ActionController::TestCase |
440 | 440 | should 'include extra content supplied by plugins on products info extras' do |
441 | 441 | class TestProductInfoExtras1Plugin < Noosfero::Plugin |
442 | 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 | 444 | end |
445 | 445 | end |
446 | 446 | class TestProductInfoExtras2Plugin < Noosfero::Plugin |
447 | 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 | 449 | end |
450 | 450 | end |
451 | 451 | ... | ... |
test/functional/profile_controller_test.rb
... | ... | @@ -1235,13 +1235,13 @@ class ProfileControllerTest < ActionController::TestCase |
1235 | 1235 | should 'display plugins tabs' do |
1236 | 1236 | class Plugin1 < Noosfero::Plugin |
1237 | 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 | 1239 | end |
1240 | 1240 | end |
1241 | 1241 | |
1242 | 1242 | class Plugin2 < Noosfero::Plugin |
1243 | 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 | 1245 | end |
1246 | 1246 | end |
1247 | 1247 | ... | ... |
test/functional/profile_editor_controller_test.rb
... | ... | @@ -902,12 +902,12 @@ class ProfileEditorControllerTest < ActionController::TestCase |
902 | 902 | should 'add extra content on person info from plugins' do |
903 | 903 | class Plugin1 < Noosfero::Plugin |
904 | 904 | def profile_info_extra_contents |
905 | - lambda {"<strong>Plugin1 text</strong>"} | |
905 | + proc {"<strong>Plugin1 text</strong>"} | |
906 | 906 | end |
907 | 907 | end |
908 | 908 | class Plugin2 < Noosfero::Plugin |
909 | 909 | def profile_info_extra_contents |
910 | - lambda {"<strong>Plugin2 text</strong>"} | |
910 | + proc {"<strong>Plugin2 text</strong>"} | |
911 | 911 | end |
912 | 912 | end |
913 | 913 | |
... | ... | @@ -923,12 +923,12 @@ class ProfileEditorControllerTest < ActionController::TestCase |
923 | 923 | should 'add extra content on organization info from plugins' do |
924 | 924 | class Plugin1 < Noosfero::Plugin |
925 | 925 | def profile_info_extra_contents |
926 | - lambda {"<strong>Plugin1 text</strong>"} | |
926 | + proc {"<strong>Plugin1 text</strong>"} | |
927 | 927 | end |
928 | 928 | end |
929 | 929 | class Plugin2 < Noosfero::Plugin |
930 | 930 | def profile_info_extra_contents |
931 | - lambda {"<strong>Plugin2 text</strong>"} | |
931 | + proc {"<strong>Plugin2 text</strong>"} | |
932 | 932 | end |
933 | 933 | end |
934 | 934 | ... | ... |