rjb-loader 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/README.md +32 -6
- data/lib/rjb-loader/version.rb +1 -1
- data/rjb-loader.gemspec +1 -1
- metadata +51 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6624d39180386b5a2e6327fe08fa86a886ceccec
|
4
|
+
data.tar.gz: 71662d164e506aabaec74d7953ba12676409524d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 129ba0485ae81b0f238cbe14f30e347f6f98ecf5d89d91caec58ffa5589cda091a8537fdcc1c11df97e15e4dd7d9884bde54bfa64c81c216f9808e1c867d5147
|
7
|
+
data.tar.gz: 0604ad96aa0676709559c7033c4637a8f5ab54819864da766a8c2cf5862856a0f32b912d30755da23beb3733d298ded354d21806d316ac0f673a73486e1606fa
|
data/README.md
CHANGED
@@ -4,13 +4,14 @@ Rjb (Ruby Java Bridge) loader with before_load and after_load hooks
|
|
4
4
|
|
5
5
|
# Description
|
6
6
|
When working with multiple gems or several rails initializer files that use Rjb,
|
7
|
-
you need to make sure that java dependencies
|
8
|
-
|
7
|
+
you need to make sure that all java dependencies are set up before running Rjb::load.
|
8
|
+
This is necessary because Rjb can only be loaded once.
|
9
9
|
|
10
|
-
|
10
|
+
As an example, you could use rjb-loader to change classpath and java options.
|
11
|
+
You can do this by adding a 'before_load' hook to your gem or rails initializer.
|
11
12
|
|
12
|
-
The 'after_load' hook
|
13
|
-
For instance, when you need to
|
13
|
+
The 'after_load' hook, on the other hand, should be used when your code needs to run after Rjb::load.
|
14
|
+
For instance, when you need to use java classes.
|
14
15
|
|
15
16
|
## Install
|
16
17
|
|
@@ -30,7 +31,32 @@ For any issues related to the java/ruby integration, please check out: [http://r
|
|
30
31
|
|
31
32
|
## Using rjb-loader
|
32
33
|
|
33
|
-
|
34
|
+
Example from [jasper-rails](http://github.com/fortesinformatica/jasper-rails):
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
...
|
38
|
+
|
39
|
+
RjbLoader.before_load do |config|
|
40
|
+
|
41
|
+
# This code changes the JVM classpath, so it has to run BEFORE loading Rjb.
|
42
|
+
Dir["#{File.dirname(__FILE__)}/java/*.jar"].each do |path|
|
43
|
+
config.classpath << File::PATH_SEPARATOR + File.expand_path(path)
|
44
|
+
end
|
45
|
+
|
46
|
+
# We can also change java options here, if we want to.
|
47
|
+
config.java_options += ['-Xms256M', '-Xmx512M']
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
RjbLoader.after_load do |config|
|
52
|
+
|
53
|
+
# This code needs java classes, so it has to run AFTER loading Rjb.
|
54
|
+
_Locale = Rjb::import 'java.util.Locale'
|
55
|
+
JasperRails.config[:report_params]["REPORT_LOCALE"] = _Locale.new('en', 'US')
|
56
|
+
|
57
|
+
end
|
58
|
+
...
|
59
|
+
```
|
34
60
|
|
35
61
|
## LICENSE
|
36
62
|
|
data/lib/rjb-loader/version.rb
CHANGED
data/rjb-loader.gemspec
CHANGED
@@ -21,6 +21,6 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
22
|
s.require_paths = ["lib"]
|
23
23
|
|
24
|
-
s.add_dependency('rjb', '1.4.
|
24
|
+
s.add_dependency('rjb', '>= 1.4.8')
|
25
25
|
s.add_dependency('rails', '>= 3.2')
|
26
26
|
end
|
metadata
CHANGED
@@ -1,51 +1,56 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rjb-loader
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Marlus Saraiva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2013-08-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
15
14
|
name: rjb
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
version: 1.4.3
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.4.8
|
22
20
|
type: :runtime
|
23
|
-
version_requirements: *id001
|
24
|
-
- !ruby/object:Gem::Dependency
|
25
|
-
name: rails
|
26
21
|
prerelease: false
|
27
|
-
|
28
|
-
requirements:
|
29
|
-
- -
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.4.8
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.2'
|
32
34
|
type: :runtime
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.2'
|
41
|
+
description: "When working with multiple gems or several rails initializer files that
|
42
|
+
use Rjb, \n you need to make sure that all java dependencies
|
43
|
+
of each implementation \n gets set up before running Rjb::load.
|
44
|
+
This is necessary because Rjb can be loaded only once.\n You
|
45
|
+
can use rjb-loader to change classpath and java options, by adding 'before_load'
|
46
|
+
to your gem or rails initializer.\n The 'after_load' hook can
|
47
|
+
be used when your code needs an already loaded Rjb. \n For instance,
|
48
|
+
when you need to import and use java classes."
|
41
49
|
email: marlussaraiva@grupofortes.com.br
|
42
50
|
executables: []
|
43
|
-
|
44
51
|
extensions: []
|
45
|
-
|
46
52
|
extra_rdoc_files: []
|
47
|
-
|
48
|
-
files:
|
53
|
+
files:
|
49
54
|
- .gitignore
|
50
55
|
- Gemfile
|
51
56
|
- LICENSE.txt
|
@@ -56,29 +61,25 @@ files:
|
|
56
61
|
- rjb-loader.gemspec
|
57
62
|
homepage: https://github.com/fortesinformatica/rjb-loader
|
58
63
|
licenses: []
|
59
|
-
|
60
64
|
metadata: {}
|
61
|
-
|
62
65
|
post_install_message:
|
63
66
|
rdoc_options: []
|
64
|
-
|
65
|
-
require_paths:
|
67
|
+
require_paths:
|
66
68
|
- lib
|
67
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
-
requirements:
|
69
|
-
-
|
70
|
-
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
76
79
|
requirements: []
|
77
|
-
|
78
80
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.0.
|
81
|
+
rubygems_version: 2.0.6
|
80
82
|
signing_key:
|
81
83
|
specification_version: 4
|
82
84
|
summary: Rjb loader with before_load and after_load hooks
|
83
85
|
test_files: []
|
84
|
-
|