marcandre-backports 1.6.6 → 1.6.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/backports/string.rb +8 -8
  3. metadata +2 -2
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 6
4
- :patch: 6
4
+ :patch: 7
@@ -45,8 +45,8 @@ class String
45
45
  end unless method_defined? :codepoints
46
46
 
47
47
  # Standard in rails. See official documentation[http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Inflections.html]
48
- def constantize(camel_cased_word)
49
- names = camel_cased_word.split('::')
48
+ def constantize
49
+ names = split('::')
50
50
  names.shift if names.empty? || names.first.empty?
51
51
 
52
52
  constant = Object
@@ -57,13 +57,13 @@ class String
57
57
  end unless method_defined? :constantize
58
58
 
59
59
  # Standard in rails. See official documentation[http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Inflections.html]
60
- def dasherize(underscored_word)
61
- underscored_word.gsub(/_/, '-')
60
+ def dasherize
61
+ gsub(/_/, '-')
62
62
  end unless method_defined? :dasherize
63
63
 
64
64
  # Standard in rails. See official documentation[http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Inflections.html]
65
- def demodulize(class_name_in_module)
66
- class_name_in_module.to_s.gsub(/^.*::/, '')
65
+ def demodulize
66
+ gsub(/^.*::/, '')
67
67
  end unless method_defined? :demodulize
68
68
 
69
69
  make_block_optional :each_byte, :each, :each_line, :test_on => "abc"
@@ -147,8 +147,8 @@ class String
147
147
  end unless method_defined? :start_with?
148
148
 
149
149
  # Standard in rails. See official documentation[http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Inflections.html]
150
- def underscore(camel_cased_word)
151
- camel_cased_word.to_s.gsub(/::/, '/').
150
+ def underscore
151
+ gsub(/::/, '/').
152
152
  gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
153
153
  gsub(/([a-z\d])([A-Z])/,'\1_\2').
154
154
  tr("-", "_").
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marcandre-backports
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.6
4
+ version: 1.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Marc-Andr\xC3\xA9 Lafortune"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-30 00:00:00 -07:00
12
+ date: 2009-05-01 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15