jasperserver-rails 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -11
- data/lib/generators/jasperserver_rails/install/templates/initializer.rb +1 -1
- data/lib/jasperserver-rails/jasperserver-dsl.rb +3 -2
- data/lib/jasperserver-rails/version.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +100 -0
- data/test/dummy/tmp/reports/test.pdf +0 -0
- data/test/dummy/tmp/reports/test2.pdf +0 -0
- data/test/dummy/tmp/reports/test3.pdf +0 -0
- data/test/dummy/tmp/reports/test4.pdf +0 -0
- data/test/dummy/tmp/reports/test5.pdf +0 -0
- data/test/jasperserver-rails_test.rb +0 -1
- metadata +41 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3be96ca57ac55d3f59b88d09b7579ec01bb7bdf
|
4
|
+
data.tar.gz: aea04c6ad799c8ec5ea31b2cd6f69d7d06d24bd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e2c079da37b27f4144fffc73fa2373538bb4b0db9c24b880e7f6fa545e96a014104e075408cc566b82564ac9516145c2f357c6cea688527cbeb69add5da6754
|
7
|
+
data.tar.gz: a7da3c867d389039c56b279524c199f883291a30a05cc37d2739871c1ea02437865f12fefbd6a861684ce368d474831098b9d59e43cc159f8951b94c43b016e3
|
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# JasperserverRails
|
2
|
-
[![Gem Version](https://
|
3
|
-
[![
|
4
|
-
[![Code Climate](https://
|
2
|
+
[![Gem Version](https://img.shields.io/gem/v/jasperserver-rails.svg)](https://rubygems.org/gems/jasperserver-rails)
|
3
|
+
[![Travis](https://img.shields.io/travis/cmckni3/rails-jasperserver.svg)](https://travis-ci.org/cmckni3/rails-jasperserver)
|
4
|
+
[![Code Climate](https://img.shields.io/codeclimate/github/kabisaict/flow.svg)](https://codeclimate.com/github/cmckni3/jasperserver-rails)
|
5
|
+
[![License](https://img.shields.io/github/license/cmckni3/rails-jasperserver.svg)]()
|
6
|
+
[![Dependency Status](https://img.shields.io/versioneye/d/ruby/jasperserver-rails.svg)](https://www.versioneye.com/user/projects/57028f6bfcd19a004543f84b)
|
5
7
|
|
6
8
|
Download reports in various formats from jasperserver
|
7
9
|
|
@@ -43,7 +45,7 @@ Or install it yourself as:
|
|
43
45
|
|
44
46
|
1. Add jasperserver configuration to config/jasperserver.yml
|
45
47
|
|
46
|
-
|
48
|
+
```yaml
|
47
49
|
development:
|
48
50
|
url: 'http://server:port/jasperserver/'
|
49
51
|
username: 'username'
|
@@ -58,17 +60,29 @@ production:
|
|
58
60
|
url: 'http://server:port/jasperserver/'
|
59
61
|
username: 'username'
|
60
62
|
password: 'password'
|
61
|
-
|
63
|
+
```
|
62
64
|
|
63
|
-
2. Run a report
|
65
|
+
2. Run a report
|
64
66
|
|
65
|
-
|
66
|
-
JasperserverRails::Jasperserver.new.
|
67
|
+
```ruby
|
68
|
+
pdf = JasperserverRails::Jasperserver.new.generate_report do
|
69
|
+
format 'pdf'
|
70
|
+
report '/reports/TestReport'
|
71
|
+
params(Value1: 'Value1')
|
72
|
+
end
|
73
|
+
send_data pdf, filename: 'Test.pdf', type: :pdf
|
74
|
+
```
|
75
|
+
|
76
|
+
3. Download a report using the DSL
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
file_path = Rails.root.join('tmp', 'reports', 'test.pdf')
|
80
|
+
JasperserverRails::Jasperserver.new.run_report file_path do
|
67
81
|
format 'pdf'
|
68
|
-
report '
|
69
|
-
params(
|
82
|
+
report '/reports/TestReport'
|
83
|
+
params(Value1: 'Value1')
|
70
84
|
end
|
71
|
-
|
85
|
+
```
|
72
86
|
|
73
87
|
## TODO
|
74
88
|
|
@@ -1,3 +1,3 @@
|
|
1
1
|
Rails.configuration.after_initialize do
|
2
|
-
Rails.configuration.jasperserver = YAML
|
2
|
+
Rails.configuration.jasperserver = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'jasperserver.yml'))).result).deep_symbolize_keys
|
3
3
|
end
|
@@ -25,12 +25,13 @@ module JasperserverRails
|
|
25
25
|
instance_eval(&block) if block_given?
|
26
26
|
login
|
27
27
|
# Run report
|
28
|
+
params = URI.encode_www_form(self.get_params) if self.get_params.present?
|
28
29
|
report_path = [
|
29
30
|
'rest_v2',
|
30
31
|
'reports',
|
31
|
-
"#{self.get_report}.#{self.get_format}?#{
|
32
|
+
"#{self.get_report}.#{self.get_format}?#{params}"
|
32
33
|
].join '/'
|
33
|
-
|
34
|
+
RestClient.get(
|
34
35
|
URI.join(
|
35
36
|
config[:url],
|
36
37
|
report_path
|
File without changes
|
@@ -0,0 +1,100 @@
|
|
1
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2
|
+
-------------------------------------------------------------------------------------
|
3
|
+
JasperserverRailsTest: test_report_data_is_returned_when_simply_generating_the_report
|
4
|
+
-------------------------------------------------------------------------------------
|
5
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
6
|
+
[1m[36m (1.0ms)[0m [1mbegin transaction[0m
|
7
|
+
-------------------------------------------------------------------------
|
8
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
9
|
+
-------------------------------------------------------------------------
|
10
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
11
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
12
|
+
-------------------------------------------------
|
13
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
14
|
+
-------------------------------------------------
|
15
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
16
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
17
|
+
--------------------------------------------------
|
18
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
19
|
+
--------------------------------------------------
|
20
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
21
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
22
|
+
--------------------------------------------------
|
23
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
24
|
+
--------------------------------------------------
|
25
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
26
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
27
|
+
-------------------------------------------------------------------------------------
|
28
|
+
JasperserverRailsTest: test_report_data_is_returned_when_simply_generating_the_report
|
29
|
+
-------------------------------------------------------------------------------------
|
30
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
31
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
32
|
+
-------------------------------------------------------------------------
|
33
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
34
|
+
-------------------------------------------------------------------------
|
35
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
36
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
37
|
+
-------------------------------------------------
|
38
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
39
|
+
-------------------------------------------------
|
40
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
41
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
42
|
+
--------------------------------------------------
|
43
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
44
|
+
--------------------------------------------------
|
45
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
46
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
47
|
+
--------------------------------------------------
|
48
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
49
|
+
--------------------------------------------------
|
50
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
51
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
52
|
+
-------------------------------------------------------------------------------------
|
53
|
+
JasperserverRailsTest: test_report_data_is_returned_when_simply_generating_the_report
|
54
|
+
-------------------------------------------------------------------------------------
|
55
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
56
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
57
|
+
-------------------------------------------------------------------------
|
58
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
59
|
+
-------------------------------------------------------------------------
|
60
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
61
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
62
|
+
-------------------------------------------------
|
63
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
64
|
+
-------------------------------------------------
|
65
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
66
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
67
|
+
--------------------------------------------------
|
68
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
69
|
+
--------------------------------------------------
|
70
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
71
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
72
|
+
--------------------------------------------------
|
73
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
74
|
+
--------------------------------------------------
|
75
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
76
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
77
|
+
-------------------------------------------------------------------------------------
|
78
|
+
JasperserverRailsTest: test_report_data_is_returned_when_simply_generating_the_report
|
79
|
+
-------------------------------------------------------------------------------------
|
80
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
81
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
82
|
+
-------------------------------------------------------------------------
|
83
|
+
JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
|
84
|
+
-------------------------------------------------------------------------
|
85
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
86
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
87
|
+
-------------------------------------------------
|
88
|
+
JasperserverRailsTest: test_test.pdf_is_generated
|
89
|
+
-------------------------------------------------
|
90
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
91
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
92
|
+
--------------------------------------------------
|
93
|
+
JasperserverRailsTest: test_test2.pdf_is_generated
|
94
|
+
--------------------------------------------------
|
95
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
96
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
97
|
+
--------------------------------------------------
|
98
|
+
JasperserverRailsTest: test_test3.pdf_is_generated
|
99
|
+
--------------------------------------------------
|
100
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -67,7 +67,6 @@ class JasperserverRailsTest < ActiveSupport::TestCase
|
|
67
67
|
end
|
68
68
|
|
69
69
|
test 'report data is returned when simply generating the report' do
|
70
|
-
report_file = 'test/dummy/tmp/reports/test3.pdf'
|
71
70
|
VCR.use_cassette 'test3' do
|
72
71
|
report = JasperserverRails::Jasperserver.new.generate_report do
|
73
72
|
format 'pdf'
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasperserver-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris McKnight
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.0.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.0.2
|
41
41
|
description: ''
|
42
42
|
email:
|
43
43
|
- cmckni3@gmail.com
|
@@ -82,11 +82,18 @@ files:
|
|
82
82
|
- test/dummy/config/initializers/wrap_parameters.rb
|
83
83
|
- test/dummy/config/locales/en.yml
|
84
84
|
- test/dummy/config/routes.rb
|
85
|
+
- test/dummy/db/test.sqlite3
|
86
|
+
- test/dummy/log/test.log
|
85
87
|
- test/dummy/public/404.html
|
86
88
|
- test/dummy/public/422.html
|
87
89
|
- test/dummy/public/500.html
|
88
90
|
- test/dummy/public/favicon.ico
|
89
91
|
- test/dummy/script/rails
|
92
|
+
- test/dummy/tmp/reports/test.pdf
|
93
|
+
- test/dummy/tmp/reports/test2.pdf
|
94
|
+
- test/dummy/tmp/reports/test3.pdf
|
95
|
+
- test/dummy/tmp/reports/test4.pdf
|
96
|
+
- test/dummy/tmp/reports/test5.pdf
|
90
97
|
- test/fixtures/vcr_cassettes/test1.yml
|
91
98
|
- test/fixtures/vcr_cassettes/test2.yml
|
92
99
|
- test/fixtures/vcr_cassettes/test3.yml
|
@@ -113,44 +120,51 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
120
|
version: '0'
|
114
121
|
requirements: []
|
115
122
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.6.14.1
|
117
124
|
signing_key:
|
118
125
|
specification_version: 4
|
119
126
|
summary: Download reports in various formats from jasperserver
|
120
127
|
test_files:
|
128
|
+
- test/dummy/app/controllers/application_controller.rb
|
129
|
+
- test/dummy/app/views/layouts/application.html.erb
|
121
130
|
- test/dummy/app/assets/javascripts/application.js
|
122
131
|
- test/dummy/app/assets/stylesheets/application.css
|
123
|
-
- test/dummy/app/controllers/application_controller.rb
|
124
132
|
- test/dummy/app/helpers/application_helper.rb
|
125
|
-
- test/dummy/
|
126
|
-
- test/dummy/config/
|
127
|
-
- test/dummy/config/boot.rb
|
128
|
-
- test/dummy/config/database.yml
|
129
|
-
- test/dummy/config/environment.rb
|
130
|
-
- test/dummy/config/environments/development.rb
|
133
|
+
- test/dummy/config/routes.rb
|
134
|
+
- test/dummy/config/locales/en.yml
|
131
135
|
- test/dummy/config/environments/production.rb
|
136
|
+
- test/dummy/config/environments/development.rb
|
132
137
|
- test/dummy/config/environments/test.rb
|
138
|
+
- test/dummy/config/environment.rb
|
139
|
+
- test/dummy/config/application.rb
|
140
|
+
- test/dummy/config/database.yml
|
141
|
+
- test/dummy/config/boot.rb
|
133
142
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
134
|
-
- test/dummy/config/initializers/inflections.rb
|
135
|
-
- test/dummy/config/initializers/jasperserver.rb
|
136
143
|
- test/dummy/config/initializers/mime_types.rb
|
137
|
-
- test/dummy/config/initializers/secret_token.rb
|
138
144
|
- test/dummy/config/initializers/session_store.rb
|
139
145
|
- test/dummy/config/initializers/wrap_parameters.rb
|
140
|
-
- test/dummy/config/
|
141
|
-
- test/dummy/config/
|
146
|
+
- test/dummy/config/initializers/jasperserver.rb
|
147
|
+
- test/dummy/config/initializers/secret_token.rb
|
148
|
+
- test/dummy/config/initializers/inflections.rb
|
142
149
|
- test/dummy/config.ru
|
143
|
-
- test/dummy/
|
150
|
+
- test/dummy/script/rails
|
151
|
+
- test/dummy/Rakefile
|
152
|
+
- test/dummy/public/favicon.ico
|
144
153
|
- test/dummy/public/422.html
|
145
154
|
- test/dummy/public/500.html
|
146
|
-
- test/dummy/public/
|
147
|
-
- test/dummy/
|
155
|
+
- test/dummy/public/404.html
|
156
|
+
- test/dummy/db/test.sqlite3
|
157
|
+
- test/dummy/log/test.log
|
158
|
+
- test/dummy/tmp/reports/test4.pdf
|
159
|
+
- test/dummy/tmp/reports/test5.pdf
|
160
|
+
- test/dummy/tmp/reports/test2.pdf
|
161
|
+
- test/dummy/tmp/reports/test3.pdf
|
162
|
+
- test/dummy/tmp/reports/test.pdf
|
148
163
|
- test/dummy/README.rdoc
|
149
|
-
- test/
|
164
|
+
- test/jasperserver-rails_test.rb
|
165
|
+
- test/fixtures/vcr_cassettes/test5.yml
|
166
|
+
- test/fixtures/vcr_cassettes/test4.yml
|
150
167
|
- test/fixtures/vcr_cassettes/test1.yml
|
151
|
-
- test/fixtures/vcr_cassettes/test2.yml
|
152
168
|
- test/fixtures/vcr_cassettes/test3.yml
|
153
|
-
- test/fixtures/vcr_cassettes/
|
154
|
-
- test/fixtures/vcr_cassettes/test5.yml
|
155
|
-
- test/jasperserver-rails_test.rb
|
169
|
+
- test/fixtures/vcr_cassettes/test2.yml
|
156
170
|
- test/test_helper.rb
|