portatext 1.5.11 → 1.5.12
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.
- checksums.yaml +4 -4
- data/lib/portatext/command/api/summary.rb +18 -0
- data/portatext.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd7b75f11ecedf5492ff000f64c625e503c0f5ed
|
4
|
+
data.tar.gz: 4e6ab4f6a32bb1153f351cb3862c6005c81e5fd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eca7ecc3c0ce61e0f0444a9ba34e3bfbbef050c8b8ba09dd5048fed4796f1289dbb16273861a2937c31a040d832095bb34dfd3f8cd73aae65da1bf606591ccc7
|
7
|
+
data.tar.gz: a15bc7121fa4d06c94efa53780d78390ca8c416d2bc61d8428c5e83d5868f618a941808e012402c5cbd6169aa5c191041df95fd6bdb3a98c5687050dc275c011
|
@@ -20,7 +20,20 @@ module PortaText
|
|
20
20
|
set :accept_file, file
|
21
21
|
end
|
22
22
|
|
23
|
+
def by_day
|
24
|
+
set :granularity, 'date'
|
25
|
+
end
|
26
|
+
|
27
|
+
def by_month
|
28
|
+
set :granularity, 'month'
|
29
|
+
end
|
30
|
+
|
31
|
+
def by_week
|
32
|
+
set :granularity, 'week'
|
33
|
+
end
|
34
|
+
|
23
35
|
# rubocop:disable Metrics/MethodLength
|
36
|
+
# rubocop:disable Metrics/AbcSize
|
24
37
|
def endpoint(_method)
|
25
38
|
qs = {}
|
26
39
|
unless @args[:date_from].nil?
|
@@ -31,6 +44,10 @@ module PortaText
|
|
31
44
|
qs[:date_to] = @args[:date_to]
|
32
45
|
@args.delete :date_to
|
33
46
|
end
|
47
|
+
unless @args[:granularity].nil?
|
48
|
+
qs[:granularity] = @args[:granularity]
|
49
|
+
@args.delete :granularity
|
50
|
+
end
|
34
51
|
unless qs.empty?
|
35
52
|
qs = URI.encode_www_form qs
|
36
53
|
return "summary?#{qs}"
|
@@ -38,6 +55,7 @@ module PortaText
|
|
38
55
|
|
39
56
|
'summary'
|
40
57
|
end
|
58
|
+
# rubocop:enable Metrics/AbcSize
|
41
59
|
# rubocop:enable Metrics/MethodLength
|
42
60
|
end
|
43
61
|
end
|
data/portatext.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: portatext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PortaText
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|