Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base: 6f49eebab1
...
compare: 4d426315c0
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Commits on Sep 11, 2012
@jhass jhass do not raise if piwik_id is a number 513c7ba
Commits on Sep 26, 2012
@GSI GSI Merge pull request #5 from MrZYX/number_as_piwik_id
accept integer value for 'piwik_id'
4d42631
Showing with 11 additions and 2 deletions.
  1. +1 −1  lib/rack/piwik.rb
  2. +10 −1 test/test_rack_piwik.rb
View
2  lib/rack/piwik.rb
@@ -8,7 +8,7 @@ class Piwik
def initialize(app, options = {})
raise ArgumentError, "piwik_url must be present" unless options[:piwik_url] and !options[:piwik_url].empty?
- raise ArgumentError, "piwik_id must be present" unless options[:piwik_id] and !options[:piwik_id].empty?
+ raise ArgumentError, "piwik_id must be present" unless options[:piwik_id] and !options[:piwik_id].to_s.empty?
@app, @options = app, DEFAULT.merge(options)
end
View
11 test/test_rack_piwik.rb
@@ -29,8 +29,17 @@ class TestRackPiwik < Test::Unit::TestCase
assert_no_match %r{Piwik}, last_response.body
assert_match %r{head only}, last_response.body
end
+
+ end
+
+ context "with a number as piwik id" do
+ setup { mock_app :async => true, :tracker => 'somebody', :piwik_url => 'piwik.example.org', :piwik_id => 123 }
+ should "not raise an exception" do
+ assert_nothing_raised do
+ get "/body_only"
+ end
+ end
end
-
end
=begin

No commit comments for this range

Something went wrong with that request. Please try again.