lcbo 1.0.0beta1 → 1.0.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ Version 1.0.0
2
+
3
+ * Fixed issue that affected about 10 products in where if the name began
4
+ with a `(` character the output name would be blank.
5
+
1
6
  Version 1.0.0beta1
2
7
 
3
8
  * Added rule to titlecase helper to account for names like L'Andéol.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Carsten Nielsen
1
+ Copyright (c) 2011 Carsten Nielsen
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of
4
4
  this software and associated documentation files (the "Software"), to deal in
@@ -34,7 +34,7 @@ module LCBO
34
34
  def self.titlecase(string)
35
35
  preclean = lambda { |s|
36
36
  # Strip bracketed stuff and trailing junk: Product (Junk)**
37
- s.gsub(/\(.+\Z/, '').gsub(/\*+\Z/, '').strip
37
+ s.gsub(/\((.+?)\)|\*+|\((.+?)\Z/, '').strip
38
38
  }
39
39
  count = 0 # Ewwww
40
40
  capitalize(preclean.(string)).split.map do |word|
data/lib/lcbo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module LCBO
2
- VERSION = '1.0.0beta1'
2
+ VERSION = '1.0.0'
3
3
  end
@@ -13,6 +13,8 @@ describe LCBO::CrawlKit::TitleCaseHelper do
13
13
  'SOME NICE VQA WINE' => 'Some Nice VQA Wine',
14
14
  'A PRODUCT NAME (WITH STUPID CRAP' => 'A Product Name',
15
15
  'A PRODUCT NAME (FROM FRANCE)' => 'A Product Name',
16
+ '(V) SOME PRODUCT (FROM FRANCE' => 'Some Product',
17
+ '(V) A PRODUCT ** (FROM FRANCE)' => 'A Product',
16
18
  'SOMEONE\'S PRODUCT' => 'Someone\'s Product',
17
19
  'CUVÉE DE L\'ÉCUSSON BRUT' => 'Cuvée de L\'Écusson Brut' }
18
20
 
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lcbo
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: true
4
+ prerelease: false
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 0beta1
9
- version: 1.0.0beta1
8
+ - 0
9
+ version: 1.0.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Carsten Nielsen
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-07 00:00:00 -05:00
17
+ date: 2011-01-17 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency