charted 0.0.3 → 0.0.4
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.md +1 -0
- data/lib/charted.rb +8 -3
- metadata +1 -1
data/README.md
CHANGED
data/lib/charted.rb
CHANGED
@@ -17,9 +17,10 @@ require 'colorize'
|
|
17
17
|
require 'dashes'
|
18
18
|
|
19
19
|
DataMapper::Model.raise_on_save_failure = true
|
20
|
+
DataMapper::Property::String.length(255)
|
20
21
|
|
21
22
|
module Charted
|
22
|
-
VERSION = '0.0.
|
23
|
+
VERSION = '0.0.4'
|
23
24
|
GEOIP = GeoIP.new("#{File.dirname(__FILE__)}/../geoip.dat")
|
24
25
|
JS_FILE = "#{File.dirname(__FILE__)}/../public/charted/script.js"
|
25
26
|
|
@@ -272,8 +273,12 @@ module Charted
|
|
272
273
|
expires: (Date.today + 365*2).to_time)
|
273
274
|
end
|
274
275
|
|
275
|
-
|
276
|
-
|
276
|
+
begin
|
277
|
+
referrer = params[:referrer].to_s
|
278
|
+
referrer = nil if URI.parse(referrer).host == @site.domain || referrer =~ /^\s*$/
|
279
|
+
rescue URI::InvalidURIError
|
280
|
+
referrer = nil
|
281
|
+
end
|
277
282
|
@visitor.visits.create(
|
278
283
|
path: params[:path],
|
279
284
|
title: params[:title],
|