AbsoluteRenamer 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AbsoluteRenamer.gemspec +1 -1
- data/VERSION +1 -1
- data/conf/absrenamer/absrenamer.conf +1 -7
- data/lib/absolute_renamer/libs/string.rb +4 -5
- metadata +1 -1
data/AbsoluteRenamer.gemspec
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.4
|
@@ -12,10 +12,4 @@
|
|
12
12
|
|
13
13
|
# used when a value is not available (pdfAuthor for a PNG file, ...)
|
14
14
|
:default_string: '---'
|
15
|
-
|
16
|
-
# Word separator, regular expression statements can be used
|
17
|
-
# default: '\W_'
|
18
|
-
# This string will be used in AbsoluteRenamer just like this :
|
19
|
-
# [^WORD_SEPARATOR]
|
20
|
-
# Then, \W_ => [^\W_]
|
21
|
-
:word_separator: '\W_'
|
15
|
+
|
@@ -4,18 +4,17 @@ class String
|
|
4
4
|
# word_separator: a regular expression used to separate words.
|
5
5
|
# str = "hello.THE world"
|
6
6
|
# str.camelize # => "Hello.The World"
|
7
|
-
# str.camelize(/[\.]/) # => "Hello.The world"
|
8
7
|
# str # => "hello.THE world"
|
9
|
-
def camelize
|
10
|
-
self.clone.camelize!
|
8
|
+
def camelize
|
9
|
+
self.clone.camelize!
|
11
10
|
end
|
12
11
|
|
13
12
|
# Camelizes a string and returns it.
|
14
13
|
# str = "Hello.THE World"
|
15
14
|
# str.camelize! # => "Hello.The World"
|
16
|
-
# str.camelize!(/[\.]/) # => "Hello.The World"
|
17
15
|
# str # => "Hello.The World"
|
18
|
-
def camelize!
|
16
|
+
def camelize!
|
17
|
+
word_separators = /[^a-zA-Z0-9']/
|
19
18
|
self.downcase!
|
20
19
|
self.each_char.each_with_index do |c,i|
|
21
20
|
if self[i-1].chr =~ word_separators or i.zero?
|