skinny_jeans 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.1
1
+ 0.9.2
@@ -40,7 +40,11 @@ module SkinnyJeans
40
40
  if _uri.query.present?
41
41
  _cgi = CGI.parse(_uri.query)
42
42
  if _cgi[param_name]
43
- val = URI.decode(_cgi[param_name].join).strip.downcase
43
+ begin
44
+ val = URI.decode(_cgi[param_name].join).strip.downcase
45
+ rescue ArgumentError => e
46
+ puts "couldn't parse #{_cgi[param_name]}, must not be utf8"
47
+ end
44
48
  return (!val.nil? && val!='' ? val : nil)
45
49
  end
46
50
  end
@@ -56,9 +56,12 @@ class SkinnyJeans::StringParserTest < Test::Unit::TestCase
56
56
  assert_equal "hp coupns", SkinnyJeans::StringParser.return_param_from_valid_url_or_path("http://www.bing.com/search?q=hp+coupns&go=&form=QBLH&qs=n&sk=&sc=8-6","q")
57
57
  assert_equal "dv6 coupon", SkinnyJeans::StringParser.return_param_from_valid_url_or_path("http://www.google.com/url?sa=t&source=web&cd=1&ved=0CCEQFjAA&url=http%3A%2F%2Fdealzon.com%2Fdeals%2Fhp-dv6-laptop&rct=j&q=dv6%20coupon&ei=1Pz7TKb5AoP7lwfEoeSgBQ&usg=AFQjCNGFVL4PvZ59hbxkCFVdmHMayEe3UQ&sig2=Vs7s9a1z2Elm23NVffMJ8A","q")
58
58
  assert_equal "dv6 coupon", SkinnyJeans::StringParser.return_param_from_valid_url_or_path("http://www.google.com/url?sa=t&source=web&cd=1&sqi=2&ved=0CCAQFjAA&url=http%3A%2F%2Fdealzon.com%2Fdeals%2Fhp-dv6-laptop&rct=j&q=dv6%20coupon&ei=xyT7TO7kEYGKlwfT9tSPDA&usg=AFQjCNGFVL4PvZ59hbxkCFVdmHMayEe3UQ&sig2=7pnUG3YTE8sHONsIqLl1sg","q")
59
-
59
+
60
60
  assert_equal "dv6 coupon", SkinnyJeans::StringParser.return_param_from_valid_url_or_path("http://www.google.com/url?sa=t&source=web&cd=1&sqi=2&ved=0CCAQFjAA&url=http%3A%2F%2Fdealzon.com%2Fdeals%2Fhp-dv6-laptop&rct=j&q=dv6%20coupon%20&ei=xyT7TO7kEYGKlwfT9tSPDA&usg=AFQjCNGFVL4PvZ59hbxkCFVdmHMayEe3UQ&sig2=7pnUG3YTE8sHONsIqLl1sg","q")
61
-
61
+
62
+ # this search term has chinese characters in it, as of 2011-04-13, we are just returning nil for them
63
+ assert_equal nil, SkinnyJeans::StringParser.return_param_from_valid_url_or_path("http://www.google.com.hk/search?q=vostro+3400+3450+%C7%F8%B1%F0&client=aff-9991&ie=GB2312&oe=utf8&hl=zh-CN&newwindow=1&channel=searchbutton","q")
64
+
62
65
  end
63
66
 
64
67
  def test_extract_search_query
@@ -10,7 +10,8 @@ class SkinnyJeansTest < Test::Unit::TestCase
10
10
  db_path = File.expand_path(File.dirname(__FILE__) + "/more_sample_data/skinny_jeans_deal_show.db")
11
11
  FileUtils.rm(db_path) if File.exists?(db_path)
12
12
  # broken_access_big.log is 337,925 lines
13
- _logfile_path = File.expand_path(File.dirname(__FILE__) + "/more_sample_data/broken_access_big.log")
13
+ # _logfile_path = File.expand_path(File.dirname(__FILE__) + "/more_sample_data/broken_access_big.log")
14
+ _logfile_path = File.expand_path(File.dirname(__FILE__) + "/more_sample_data/another_broken_access_april_12.log")
14
15
  puts db_path.inspect
15
16
  sj=SkinnyJeans::LogParser.execute(_logfile_path, sqlite_skinny_jeans = db_path, path_regexp = /\s\/deals\/(.*)\sHTTP/, date_regexp = /\[(\d.*\d)\]/)
16
17
  end
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skinny_jeans
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 9
8
- - 1
9
- version: 0.9.1
4
+ prerelease:
5
+ version: 0.9.2
10
6
  platform: ruby
11
7
  authors:
12
8
  - Jonathan Otto
@@ -14,7 +10,7 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2011-03-16 00:00:00 -05:00
13
+ date: 2011-04-13 00:00:00 -05:00
18
14
  default_executable:
19
15
  dependencies:
20
16
  - !ruby/object:Gem::Dependency
@@ -25,10 +21,6 @@ dependencies:
25
21
  requirements:
26
22
  - - ">="
27
23
  - !ruby/object:Gem::Version
28
- segments:
29
- - 1
30
- - 3
31
- - 3
32
24
  version: 1.3.3
33
25
  type: :runtime
34
26
  version_requirements: *id001
@@ -40,10 +32,6 @@ dependencies:
40
32
  requirements:
41
33
  - - ">="
42
34
  - !ruby/object:Gem::Version
43
- segments:
44
- - 3
45
- - 0
46
- - 0
47
35
  version: 3.0.0
48
36
  type: :runtime
49
37
  version_requirements: *id002
@@ -55,10 +43,6 @@ dependencies:
55
43
  requirements:
56
44
  - - ">="
57
45
  - !ruby/object:Gem::Version
58
- segments:
59
- - 1
60
- - 0
61
- - 0
62
46
  version: 1.0.0
63
47
  type: :runtime
64
48
  version_requirements: *id003
@@ -70,10 +54,6 @@ dependencies:
70
54
  requirements:
71
55
  - - ">="
72
56
  - !ruby/object:Gem::Version
73
- segments:
74
- - 1
75
- - 0
76
- - 1
77
57
  version: 1.0.1
78
58
  type: :runtime
79
59
  version_requirements: *id004
@@ -111,21 +91,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
91
  requirements:
112
92
  - - ">="
113
93
  - !ruby/object:Gem::Version
114
- segments:
115
- - 0
116
94
  version: "0"
117
95
  required_rubygems_version: !ruby/object:Gem::Requirement
118
96
  none: false
119
97
  requirements:
120
98
  - - ">="
121
99
  - !ruby/object:Gem::Version
122
- segments:
123
- - 0
124
100
  version: "0"
125
101
  requirements: []
126
102
 
127
103
  rubyforge_project:
128
- rubygems_version: 1.3.7
104
+ rubygems_version: 1.6.2
129
105
  signing_key:
130
106
  specification_version: 3
131
107
  summary: Fast webserver log parser for persisting daily pageviews per path to sqlite