couchup 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,4 +2,23 @@ class String
2
2
  def blank?
3
3
  nil || empty?
4
4
  end
5
+
6
+ def constantize
7
+ Object.const_get(self)
8
+ end
9
+
10
+ def camelize
11
+ gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
12
+ end
13
+ # cargo culted from rails inflector.
14
+ def underscore
15
+ word = dup
16
+ word.gsub!(/::/, '/')
17
+ word.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
18
+ word.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
19
+ word.tr!("-", "_")
20
+ word.downcase!
21
+ word
22
+ end
23
+
5
24
  end
@@ -1,19 +1,13 @@
1
1
  class Symbol
2
2
  def constantize
3
- Object.const_get(to_s)
4
- end
5
-
6
- def camelize
7
- to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
8
- end
9
- # cargo culted from rails inflector.
10
- def underscore
11
- word = to_s.dup
12
- word.gsub!(/::/, '/')
13
- word.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
14
- word.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
15
- word.tr!("-", "_")
16
- word.downcase!
17
- word
18
- end
3
+ to_s.constantize
4
+ end
5
+
6
+ def camelize
7
+ to_s.camelize
8
+ end
9
+ # cargo culted from rails inflector.
10
+ def underscore
11
+ to_s.underscore
12
+ end
19
13
  end
@@ -1,3 +1,3 @@
1
1
  module Couchup
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: couchup
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.6
5
+ version: 0.0.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - V Sreekanth