aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/profile4
-rw-r--r--tools/test.rb12
2 files changed, 14 insertions, 2 deletions
diff --git a/tools/profile b/tools/profile
index eb7fc7792b..191e73b3dd 100755
--- a/tools/profile
+++ b/tools/profile
@@ -117,9 +117,9 @@ rescue LoadError
def camelize(uppercase_first_letter = true)
string = self
if uppercase_first_letter
- string = string.sub(/^[a-z\d]*/) { $&.capitalize }
+ string = string.sub(/^[a-z\d]*/) { |match| match.capitalize }
else
- string = string.sub(/^(?:(?=\b|[A-Z_])|\w)/) { $&.downcase }
+ string = string.sub(/^(?:(?=\b|[A-Z_])|\w)/) { |match| match.downcase }
end
string.gsub(/(?:_|(\/))([a-z\d]*)/) { "#{$1}#{$2.capitalize}" }.gsub('/', '::')
end
diff --git a/tools/test.rb b/tools/test.rb
new file mode 100644
index 0000000000..70f295b554
--- /dev/null
+++ b/tools/test.rb
@@ -0,0 +1,12 @@
+$: << File.expand_path("test", COMPONENT_ROOT)
+require File.expand_path("../../load_paths", __FILE__)
+require "rails/test_unit/minitest_plugin"
+
+module Rails
+ # Necessary to get rerun-snippts working.
+ def self.root
+ @root ||= Pathname.new(COMPONENT_ROOT)
+ end
+end
+
+Rails::TestUnitReporter.executable = "bin/test"