Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed an issue using double quotes in views with the coffee_script an…

…d coffee_script_tag helpers.
  • Loading branch information...
commit 3485a7ef3c785e5cab1c3085c678ddab9cf6558d 1 parent 51e4762
@markbates authored
View
2  Rakefile
@@ -17,7 +17,7 @@ Bundler.require
Gemstub.test_framework = :rspec
Gemstub.gem_spec do |s|
- s.version = '1.0.0'
+ s.version = '1.0.1'
# s.rubyforge_project = 'coffeescript_rails'
s.add_dependency('coffee-script')
s.add_dependency('actionpack', '>= 3.0.0')
View
6 coffeebeans.gemspec
@@ -2,16 +2,16 @@
Gem::Specification.new do |s|
s.name = %q{coffeebeans}
- s.version = "1.0.0.20110519134610"
+ s.version = "1.0.1.20110527114144"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = [%q{markbates}]
- s.date = %q{2011-05-19}
+ s.date = %q{2011-05-27}
s.description = %q{coffeebeans was developed by: markbates}
s.email = %q{mark+github@markbates.com}
s.extra_rdoc_files = [%q{LICENSE}]
s.files = [%q{lib/coffeebeans.rb}, %q{LICENSE}]
- s.homepage = %q{}
+ s.homepage = %q{http://github.com/markbates/coffeebeans}
s.require_paths = [%q{lib}]
s.rubygems_version = %q{1.8.2}
s.summary = %q{coffeebeans}
View
2  lib/coffeebeans.rb
@@ -21,7 +21,7 @@ def coffee_script_tag(&block)
end
def coffee_script(&block)
- ::CoffeeScript.compile(capture(&block))
+ ::CoffeeScript.compile(capture(&block)).html_safe
end
end
View
4 spec/dummy/app/views/drinks/index.html.erb
@@ -1,9 +1,9 @@
<%= coffee_script_tag do %>
- alert 'coffee script is awesome!'
+ alert "coffee script is awesome!"
<% end %>
<script>
<%= coffee_script do %>
- alert 'coffee script is really awesome!'
+ alert "coffee script is really awesome!"
<% end %>
</script>
View
2  spec/dummy/app/views/drinks/index.js.coffee
@@ -1 +1 @@
-alert 'i like coffee!'
+alert "i like coffee!"
View
4 spec/request/coffee_script_spec.rb
@@ -5,13 +5,13 @@
scenario "should render a .js.coffee file." do
visit drinks_url(:format => 'js')
- page.should have_content("(function() { alert('i like coffee!'); }).call(this);")
+ page.should have_content('(function() { alert("i like coffee!"); }).call(this);')
end
scenario "should render a block with helper tags" do
visit drinks_url
- page.body.to_s.should == "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<html><head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=US-ASCII\">\n<script type=\"text/javascript\">(function() {\n alert('coffee script is awesome!');\n}).call(this);\n</script><script>\n (function() {\n alert('coffee script is really awesome!');\n}).call(this);\n</script>\n</head></html>\n"
+ page.body.to_s.should == %{<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<html><head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=US-ASCII\">\n<script type=\"text/javascript\">(function() {\n alert("coffee script is awesome!");\n}).call(this);\n</script><script>\n (function() {\n alert("coffee script is really awesome!");\n}).call(this);\n</script>\n</head></html>\n}
end
Please sign in to comment.
Something went wrong with that request. Please try again.