AbsoluteRenamer 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{AbsoluteRenamer}
8
- s.version = "1.0.3"
8
+ s.version = "1.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Simon COURTOIS"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
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(word_separators = /[\W_]/)
10
- self.clone.camelize!(word_separators)
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!(word_separators = /[\W_]/)
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?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: AbsoluteRenamer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon COURTOIS