analytics 0.1.5 → 0.1.6

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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/analytics.gemspec +2 -2
  3. data/lib/analytics.rb +6 -6
  4. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
data/analytics.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{analytics}
8
- s.version = "0.1.5"
8
+ s.version = "0.1.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jun Tsai"]
12
- s.date = %q{2011-02-24}
12
+ s.date = %q{2011-02-25}
13
13
  s.description = %q{Analytics System}
14
14
  s.email = %q{jcai@fepss.com}
15
15
  s.extra_rdoc_files = [
data/lib/analytics.rb CHANGED
@@ -121,14 +121,14 @@ module Analytics
121
121
  @client.query("select count(id),#{col} from visitors where site_id=#{@site_id} and created_at > #{yesterday_start} and created_at < #{yesterday_end} group by #{col}").each{|row|
122
122
 
123
123
 
124
- r = @client.query("select count(id) from #{gather_table} where site_id=#{@site_id} and day_time=#{yesterday_start}").fetch_row[0]
124
+ r = @client.query("select count(id) from #{gather_table} where site_id=#{@site_id} and day_time=#{yesterday_start} and #{col}=#{row[1]}").fetch_row[0]
125
125
  if(r == 0 )
126
- @stmt.prepare("insert into #{gather_table}(site_id,pv,day_time,created_at) "+
127
- " values(,?,?,?,?)" )
128
- @stmt.execute(@site_id,pv,yesterday_start,now)
126
+ @stmt.prepare("insert into #{gather_table}(site_id,pv,day_time,created_at,#{col}) "+
127
+ " values(?,?,?,?,?)" )
128
+ @stmt.execute(@site_id,row[0],yesterday_start,now,row[1])
129
129
  else
130
- @stmt.prepare("update #{gather_table} set pv=?,created_at=? where site_id=? and day_time=?")
131
- @stmt.execute(pv,now,@site_id,yesterday_start)
130
+ @stmt.prepare("update #{gather_table} set pv=?,created_at=? where site_id=? and day_time=? and #{col}=?")
131
+ @stmt.execute(row[0],now,@site_id,yesterday_start,row[1])
132
132
  end
133
133
  }
134
134
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: analytics
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 5
10
- version: 0.1.5
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jun Tsai
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-24 00:00:00 +08:00
18
+ date: 2011-02-25 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency