tagomatic 0.1.8 → 0.1.9

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.8
1
+ 0.1.9
@@ -36,8 +36,8 @@ module Tagomatic
36
36
  def normalize(value)
37
37
  value = value.gsub('_', ' ')
38
38
  parts = value.split(' ')
39
- capitalized = parts.map {|p| p.capitalize}
40
- capitalized.join(' ')
39
+ downcased = parts.map {|p| p.downcase}
40
+ downcased.join(' ')
41
41
  end
42
42
 
43
43
  def valid_constraints?
@@ -6,11 +6,13 @@ module Tagomatic
6
6
  result = {}
7
7
  tags_hash.each do |tag,value|
8
8
  next unless value
9
- result[tag] = value.gsub(/www\.[^\.]+\.[a-z]{2,4}/, '').gsub(/ by [a-zA-Z0-9]+[\w ]/, '')
9
+ result[tag] = value.gsub(URL_REGEXP, '').gsub(/ by [a-zA-Z0-9]+[\w ]/, '')
10
10
  end
11
11
  result
12
12
  end
13
13
 
14
+ URL_REGEXP = Regexp.compile("www\.[^\.]+\.[a-z]{2,4}", Regexp::IGNORECASE)
15
+
14
16
  end
15
17
 
16
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tagomatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lukic