aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/inflector.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-02-15 01:24:55 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-02-15 01:24:55 +0000
commit88a3343ed57c01ca358da8473d15fc4d2b4a5bff (patch)
tree3fe773bb113480f68eaea508d241cbaf90eebfde /activesupport/lib/inflector.rb
parent60f7a5cab73fab032fdb73d1a9a8061cf20031d2 (diff)
downloadrails-88a3343ed57c01ca358da8473d15fc4d2b4a5bff.tar.gz
rails-88a3343ed57c01ca358da8473d15fc4d2b4a5bff.tar.bz2
rails-88a3343ed57c01ca358da8473d15fc4d2b4a5bff.zip
Backed out of routing merge.. investigating missing patches
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@616 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/inflector.rb')
-rw-r--r--activesupport/lib/inflector.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/activesupport/lib/inflector.rb b/activesupport/lib/inflector.rb
index a9b2f87be4..065fad3762 100644
--- a/activesupport/lib/inflector.rb
+++ b/activesupport/lib/inflector.rb
@@ -20,11 +20,11 @@ module Inflector
end
def camelize(lower_case_and_underscored_word)
- lower_case_and_underscored_word.to_s.gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }
+ lower_case_and_underscored_word.to_s.gsub(/(^|_)(.)/){$2.upcase}
end
def underscore(camel_cased_word)
- camel_cased_word.to_s.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z])/,'\1_\2').gsub(/([a-z])([A-Z])/,'\1_\2').downcase
+ camel_cased_word.to_s.gsub(/([A-Z]+)([A-Z])/,'\1_\2').gsub(/([a-z])([A-Z])/,'\1_\2').downcase
end
def humanize(lower_case_and_underscored_word)
@@ -47,13 +47,7 @@ module Inflector
Inflector.underscore(Inflector.demodulize(class_name)) +
(separate_class_name_and_id_with_underscore ? "_id" : "id")
end
-
- def constantize(camel_cased_word)
- camel_cased_word.split("::").inject(Object) do |final_type, part|
- final_type = final_type.const_get(part)
- end
- end
-
+
private
def plural_rules #:doc:
[