plausible_api 0.1.8 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 725e6a56e5cee867b7d2440667a399d13c9310b37acb54a910cb7f26087273f3
4
- data.tar.gz: eea16b022039a10cf041030efab80f610ffe010a0adbbb561ceb9180ca6b9a81
3
+ metadata.gz: 5fcd7e3adaeb1c8fb8dc1de67e305573708d04e971e995bcffeb4d0fe71ec8ff
4
+ data.tar.gz: b729b5a5de1b5f6572c175879e77daed92aba1cc60075033b1e693752e13b7ce
5
5
  SHA512:
6
- metadata.gz: e760b16016faa8c19ec11698da4412d1432c36ab77569440cc4b532959c78489691ff238204c7e248973ce74a5d40aaaa54f7cfbfbaebaeb9e5cc28d7cebd438
7
- data.tar.gz: 2e0a07adcb710d4133e44dac5cd8fa783553b1f5a8733b106f031fe63ff7a9fa6b3e22af0fdeeec13880274405f99de1417e3baf297b22d5187e8ab7eb12c78c
6
+ metadata.gz: 0d0757ae94943225433757648bc542dd2afa2a1706696b35cdb179f7f117cb8a8b34581ea0bc7a50ac1d8973c137206bf520e2b6d27129d06c7ff310ca757d6e
7
+ data.tar.gz: db68b71615cb9026ae5a9dddaa1fee92c51740d0314f556e032cd0975ea71675fbade8733e80c1b4975e53d64d7f1347747b10cb1a73b8f5c034d29b3f396590
data/Gemfile.lock CHANGED
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- plausible_api (0.1.8)
4
+ plausible_api (0.1.10)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- minitest (5.14.3)
9
+ minitest (5.14.4)
10
10
  rake (12.3.3)
11
11
 
12
12
  PLATFORMS
@@ -6,7 +6,7 @@ module PlausibleApi
6
6
 
7
7
  def initialize(options = {})
8
8
  super({ period: '30d',
9
- metrics: 'visitors,pageviews,bounce_rate,visit_duration' }
9
+ metrics: 'visitors,visits,pageviews,views_per_visit,bounce_rate,visit_duration,events' }
10
10
  .merge(options))
11
11
  end
12
12
 
@@ -19,4 +19,4 @@ module PlausibleApi
19
19
  end
20
20
  end
21
21
  end
22
- end
22
+ end
@@ -6,7 +6,7 @@ module PlausibleApi
6
6
 
7
7
  def initialize(options = {})
8
8
  @options = { compare: nil, date: nil, filters: nil, interval: nil,
9
- limit: nil, metrics: nil, page: nil, period: nil,
9
+ limit: nil, metrics: nil, page: nil, period: nil,
10
10
  property: nil }.merge(options)
11
11
  @options[:period] = 'custom' if @options[:date]
12
12
  end
@@ -28,22 +28,22 @@ module PlausibleApi
28
28
  errors.empty?
29
29
  end
30
30
 
31
- def errors
31
+ def errors
32
32
  allowed_period = %w(12mo 6mo month 30d 7d day custom)
33
- allowed_metrics = %w(visitors pageviews bounce_rate visit_duration)
33
+ allowed_metrics = %w(visitors visits pageviews views_per_visit bounce_rate visit_duration events)
34
34
  allowed_compare = %w(previous_period)
35
35
  allowed_interval = %w(date month)
36
- allowed_property = %w(event:page visit:source visit:referrer visit:utm_medium
37
- visit:utm_source visit:utm_campaign visit:device visit:browser visit:browser_version
38
- visit:os visit:os_version visit:country)
36
+ allowed_property = %w(event:page visit:entry_page visit:exit_page visit:source visit:referrer
37
+ visit:utm_medium visit:utm_source visit:utm_campaign visit:device visit:browser
38
+ visit:browser_version visit:os visit:os_version visit:country)
39
39
  e = 'Not a valid parameter. Allowed parameters are: '
40
-
40
+
41
41
  errors = []
42
42
  if @options[:period]
43
43
  errors.push({ period: "#{e}#{allowed_period.join(', ')}" }) unless allowed_period.include? @options[:period]
44
44
  end
45
45
  if @options[:metrics]
46
- metrics_array = @options[:metrics].split(',')
46
+ metrics_array = @options[:metrics].split(',')
47
47
  errors.push({ metrics: "#{e}#{allowed_metrics.join(', ')}" }) unless metrics_array & allowed_metrics == metrics_array
48
48
  end
49
49
  if @options[:compare]
@@ -81,4 +81,4 @@ module PlausibleApi
81
81
  end
82
82
  end
83
83
  end
84
- end
84
+ end
@@ -1,3 +1,3 @@
1
1
  module PlausibleApi
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plausible_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gustavo Garcia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-23 00:00:00.000000000 Z
11
+ date: 2023-07-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A very humble wrapper for the new API by Plausible
14
14
  email:
@@ -57,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
59
  requirements: []
60
- rubygems_version: 3.1.4
60
+ rubygems_version: 3.3.7
61
61
  signing_key:
62
62
  specification_version: 4
63
63
  summary: A simple Plausible API wrapper for Rails