skinny_jeans 0.6.2 → 0.6.3

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/README.rdoc CHANGED
@@ -17,7 +17,7 @@ http://img696.imageshack.us/img696/75/skinnys3.jpg
17
17
  2010-10-02, my-first-post, 1
18
18
  * and 1 SQL row in the pageview_keywords table that look like: (search referrals ONLY, but... WITH keyword tracking)
19
19
  2010-10-02, "my-first-post", 2, "some stuff"
20
- * note the date columns truncate timestamp, so the days are in whatever timezone your log file reports in
20
+ * as long as you have the time zone in the log file, the timestamp will be converted and persisted as utc
21
21
 
22
22
 
23
23
  == WHY?
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.6.3
@@ -134,7 +134,9 @@ module SkinnyJeans
134
134
 
135
135
  # return a ruby Time object
136
136
  def parse_string_as_date(date_string = "02/Oct/2010:11:17:44 -0700")
137
- day,month,year,hour,minute,seconds,zone = date_string.scan(/(\d{1,2})\/(\w{3,5})\/(\d{4}):(\d\d):(\d\d):(\d\d)\s(-?\d{3,4})/).flatten
137
+ # "02/Oct/2010:11:17:44 -0700"
138
+ # "13/Feb/2011:22:18:39 +0000"
139
+ day,month,year,hour,minute,seconds,zone = date_string.scan(/(\d{1,2})\/(\w{3,5})\/(\d{4}):(\d\d):(\d\d):(\d\d)\s([-\+]?\d{3,4})/).flatten
138
140
  Time.parse("#{year}-#{month}-#{day} #{hour}:#{minute}:#{seconds} #{zone}")
139
141
  end
140
142
 
@@ -6,6 +6,20 @@ require 'pp'
6
6
  class SkinnyJeansTest < Test::Unit::TestCase
7
7
 
8
8
 
9
+ def test_can_parse_default_nginx_log_format
10
+ db_path = File.expand_path(File.dirname(__FILE__) + "/skinny_jeans_test.db")
11
+ FileUtils.rm(db_path) if File.exists?(db_path)
12
+ _logfile_path = File.expand_path(File.dirname(__FILE__) + "/small_access_log_default_params.log")
13
+ sj=SkinnyJeans::LogParser.execute(_logfile_path, sqlite_skinny_jeans = db_path, path_regexp = /\s\/deals\/(.*)\sHTTP/, date_regexp = /\[(\d.*\d)\]/)
14
+ assert_equal 4, sj.pageview.count
15
+ assert_equal 4, sj.pageview.find_all_by_date("2011-02-13").count
16
+ assert_equal 1, sj.pageview.find_by_path("tron-evolution-for-xbox-360").pageview_count
17
+ assert_equal 1, sj.pageview.find_by_path("samsung-pn50c590-50-inch-plasma-hdtv").pageview_count
18
+ assert_equal 1, sj.pageview.find_by_path("cheap-ipad-deals").pageview_count
19
+ assert_equal 1, sj.pageview.find_by_path("buffalo-drivestation-axis-2tb-external-hard-drive").pageview_count
20
+ end
21
+
22
+
9
23
  def test_parse_pick_up_where_left_off
10
24
  db_path = File.expand_path(File.dirname(__FILE__) + "/skinny_jeans_test.db")
11
25
  # db_path = "./skinny_jeans_test.db"
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skinny_jeans
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 6
9
- - 2
10
- version: 0.6.2
8
+ - 3
9
+ version: 0.6.3
11
10
  platform: ruby
12
11
  authors:
13
12
  - Jonathan Otto
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-01-07 00:00:00 -06:00
17
+ date: 2011-02-13 00:00:00 -06:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -26,7 +25,6 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- hash: 23
30
28
  segments:
31
29
  - 1
32
30
  - 2
@@ -42,7 +40,6 @@ dependencies:
42
40
  requirements:
43
41
  - - ">="
44
42
  - !ruby/object:Gem::Version
45
- hash: 19
46
43
  segments:
47
44
  - 2
48
45
  - 3
@@ -60,7 +57,6 @@ extra_rdoc_files:
60
57
  - README.rdoc
61
58
  - TODO
62
59
  files:
63
- - .gitignore
64
60
  - README.rdoc
65
61
  - Rakefile
66
62
  - TODO
@@ -76,8 +72,8 @@ homepage: http://github.com/jotto/skinny_jeans
76
72
  licenses: []
77
73
 
78
74
  post_install_message:
79
- rdoc_options:
80
- - --charset=UTF-8
75
+ rdoc_options: []
76
+
81
77
  require_paths:
82
78
  - lib
83
79
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -85,7 +81,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
85
81
  requirements:
86
82
  - - ">="
87
83
  - !ruby/object:Gem::Version
88
- hash: 3
89
84
  segments:
90
85
  - 0
91
86
  version: "0"
@@ -94,7 +89,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
89
  requirements:
95
90
  - - ">="
96
91
  - !ruby/object:Gem::Version
97
- hash: 3
98
92
  segments:
99
93
  - 0
100
94
  version: "0"
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- *.db
2
- *.gz
3
- *.log
4
- pkg
5
- .DS*