Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mleglise/jsdebug-rails
base: dc0c95589e
...
head fork: mleglise/jsdebug-rails
compare: 490779a835
  • 4 commits
  • 5 files changed
  • 1 commit comment
  • 2 contributors
View
6 README.md
@@ -48,7 +48,11 @@ To test, change development.rb
config.log_level = :info
+# Contributors
+Marc Leglise
+
## History
* 0.1.0 Initial Release
* 0.2.0 Updating for Rails 3.1
-* 0.3.0 Updating for Rails 3.2
+* 0.3.0 Updating for Rails 3.2
+* 0.3.2 Bug fixes
View
10 lib/jsdebug/processor.rb
@@ -37,9 +37,13 @@ def evaluate(context, locals, &block)
data.each_line do |line|
index += 1
- if(is_jsdebug_allowed? && line.match(log_regex))
- cmd = line.scan(log_regex).first
- new_data << line.gsub(cmd, "#{cmd}'[#{name}::#{index}]', ")
+ if(is_jsdebug_allowed? && line.match(debug_regex))
+ if line.match(log_regex)
+ cmd = line.scan(log_regex).first
+ new_data << line.gsub(cmd, "#{cmd}'[#{name}::#{index}]', ")
+ else
+ new_data << line
+ end
else
if (!is_jsdebug_allowed?)
if line.match(/debug_start/)
View
2  lib/jsdebug/version.rb
@@ -1,5 +1,5 @@
module Jsdebug
module Rails
- VERSION = "0.3.1"
+ VERSION = "0.3.2"
end
end
View
4 test/fixtures/assets/pass_debugs.js
@@ -0,0 +1,4 @@
+debug.group('test');
+var foo = {},
+bar = {};
+debug.groupEnd();
View
10 test/test_debug_processor.rb
@@ -41,4 +41,14 @@ def setup
assert_equal "var str = \"Hello\";\n// debug_start\nstr = str + \" World!\";\ndebug.log('[block_debugs::4]', str);\n// debug_end\nvar str2 = \"Bye\";\n", @env['block_debugs.js'].to_s
end
+ test "javascript compiles without passthrough debug statements" do
+ @logger.stubs(:level).returns(1)
+ assert_equal "var foo = {},\nbar = {};\n", @env['pass_debugs.js'].to_s
+ end
+
+ test "javascript compiles with passthrough debug statements" do
+ @logger.stubs(:level).returns(0)
+ assert_equal "debug.group('test');\nvar foo = {},\nbar = {};\ndebug.groupEnd();\n", @env['pass_debugs.js'].to_s
+ end
+
end

Showing you all comments on commits in this comparison.

@jeremygpeterson

Extra credit for adding tests, merging in.

Something went wrong with that request. Please try again.