beardley 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 578fa8859bab13e041dc787c4b8ca9d546d65347
4
+ data.tar.gz: c26c362c2f9a2a69b2c8ea315d46e88acbf5f5c5
5
+ SHA512:
6
+ metadata.gz: 9b75e981fdb41d8b60f616d454380b97312bd5f0b5f287df030820ebba5d5e0d83a0c3c6d9b1035a3b2ae4357b1118faff23ba15f6811be213618fc2a24b6270
7
+ data.tar.gz: 63826b1dbfe1f325580e1cfcb9e548ea0e1bce022e1a14e6b50f57c4dd091160800bcf2740b8c68550ab97663527aa615a80677d35361df912f466b25205ef92
data/README.rdoc CHANGED
@@ -1,9 +1,9 @@
1
1
  = Beardley
2
2
  {<img src="https://badge.fury.io/rb/beardley.png" alt="Gem Version" />}[http://badge.fury.io/rb/beardley]
3
- {<img src="https://api.travis-ci.org/burisu/beardley.png?branch=master"/>}[https://travis-ci.org/burisu/beardley]
4
- {<img src="https://gemnasium.com/burisu/beardley.png"/>}[https://gemnasium.com/burisu/beardley]
5
- {<img src="https://codeclimate.com/github/burisu/beardley.png" />}[https://codeclimate.com/github/burisu/beardley]
6
- {<img src="https://coveralls.io/repos/burisu/beardley/badge.png?branch=master" alt="Coverage Status" />}[https://coveralls.io/r/burisu/beardley]
3
+ {<img src="https://api.travis-ci.org/ekylibre/beardley.png?branch=master"/>}[https://travis-ci.org/ekylibre/beardley]
4
+ {<img src="https://gemnasium.com/ekylibre/beardley.png"/>}[https://gemnasium.com/ekylibre/beardley]
5
+ {<img src="https://codeclimate.com/github/ekylibre/beardley.png" />}[https://codeclimate.com/github/ekylibre/beardley]
6
+ {<img src="https://coveralls.io/repos/ekylibre/beardley/badge.png?branch=master" alt="Coverage Status" />}[https://coveralls.io/r/ekylibre/beardley]
7
7
 
8
8
  Beardley provides a minimal use of JasperReport.
9
9
 
@@ -81,6 +81,28 @@ module Beardley
81
81
  return to(:xlsx, *args)
82
82
  end
83
83
 
84
+ # Generic method to export to some format like ODT and DOCX as file in the given place
85
+ def to_file(format, *args)
86
+ options = extract_options!(args)
87
+ datasource = args[0]
88
+ path = options[:path] || File.join(Dir.tmpdir, "beardley_#{Time.now.to_i.to_s(36)}_#{rand(100_000_000_000).to_s(36)}.#{format}")
89
+ if format == :pdf
90
+ _JasperPrint = Rjb::import('net.sf.jasperreports.engine.JasperPrint')
91
+ _JasperExportManager = Rjb::import('net.sf.jasperreports.engine.JasperExportManager')
92
+ return _JasperExportManager._invoke('exportReportToPdfFile', 'Lnet.sf.jasperreports.engine.JasperPrint;Ljava.lang.String;', prepare(datasource), Rjb::import('java.lang.String').new(path.to_s))
93
+ elsif Beardley.exporters[format]
94
+ exporter = Beardley.with_warnings { Rjb::import(Beardley.exporters[format]) }.new
95
+ _JRExporterParameter = Rjb::import('net.sf.jasperreports.engine.JRExporterParameter')
96
+ exporter.setParameter(_JRExporterParameter.JASPER_PRINT, prepare(datasource))
97
+ exporter.setParameter(_JRExporterParameter.OUTPUT_FILE_NAME, path.to_s)
98
+ exporter.exportReport
99
+ return path
100
+ else
101
+ raise "Invalid export format: #{format.inspect}"
102
+ end
103
+ end
104
+
105
+
84
106
  # XLS and RTF are not suitable anymore
85
107
  # NOTE: JasperReports can not produce DOC files
86
108
 
@@ -2,8 +2,8 @@
2
2
  module Beardley
3
3
  module VERSION
4
4
  MAJOR = 1
5
- MINOR = 0
6
- PATCH = 2
5
+ MINOR = 1
6
+ PATCH = 0
7
7
  PRE = nil
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
data/lib/beardley.rb CHANGED
@@ -76,38 +76,4 @@ module Beardley
76
76
 
77
77
  autoload :Report, 'beardley/report'
78
78
 
79
- # Rjb::load((["."] +
80
- # Beardley::Core.classpath +
81
- # Beardley::Groovy.classpath +
82
- # Beardley::Barcode.classpath +
83
- # Beardley::XML.classpath +
84
- # Beardley::Batik.classpath).join(File::PATH_SEPARATOR),
85
- # ['-Djava.awt.headless=true', '-Xms128M', '-Xmx256M'])
86
-
87
- # Locale = Rjb::import('java.util.Locale')
88
-
89
- # JRException = Rjb::import('net.sf.jasperreports.engine.JRException')
90
- # JRExporterParameter = Rjb::import('net.sf.jasperreports.engine.JRExporterParameter')
91
- # JRXmlUtils = Rjb::import('net.sf.jasperreports.engine.util.JRXmlUtils')
92
- # JRXPathQueryExecuterFactory = with_warnings { Rjb::import('net.sf.jasperreports.engine.query.JRXPathQueryExecuterFactory') }
93
- # JREmptyDataSource = Rjb::import('net.sf.jasperreports.engine.JREmptyDataSource')
94
- # JROdtExporter = Rjb::import('net.sf.jasperreports.engine.export.oasis.JROdtExporter')
95
- # JROdsExporter = Rjb::import('net.sf.jasperreports.engine.export.oasis.JROdsExporter')
96
- # JRCsvExporter = Rjb::import('net.sf.jasperreports.engine.export.JRCsvExporter')
97
- # JRDocxExporter = Rjb::import('net.sf.jasperreports.engine.export.ooxml.JRDocxExporter')
98
- # JRXlsxExporter = Rjb::import('net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter')
99
-
100
- # JasperCompileManager = Rjb::import('net.sf.jasperreports.engine.JasperCompileManager')
101
- # JasperExportManager = Rjb::import('net.sf.jasperreports.engine.JasperExportManager')
102
- # JasperFillManager = Rjb::import('net.sf.jasperreports.engine.JasperFillManager')
103
- # JasperPrint = Rjb::import('net.sf.jasperreports.engine.JasperPrint')
104
-
105
- # InputSource = Rjb::import('org.xml.sax.InputSource')
106
- # StringReader = Rjb::import('java.io.StringReader')
107
- # HashMap = Rjb::import('java.util.HashMap')
108
- # ByteArrayInputStream = Rjb::import('java.io.ByteArrayInputStream')
109
- # JavaString = Rjb::import('java.lang.String')
110
- # JFreeChart = Rjb::import('org.jfree.chart.JFreeChart')
111
- # JavaStringBuffer = Rjb::import('java.lang.StringBuffer')
112
-
113
79
  end
metadata CHANGED
@@ -1,94 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beardley
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
5
- prerelease:
4
+ version: 1.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Brice Texier
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-02-05 00:00:00.000000000 Z
11
+ date: 2014-09-30 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rjb
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: 1.4.8
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 1.4.8
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rjb-loader
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: 0.0.2
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: 0.0.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
46
55
  - !ruby/object:Gem::Dependency
47
56
  name: rake
48
57
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
58
  requirements:
51
- - - ! '>='
59
+ - - ">="
52
60
  - !ruby/object:Gem::Version
53
61
  version: '10'
54
62
  type: :development
55
63
  prerelease: false
56
64
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
65
  requirements:
59
- - - ! '>='
66
+ - - ">="
60
67
  - !ruby/object:Gem::Version
61
68
  version: '10'
62
69
  - !ruby/object:Gem::Dependency
63
70
  name: coveralls
64
71
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
72
  requirements:
67
- - - ! '>='
73
+ - - ">="
68
74
  - !ruby/object:Gem::Version
69
75
  version: '0.6'
70
76
  type: :development
71
77
  prerelease: false
72
78
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
79
  requirements:
75
- - - ! '>='
80
+ - - ">="
76
81
  - !ruby/object:Gem::Version
77
82
  version: '0.6'
78
83
  - !ruby/object:Gem::Dependency
79
84
  name: bundler
80
85
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
86
  requirements:
83
- - - ! '>'
87
+ - - ">"
84
88
  - !ruby/object:Gem::Version
85
89
  version: '1'
86
90
  type: :development
87
91
  prerelease: false
88
92
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
93
  requirements:
91
- - - ! '>'
94
+ - - ">"
92
95
  - !ruby/object:Gem::Version
93
96
  version: '1'
94
97
  description: Generate reports using JasperReports reporting tool
@@ -110,28 +113,27 @@ files:
110
113
  - vendor/java/jasperreports-5.5.0.jar
111
114
  - vendor/java/jcommon-1.0.15.jar
112
115
  - vendor/java/servlet-api-2.4.jar
113
- homepage: https://github.com/burisu/beardley
116
+ homepage: https://github.com/ekylibre/beardley
114
117
  licenses: []
118
+ metadata: {}
115
119
  post_install_message:
116
120
  rdoc_options: []
117
121
  require_paths:
118
122
  - lib
119
123
  required_ruby_version: !ruby/object:Gem::Requirement
120
- none: false
121
124
  requirements:
122
- - - ! '>='
125
+ - - ">="
123
126
  - !ruby/object:Gem::Version
124
127
  version: '0'
125
128
  required_rubygems_version: !ruby/object:Gem::Requirement
126
- none: false
127
129
  requirements:
128
- - - ! '>='
130
+ - - ">="
129
131
  - !ruby/object:Gem::Version
130
132
  version: '0'
131
133
  requirements: []
132
134
  rubyforge_project:
133
- rubygems_version: 1.8.23
135
+ rubygems_version: 2.2.2
134
136
  signing_key:
135
- specification_version: 3
137
+ specification_version: 4
136
138
  summary: JasperReports integration
137
139
  test_files: []