autometal-piwik 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Autometal-Piwik [![Build Status](https://travis-ci.org/Achillefs/autometal-piwik.png?branch=master)](https://travis-ci.org/Achillefs/autometal-piwik)
1
+ # Autometal-Piwik [![Build Status](https://travis-ci.org/piwik/piwik-ruby-api.png?branch=master)](https://travis-ci.org/piwik/piwik-ruby-api)
2
2
 
3
- Version 1.0.0 is a ground-up rewrite of the [autometal-piwik gem](https://github.com/Achillefs/autometal-piwik/tree/v0.6.1). It completely covers the Piwik API and should be easily extendable by users. We made no assumptions on how you wanna use your data, so we closely mirrored Piwik's API structure even if it looks kinda weird to a modern rubyist.
3
+ This is now the official Ruby client for Piwik. It completely covers the Piwik API and should be easily extendable by users. We made no assumptions on how you wanna use your data, so we closely mirrored Piwik's API structure even if it looks kinda weird to a modern rubyist.
4
4
 
5
5
  We will also implement an extended `Piwik::Site` wrapper class that will give you ruby-friendly access to a lot of the data in a way we think is sane, but it will be up to you which interface you want to use.
6
6
 
@@ -33,7 +33,7 @@ Open an extended irb session to a Piwik installation:
33
33
 
34
34
  $ piwik-console -u http://demo.piwik.org -t anonymous
35
35
  :001 > Piwik::Site.load 7
36
- => #<Piwik::Site[snip]>
36
+ #=> #<Piwik::Site[snip]>
37
37
 
38
38
  ### Initialize it
39
39
  Unless you are using the binary, or if you are using the binary without credentials, you need to specify a url and a security token.
@@ -47,24 +47,24 @@ This can take place in your script or a rails initializer or whatever.
47
47
  Fastest way to get to know the client is by using the Piwik::Site wrapper class:
48
48
 
49
49
  site = Piwik::Site.load(7)
50
- => #<Piwik::Site[snip]>
50
+ #=> #<Piwik::Site[snip]>
51
51
 
52
52
  site.annotations.all
53
- => #<Piwik::Annotations[snip]>
53
+ #=> #<Piwik::Annotations[snip]>
54
54
  site.annotations.add(:date => 'today', :starred => 1)
55
- => Piwik::ApiError: Please specify a value for 'note'.
55
+ #=> Piwik::ApiError: Please specify a value for 'note'.
56
56
  site.annotations.add(:note => 'meep', :date => 'today', :starred => 1)
57
- => #<Piwik::Annotations[snip]>
57
+ #=> #<Piwik::Annotations[snip]>
58
58
 
59
59
  summary = site.actions.summary
60
- => #<Piwik::Actions[snip]>
60
+ #=> #<Piwik::Actions[snip]>
61
61
  summary.nb_pageviews
62
- => 236
62
+ #=> 236
63
63
  summary.nb_uniq_pageviews
64
- => 170
64
+ #=> 170
65
65
 
66
66
  Not all methods are implemented on the wrapper class, although if you find yourself adding methods, please submit a pull request.
67
- You can have a look at [site_spec.rb](https://github.com/Achillefs/autometal-piwik/blob/master/spec/site_spec.rb) for an up-to-date list of available methods.
67
+ You can have a look at [site_spec.rb](https://github.com/piwik/piwik-ruby-api/blob/master/spec/site_spec.rb) for an up-to-date list of available methods.
68
68
 
69
69
  ### Use the 'native' API
70
70
  This client also allows you to interact with the API the way its designers wanted it. Any method in the [api reference](http://piwik.org/docs/analytics-api/reference/) is made available almost verbatim:
@@ -72,11 +72,11 @@ This client also allows you to interact with the API the way its designers wante
72
72
  # http://piwik.org/docs/analytics-api/reference/#Actions
73
73
  # Actions.getPageUrls (idSite, period, date, segment = '', expanded = '', idSubtable = '')
74
74
  require 'rubygems'
75
- require 'piwiker'
75
+ require 'piwik'
76
76
  Piwik::PIWIK_URL = 'http://demo.piwik.org'
77
77
  Piwik::PIWIK_TOKEN = 'anonymous'
78
78
  Piwik::Actions.getPageUrls(:idSite => 7, :period => :day, :date => 'yesterday')
79
- => #<Piwik::Actions::PageUrls @data=[snip]>
79
+ #=> #<Piwik::Actions::PageUrls @data=[snip]>
80
80
 
81
81
  That last call is exactly the same as calling `site.actions.page_urls(:period => :day, :date => 'yesterday')`
82
82
 
@@ -19,6 +19,6 @@ Gem::Specification.new do |s|
19
19
 
20
20
  s.add_dependency('xml-simple')
21
21
  s.add_dependency('rest-client')
22
- s.add_dependency('activesupport')
22
+ s.add_dependency('activesupport','~> 3.0')
23
23
  s.add_development_dependency('rspec')
24
24
  end
@@ -25,7 +25,7 @@ Piwik::PIWIK_TOKEN = '#{options[:token_auth]}'
25
25
  end
26
26
 
27
27
  libs = '-rubygems'
28
- libs = ' -r irb/completion'
28
+ libs << ' -r irb/completion'
29
29
  libs << ' -r piwik'
30
30
  libs << ' -r ./.piwik.rc.rb' if File.exists?('./.piwik.rc.rb')
31
31
  exec "irb #{libs}"
@@ -1,3 +1,3 @@
1
1
  module Piwik
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autometal-piwik
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-27 00:00:00.000000000Z
12
+ date: 2013-02-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: xml-simple
16
- requirement: &2160773280 !ruby/object:Gem::Requirement
16
+ requirement: &2168593740 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2160773280
24
+ version_requirements: *2168593740
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rest-client
27
- requirement: &2160772860 !ruby/object:Gem::Requirement
27
+ requirement: &2168592840 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,21 +32,21 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2160772860
35
+ version_requirements: *2168592840
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: activesupport
38
- requirement: &2160772420 !ruby/object:Gem::Requirement
38
+ requirement: &2168592120 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
- - - ! '>='
41
+ - - ~>
42
42
  - !ruby/object:Gem::Version
43
- version: '0'
43
+ version: '3.0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2160772420
46
+ version_requirements: *2168592120
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &2160771980 !ruby/object:Gem::Requirement
49
+ requirement: &2168591340 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2160771980
57
+ version_requirements: *2168591340
58
58
  description: A complete Ruby client for the Piwik API
59
59
  email:
60
60
  - ac@humbuckercode.co.uk