Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kematzy/86643 to your computer and use it in GitHub Desktop.
Save kematzy/86643 to your computer and use it in GitHub Desktop.
From 4325bb5e77976ba4dff46434aa0860b80d8c6952 Mon Sep 17 00:00:00 2001
From: kematzy <[email protected]>
Date: Tue, 7 Apr 2009 14:21:13 +0800
Subject: [PATCH] [PATCH] Minor code fixes to remove un-necessary Ruby warnings when running scripts with the 'ruby -wKU' options
-- warning: `*' interpreted as argument prefix
-- warning: StringScanner#matchedsize is obsolete; use #matched_size instead
-- warning: instance variable @else not initialized
There's still an issue of warnings output on eval(), but can't work out where that comes from.
(eval):25: warning: statement not reached
(eval):28: warning: statement not reached
Nothing major I know, but it's always a start.
---
lib/haml/helpers.rb | 2 +-
lib/sass/script/lexer.rb | 2 +-
lib/sass/tree/node.rb | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/haml/helpers.rb b/lib/haml/helpers.rb
index 49ca1a8..7af15c1 100644
--- a/lib/haml/helpers.rb
+++ b/lib/haml/helpers.rb
@@ -281,7 +281,7 @@ DEPRECATION WARNING:
The Haml #puts helper is deprecated and will be removed in version 2.4.
Use the #haml_concat helper instead.
END
- haml_concat *args
+ haml_concat(*args)
end
# Outputs text directly to the Haml buffer, with the proper tabulation
diff --git a/lib/sass/script/lexer.rb b/lib/sass/script/lexer.rb
index 0325ef2..86e8feb 100644
--- a/lib/sass/script/lexer.rb
+++ b/lib/sass/script/lexer.rb
@@ -141,7 +141,7 @@ module Sass
end
def last_match_position
- current_position - @scanner.matchedsize
+ current_position - @scanner.matched_size
end
def after_interpolation?
diff --git a/lib/sass/tree/node.rb b/lib/sass/tree/node.rb
index ee66996..d418dee 100644
--- a/lib/sass/tree/node.rb
+++ b/lib/sass/tree/node.rb
@@ -73,7 +73,7 @@ module Sass
res << "\\" * (escapes - 1) << '#{'
else
res << "\\" * [0, escapes - 1].max
- res << Script::Parser.new(scan, line, scan.pos - scan.matchedsize, filename).
+ res << Script::Parser.new(scan, line, scan.pos - scan.matched_size, filename).
parse_interpolated.perform(environment).to_s
end
end
--
1.6.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment