Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

some fix to work better with ruby 1.8.7

  • Loading branch information...
commit 53abd031601e311a1b985be8e0a2fab7fc125375 1 parent e59ea75
@ChristopheBelpaire authored
View
9 lib/prawnto/template_handlers/partials.rb
@@ -33,7 +33,14 @@ def get_file_path(partial_name)
end
def cleaned_path(provided_partial_path)
- *provided_path, file_name = provided_partial_path.split("/")
+ if (RUBY_VERSION > "1.8.7")
+ eval('*provided_path, file_name = provided_partial_path.split("/")')
+ else
+ splitted_provided_partial_path = provided_partial_path.split("/")
+ provided_path = splitted_provided_partial_path[0..-2]
+ file_name = splitted_provided_partial_path.last
+ end
+
file_name = "_"+file_name unless file_name[0] == "_"
File.join(provided_path, file_name)
end
View
8 spec/dummy/app/mailers/pdf_emailer.rb
@@ -1,14 +1,14 @@
class PdfEmailer < ActionMailer::Base
helper :application
- default from: "from@example.com"
-
+ default :from => "from@example.com"
+
def email_with_attachment
@x = 1
-
+
attachments["hello_world.pdf"] = render("test/default_render", :format => :pdf)
mail :subject => "Hello", :to => "test@test.com" do |format|
format.text
end
end
-
+
end
View
2  spec/dummy/config/initializers/session_store.rb
@@ -1,6 +1,6 @@
# Be sure to restart your server when you modify this file.
-Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
+Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
View
2  spec/dummy/config/initializers/wrap_parameters.rb
@@ -5,7 +5,7 @@
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
- wrap_parameters format: [:json]
+ wrap_parameters :format => [:json]
end
# Disable root element in JSON by default.

2 comments on commit 53abd03

@forrest

Nice cleanup. Mind if I pull it?

@ChristopheBelpaire

No problem, but it doesn't solve all 1.8.7 issues :s
Tests do not all pass on 1.8.7.

Please sign in to comment.
Something went wrong with that request. Please try again.