reports_kit 0.0.4 → 0.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9581b24b70baa0044e6374c8c81ddcac8b4d3519
4
- data.tar.gz: a239fd95c0851c84c53436bcfd0042ff080d67af
3
+ metadata.gz: bfc4163f7d65491eef12e9aed2a4d9a9f2eb4360
4
+ data.tar.gz: 5a6b2eda37ee37daf47b5f7a7bb570c33094b58a
5
5
  SHA512:
6
- metadata.gz: 5e416d8a02101241cbe7ac1de8995a7841c536f07f3ef6f7d4b4a7a2b3c91fb8127687d32f7126ea6a44729ccbeec058be62f1893bfa2cc51f9aa330b3afd997
7
- data.tar.gz: e13c1072cf65fb9abf59f6e2dbd1fb1420ba5eb2840a2e81ac8c2144198c9903d0c4e9df203f9655616f0027820d15ef43cd9c29176c54d147a0ac12ff85efab
6
+ metadata.gz: 8e9dbc3e6cbad326e9b4a29fc5b7ac15c06dd51f415c982d1f5be98fa1284e43ca40fd4d9b5a17ec971d1664d38e217e871e19d094ac6b8c597767c00a4bb2a2
7
+ data.tar.gz: 797554809a04e2427d41c27d4c14ca529979c5068aeb85fd3ff03f2ebbe2680229273b72137fa7e4fe175b1c4e5d3f620ae59897ee73349f475f1a30147caf1c
@@ -0,0 +1,7 @@
1
+ appraise 'mysql' do
2
+ gem 'mysql2'
3
+ end
4
+
5
+ appraise 'postgresql' do
6
+ gem 'pg'
7
+ end
data/README.md CHANGED
@@ -2,25 +2,23 @@ ReportsKit
2
2
  =====
3
3
  ReportsKit lets you easily create beautiful charts with customizable, interactive filters.
4
4
 
5
- Add powerful reporting to your Rails app in minutes, not months!
6
-
7
5
  For interactive examples, see [reportskit.co](https://www.reportskit.co/).
8
6
 
9
7
  ---
10
8
 
11
- [<img src="docs/images/demo.gif?raw=true" width="500" />](docs/images/demo.gif?raw=true)
12
-
13
- [<img src="docs/images/demo_area.png?raw=true" width="500" />](docs/images/demo_area.png?raw=true)
14
-
15
- [<img src="docs/images/demo_dashed_line.png?raw=true" width="500" />](docs/images/demo_dashed_line.png?raw=true)
9
+ [<img src="docs/images/demo.gif?raw=true" width="700" />](docs/images/demo.gif?raw=true)
16
10
 
17
- [<img src="docs/images/demo_horizontal_stacked.png?raw=true" width="500" />](docs/images/demo_horizontal_stacked.png?raw=true)
11
+ [<img src="docs/images/demo_area.png?raw=true" width="425" />](docs/images/demo_area.png?raw=true)
12
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
13
+ [<img src="docs/images/demo_dashed_line.png?raw=true" width="425" />](docs/images/demo_dashed_line.png?raw=true)
18
14
 
19
- [<img src="docs/images/demo_legend.png?raw=true" width="500" />](docs/images/demo_legend.png?raw=true)
15
+ [<img src="docs/images/demo_horizontal_stacked.png?raw=true" width="425" />](docs/images/demo_horizontal_stacked.png?raw=true)
16
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
17
+ [<img src="docs/images/demo_legend.png?raw=true" width="425" />](docs/images/demo_legend.png?raw=true)
20
18
 
21
- [<img src="docs/images/demo_multiautocomplete.png?raw=true" width="500" />](docs/images/demo_multiautocomplete.png?raw=true)
22
-
23
- [<img src="docs/images/demo_radar.png?raw=true" width="250" />](docs/images/demo_radar.png?raw=true)
19
+ [<img src="docs/images/demo_multiautocomplete.png?raw=true" width="425" />](docs/images/demo_multiautocomplete.png?raw=true)
20
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
21
+ [<img src="docs/images/demo_radar.png?raw=true" width="230" />](docs/images/demo_radar.png?raw=true)
24
22
 
25
23
  ---
26
24
 
@@ -34,7 +32,7 @@ Resources
34
32
  * [Installation](#installation)
35
33
  * [Quick Start](#quick-start)
36
34
  * [Examples](https://www.reportskit.co/)
37
- * [Documentation](documentation)
35
+ * [Documentation](docs)
38
36
 
39
37
  Installation
40
38
  ------------
@@ -115,7 +113,16 @@ In the Quick Start chart, `measure: 'user'` tells ReportsKit to count the number
115
113
  To learn how to use more of ReportsKit's features, check out the following resources:
116
114
 
117
115
  * [Examples](https://www.reportskit.co/)
118
- * [Documentation](documentation)
116
+ * [Documentation](docs)
117
+
118
+ Testing
119
+ -------
120
+
121
+ ReportsKit is tested against PostgreSQL and MySQL. If you'd like to submit a PR, please be sure to use [Appraisal](https://github.com/thoughtbot/appraisal) to test your changes in both contexts:
122
+
123
+ ```bash
124
+ appraisal rspec
125
+ ```
119
126
 
120
127
  License
121
128
  -------
@@ -1,7 +1,8 @@
1
1
  Documentation
2
2
  -------------
3
3
 
4
- 1. [Measures](docs/measures.md)
5
- 1. [Dimensions](docs/dimensions.md)
6
- 1. [Display Options](docs/display_options.md)
7
- 1. [Filters](docs/filters.md)
4
+ 1. [Measures](measures.md)
5
+ 1. [Dimensions](dimensions.md)
6
+ 1. [Filters](filters.md)
7
+ 1. [Display Options](display_options.md)
8
+ 1. [Examples](https://www.reportskit.co/)
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "mysql2"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,154 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ reports_kit (0.0.4)
5
+ rails (>= 3)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (5.1.2)
11
+ actionpack (= 5.1.2)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (~> 0.6.1)
14
+ actionmailer (5.1.2)
15
+ actionpack (= 5.1.2)
16
+ actionview (= 5.1.2)
17
+ activejob (= 5.1.2)
18
+ mail (~> 2.5, >= 2.5.4)
19
+ rails-dom-testing (~> 2.0)
20
+ actionpack (5.1.2)
21
+ actionview (= 5.1.2)
22
+ activesupport (= 5.1.2)
23
+ rack (~> 2.0)
24
+ rack-test (~> 0.6.3)
25
+ rails-dom-testing (~> 2.0)
26
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
+ actionview (5.1.2)
28
+ activesupport (= 5.1.2)
29
+ builder (~> 3.1)
30
+ erubi (~> 1.4)
31
+ rails-dom-testing (~> 2.0)
32
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
+ activejob (5.1.2)
34
+ activesupport (= 5.1.2)
35
+ globalid (>= 0.3.6)
36
+ activemodel (5.1.2)
37
+ activesupport (= 5.1.2)
38
+ activerecord (5.1.2)
39
+ activemodel (= 5.1.2)
40
+ activesupport (= 5.1.2)
41
+ arel (~> 8.0)
42
+ activesupport (5.1.2)
43
+ concurrent-ruby (~> 1.0, >= 1.0.2)
44
+ i18n (~> 0.7)
45
+ minitest (~> 5.1)
46
+ tzinfo (~> 1.1)
47
+ appraisal (2.2.0)
48
+ bundler
49
+ rake
50
+ thor (>= 0.14.0)
51
+ arel (8.0.0)
52
+ builder (3.2.3)
53
+ coderay (1.1.1)
54
+ concurrent-ruby (1.0.5)
55
+ database_cleaner (1.6.1)
56
+ diff-lcs (1.3)
57
+ erubi (1.6.1)
58
+ factory_girl (4.8.0)
59
+ activesupport (>= 3.0.0)
60
+ globalid (0.4.0)
61
+ activesupport (>= 4.2.0)
62
+ i18n (0.8.4)
63
+ loofah (2.0.3)
64
+ nokogiri (>= 1.5.9)
65
+ mail (2.6.6)
66
+ mime-types (>= 1.16, < 4)
67
+ method_source (0.8.2)
68
+ mime-types (3.1)
69
+ mime-types-data (~> 3.2015)
70
+ mime-types-data (3.2016.0521)
71
+ mini_portile2 (2.2.0)
72
+ minitest (5.10.2)
73
+ mysql2 (0.4.7)
74
+ nio4r (2.1.0)
75
+ nokogiri (1.8.0)
76
+ mini_portile2 (~> 2.2.0)
77
+ pg (0.21.0)
78
+ pry (0.10.4)
79
+ coderay (~> 1.1.0)
80
+ method_source (~> 0.8.1)
81
+ slop (~> 3.4)
82
+ rack (2.0.3)
83
+ rack-test (0.6.3)
84
+ rack (>= 1.0)
85
+ rails (5.1.2)
86
+ actioncable (= 5.1.2)
87
+ actionmailer (= 5.1.2)
88
+ actionpack (= 5.1.2)
89
+ actionview (= 5.1.2)
90
+ activejob (= 5.1.2)
91
+ activemodel (= 5.1.2)
92
+ activerecord (= 5.1.2)
93
+ activesupport (= 5.1.2)
94
+ bundler (>= 1.3.0, < 2.0)
95
+ railties (= 5.1.2)
96
+ sprockets-rails (>= 2.0.0)
97
+ rails-dom-testing (2.0.3)
98
+ activesupport (>= 4.2.0)
99
+ nokogiri (>= 1.6)
100
+ rails-html-sanitizer (1.0.3)
101
+ loofah (~> 2.0)
102
+ railties (5.1.2)
103
+ actionpack (= 5.1.2)
104
+ activesupport (= 5.1.2)
105
+ method_source
106
+ rake (>= 0.8.7)
107
+ thor (>= 0.18.1, < 2.0)
108
+ rake (12.0.0)
109
+ rspec (3.6.0)
110
+ rspec-core (~> 3.6.0)
111
+ rspec-expectations (~> 3.6.0)
112
+ rspec-mocks (~> 3.6.0)
113
+ rspec-core (3.6.0)
114
+ rspec-support (~> 3.6.0)
115
+ rspec-expectations (3.6.0)
116
+ diff-lcs (>= 1.2.0, < 2.0)
117
+ rspec-support (~> 3.6.0)
118
+ rspec-mocks (3.6.0)
119
+ diff-lcs (>= 1.2.0, < 2.0)
120
+ rspec-support (~> 3.6.0)
121
+ rspec-support (3.6.0)
122
+ slop (3.6.0)
123
+ sprockets (3.7.1)
124
+ concurrent-ruby (~> 1.0)
125
+ rack (> 1, < 3)
126
+ sprockets-rails (3.2.0)
127
+ actionpack (>= 4.0)
128
+ activesupport (>= 4.0)
129
+ sprockets (>= 3.0.0)
130
+ thor (0.19.4)
131
+ thread_safe (0.3.6)
132
+ timecop (0.9.0)
133
+ tzinfo (1.2.3)
134
+ thread_safe (~> 0.1)
135
+ websocket-driver (0.6.5)
136
+ websocket-extensions (>= 0.1.0)
137
+ websocket-extensions (0.1.2)
138
+
139
+ PLATFORMS
140
+ ruby
141
+
142
+ DEPENDENCIES
143
+ appraisal
144
+ database_cleaner (~> 1)
145
+ factory_girl (~> 4)
146
+ mysql2
147
+ pg (>= 0.15)
148
+ pry (~> 0)
149
+ reports_kit!
150
+ rspec (~> 3)
151
+ timecop (~> 0)
152
+
153
+ BUNDLED WITH
154
+ 1.14.6
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "pg"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,152 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ reports_kit (0.0.4)
5
+ rails (>= 3)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (5.1.2)
11
+ actionpack (= 5.1.2)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (~> 0.6.1)
14
+ actionmailer (5.1.2)
15
+ actionpack (= 5.1.2)
16
+ actionview (= 5.1.2)
17
+ activejob (= 5.1.2)
18
+ mail (~> 2.5, >= 2.5.4)
19
+ rails-dom-testing (~> 2.0)
20
+ actionpack (5.1.2)
21
+ actionview (= 5.1.2)
22
+ activesupport (= 5.1.2)
23
+ rack (~> 2.0)
24
+ rack-test (~> 0.6.3)
25
+ rails-dom-testing (~> 2.0)
26
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
+ actionview (5.1.2)
28
+ activesupport (= 5.1.2)
29
+ builder (~> 3.1)
30
+ erubi (~> 1.4)
31
+ rails-dom-testing (~> 2.0)
32
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
+ activejob (5.1.2)
34
+ activesupport (= 5.1.2)
35
+ globalid (>= 0.3.6)
36
+ activemodel (5.1.2)
37
+ activesupport (= 5.1.2)
38
+ activerecord (5.1.2)
39
+ activemodel (= 5.1.2)
40
+ activesupport (= 5.1.2)
41
+ arel (~> 8.0)
42
+ activesupport (5.1.2)
43
+ concurrent-ruby (~> 1.0, >= 1.0.2)
44
+ i18n (~> 0.7)
45
+ minitest (~> 5.1)
46
+ tzinfo (~> 1.1)
47
+ appraisal (2.2.0)
48
+ bundler
49
+ rake
50
+ thor (>= 0.14.0)
51
+ arel (8.0.0)
52
+ builder (3.2.3)
53
+ coderay (1.1.1)
54
+ concurrent-ruby (1.0.5)
55
+ database_cleaner (1.6.1)
56
+ diff-lcs (1.3)
57
+ erubi (1.6.1)
58
+ factory_girl (4.8.0)
59
+ activesupport (>= 3.0.0)
60
+ globalid (0.4.0)
61
+ activesupport (>= 4.2.0)
62
+ i18n (0.8.4)
63
+ loofah (2.0.3)
64
+ nokogiri (>= 1.5.9)
65
+ mail (2.6.6)
66
+ mime-types (>= 1.16, < 4)
67
+ method_source (0.8.2)
68
+ mime-types (3.1)
69
+ mime-types-data (~> 3.2015)
70
+ mime-types-data (3.2016.0521)
71
+ mini_portile2 (2.2.0)
72
+ minitest (5.10.2)
73
+ nio4r (2.1.0)
74
+ nokogiri (1.8.0)
75
+ mini_portile2 (~> 2.2.0)
76
+ pg (0.21.0)
77
+ pry (0.10.4)
78
+ coderay (~> 1.1.0)
79
+ method_source (~> 0.8.1)
80
+ slop (~> 3.4)
81
+ rack (2.0.3)
82
+ rack-test (0.6.3)
83
+ rack (>= 1.0)
84
+ rails (5.1.2)
85
+ actioncable (= 5.1.2)
86
+ actionmailer (= 5.1.2)
87
+ actionpack (= 5.1.2)
88
+ actionview (= 5.1.2)
89
+ activejob (= 5.1.2)
90
+ activemodel (= 5.1.2)
91
+ activerecord (= 5.1.2)
92
+ activesupport (= 5.1.2)
93
+ bundler (>= 1.3.0, < 2.0)
94
+ railties (= 5.1.2)
95
+ sprockets-rails (>= 2.0.0)
96
+ rails-dom-testing (2.0.3)
97
+ activesupport (>= 4.2.0)
98
+ nokogiri (>= 1.6)
99
+ rails-html-sanitizer (1.0.3)
100
+ loofah (~> 2.0)
101
+ railties (5.1.2)
102
+ actionpack (= 5.1.2)
103
+ activesupport (= 5.1.2)
104
+ method_source
105
+ rake (>= 0.8.7)
106
+ thor (>= 0.18.1, < 2.0)
107
+ rake (12.0.0)
108
+ rspec (3.6.0)
109
+ rspec-core (~> 3.6.0)
110
+ rspec-expectations (~> 3.6.0)
111
+ rspec-mocks (~> 3.6.0)
112
+ rspec-core (3.6.0)
113
+ rspec-support (~> 3.6.0)
114
+ rspec-expectations (3.6.0)
115
+ diff-lcs (>= 1.2.0, < 2.0)
116
+ rspec-support (~> 3.6.0)
117
+ rspec-mocks (3.6.0)
118
+ diff-lcs (>= 1.2.0, < 2.0)
119
+ rspec-support (~> 3.6.0)
120
+ rspec-support (3.6.0)
121
+ slop (3.6.0)
122
+ sprockets (3.7.1)
123
+ concurrent-ruby (~> 1.0)
124
+ rack (> 1, < 3)
125
+ sprockets-rails (3.2.0)
126
+ actionpack (>= 4.0)
127
+ activesupport (>= 4.0)
128
+ sprockets (>= 3.0.0)
129
+ thor (0.19.4)
130
+ thread_safe (0.3.6)
131
+ timecop (0.9.0)
132
+ tzinfo (1.2.3)
133
+ thread_safe (~> 0.1)
134
+ websocket-driver (0.6.5)
135
+ websocket-extensions (>= 0.1.0)
136
+ websocket-extensions (0.1.2)
137
+
138
+ PLATFORMS
139
+ ruby
140
+
141
+ DEPENDENCIES
142
+ appraisal
143
+ database_cleaner (~> 1)
144
+ factory_girl (~> 4)
145
+ pg
146
+ pry (~> 0)
147
+ reports_kit!
148
+ rspec (~> 3)
149
+ timecop (~> 0)
150
+
151
+ BUNDLED WITH
152
+ 1.14.6
@@ -11,6 +11,9 @@ require 'reports_kit/resources_controller'
11
11
  require 'reports_kit/reports_controller'
12
12
  require 'reports_kit/version'
13
13
 
14
+ require 'reports_kit/reports/adapters/mysql'
15
+ require 'reports_kit/reports/adapters/postgresql'
16
+
14
17
  require 'reports_kit/reports/data/chart_options'
15
18
  require 'reports_kit/reports/data/generate'
16
19
  require 'reports_kit/reports/data/one_dimension'
@@ -0,0 +1,15 @@
1
+ module ReportsKit
2
+ module Reports
3
+ module Adapters
4
+ class Mysql
5
+ def self.truncate_to_day(column)
6
+ "DATE(#{column})"
7
+ end
8
+
9
+ def self.truncate_to_week(column)
10
+ "DATE_SUB(DATE(#{column}), INTERVAL DAYOFWEEK(#{column}) - 2 DAY)"
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end