rasper 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 472a27927f46ac4330b0c4628c3a8708e1821ca8
4
+ data.tar.gz: fc4bb3b78a22e7e5753eb8cc1bbd53f8dac48e58
5
+ SHA512:
6
+ metadata.gz: beab73d2d45cd97b0b6a4fee99b2cbc712cf2521c965d2b0d738e8998f9bcb99d49866922c5e8ccca923ce3057e2ea4c949b96508e117e937ca123bfe884eb1f
7
+ data.tar.gz: 783ed188fb9e5ab065b17f073dc6f93f0cacf72d84e3aa777744c9e93f3f40b3fe8f3039d3507f041fc5be24349e88b16583e2679541bdfe954503b21e499c9d
@@ -18,8 +18,10 @@ module Rasper
18
18
  class << self
19
19
  def generate(jasper_name, data, params = {})
20
20
  run_with_locale do
21
- set_file_resolver(params)
22
- file_name = File.join(Config.jasper_dir || '.', jasper_name + '.jasper')
21
+ namespace, jasper_name = extract_namespace(jasper_name)
22
+ set_file_resolver(params, namespace)
23
+ file_name = File.join(Config.jasper_dir || '.', namespace,
24
+ jasper_name + '.jasper')
23
25
  jasper_content = File.read(file_name)
24
26
  data = { jasper_name => data }.to_xml
25
27
  xpath_criteria = "/hash/#{jasper_name}/#{jasper_name.singularize}"
@@ -34,16 +36,23 @@ module Rasper
34
36
 
35
37
  private
36
38
 
37
- def set_file_resolver(params)
39
+ def set_file_resolver(params, namespace = '')
38
40
  resolver = FileResolver.new
39
41
  image_directory = Config.image_dir
40
42
  resolver.singleton_class.instance_eval do
41
43
  define_method :resolve_file do |filename|
42
- java::io::File.new("#{image_directory}/#{filename}")
44
+ java::io::File.new(File.join(image_directory, namespace, filename))
43
45
  end
44
46
  end
45
47
  params['REPORT_FILE_RESOLVER'] = resolver
46
48
  end
49
+
50
+ def extract_namespace(name)
51
+ parts = name.split('/')
52
+ jasper_name = parts.pop
53
+ namespace = parts.join('/')
54
+ [namespace, jasper_name]
55
+ end
47
56
  end
48
57
  end
49
- end
58
+ end
@@ -1,3 +1,3 @@
1
1
  module Rasper
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rasper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
5
- prerelease:
4
+ version: 0.1.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Rodrigo Manhães
@@ -18,13 +17,11 @@ dependencies:
18
17
  - - '>='
19
18
  - !ruby/object:Gem::Version
20
19
  version: '0'
21
- none: false
22
20
  requirement: !ruby/object:Gem::Requirement
23
21
  requirements:
24
22
  - - '>='
25
23
  - !ruby/object:Gem::Version
26
24
  version: '0'
27
- none: false
28
25
  prerelease: false
29
26
  type: :runtime
30
27
  - !ruby/object:Gem::Dependency
@@ -34,13 +31,11 @@ dependencies:
34
31
  - - '>='
35
32
  - !ruby/object:Gem::Version
36
33
  version: '0'
37
- none: false
38
34
  requirement: !ruby/object:Gem::Requirement
39
35
  requirements:
40
36
  - - '>='
41
37
  - !ruby/object:Gem::Version
42
38
  version: '0'
43
- none: false
44
39
  prerelease: false
45
40
  type: :runtime
46
41
  - !ruby/object:Gem::Dependency
@@ -50,13 +45,11 @@ dependencies:
50
45
  - - '>='
51
46
  - !ruby/object:Gem::Version
52
47
  version: '0'
53
- none: false
54
48
  requirement: !ruby/object:Gem::Requirement
55
49
  requirements:
56
50
  - - '>='
57
51
  - !ruby/object:Gem::Version
58
52
  version: '0'
59
- none: false
60
53
  prerelease: false
61
54
  type: :runtime
62
55
  - !ruby/object:Gem::Dependency
@@ -66,13 +59,11 @@ dependencies:
66
59
  - - '>='
67
60
  - !ruby/object:Gem::Version
68
61
  version: '0'
69
- none: false
70
62
  requirement: !ruby/object:Gem::Requirement
71
63
  requirements:
72
64
  - - '>='
73
65
  - !ruby/object:Gem::Version
74
66
  version: '0'
75
- none: false
76
67
  prerelease: false
77
68
  type: :development
78
69
  - !ruby/object:Gem::Dependency
@@ -82,13 +73,11 @@ dependencies:
82
73
  - - '>='
83
74
  - !ruby/object:Gem::Version
84
75
  version: '0'
85
- none: false
86
76
  requirement: !ruby/object:Gem::Requirement
87
77
  requirements:
88
78
  - - '>='
89
79
  - !ruby/object:Gem::Version
90
80
  version: '0'
91
- none: false
92
81
  prerelease: false
93
82
  type: :development
94
83
  description: JRuby client to JasperReports API.
@@ -100,11 +89,11 @@ extensions: []
100
89
  extra_rdoc_files: []
101
90
  files:
102
91
  - lib/rasper.rb
103
- - lib/rasper/config.rb
104
- - lib/rasper/compiler.rb
105
- - lib/rasper/version.rb
106
92
  - lib/rasper/locale.rb
107
93
  - lib/rasper/report.rb
94
+ - lib/rasper/config.rb
95
+ - lib/rasper/version.rb
96
+ - lib/rasper/compiler.rb
108
97
  - lib/rasper/jar_loader.rb
109
98
  - README.rst
110
99
  - LICENSE.txt
@@ -115,6 +104,7 @@ files:
115
104
  homepage: https://github.com/rodrigomanhaes/rasper
116
105
  licenses:
117
106
  - MIT
107
+ metadata: {}
118
108
  post_install_message:
119
109
  rdoc_options: []
120
110
  require_paths:
@@ -124,17 +114,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
114
  - - '>='
125
115
  - !ruby/object:Gem::Version
126
116
  version: '0'
127
- none: false
128
117
  required_rubygems_version: !ruby/object:Gem::Requirement
129
118
  requirements:
130
119
  - - '>='
131
120
  - !ruby/object:Gem::Version
132
121
  version: '0'
133
- none: false
134
122
  requirements: []
135
123
  rubyforge_project:
136
- rubygems_version: 1.8.24
124
+ rubygems_version: 2.1.9
137
125
  signing_key:
138
- specification_version: 3
126
+ specification_version: 4
139
127
  summary: JRuby client to JasperReports API. Currently, only does compilation of JRXML files and generation of PDF reports.
140
128
  test_files: []