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 CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA512:
3
- data.tar.gz: 4b39a5510ce897bd45c0eb733b3156abe65d7f6e0f9423b6400bb4d2416e076978002e88880547bc48482830763b553575ec8d45901a2bb1c11bd3998b1aceab
4
- metadata.gz: 8dfe27cd2d8fab9c47b9fbd86009b8f9c7bdabad5c1b80309e9bc03b469d0b83ff181303053640b5ec66d42ebcc892fd070ebad6864a461b21f41f3c01211ea0
5
- SHA1:
6
- data.tar.gz: 64954ec39a32bf6453f062ed6fb525e55cf19910
7
- metadata.gz: d0685b571738a602df3f7b988bce4475d4dc22ed
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 of each implementation
8
- get all set up before running Rjb::load. This is necessary because Rjb can only be loaded once.
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
- You can use rjb-loader to change classpath and java options, by adding 'before_load' to your gem or rails initializer.
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 can be used when your code needs an already loaded Rjb.
13
- For instance, when you need to import and use the java classes.
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
- TODO
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
 
@@ -1,4 +1,4 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  module RjbLoader
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
@@ -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.3')
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.1
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
- date: 2013-07-05 00:00:00 Z
13
- dependencies:
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
- prerelease: false
17
- requirement: &id001 !ruby/object:Gem::Requirement
18
- requirements:
19
- - - "="
20
- - !ruby/object:Gem::Version
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
- requirement: &id002 !ruby/object:Gem::Requirement
28
- requirements:
29
- - - ">="
30
- - !ruby/object:Gem::Version
31
- version: "3.2"
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
- version_requirements: *id002
34
- description: |-
35
- When working with multiple gems or several rails initializer files that use Rjb,
36
- you need to make sure that all java dependencies of each implementation
37
- gets set up before running Rjb::load. This is necessary because Rjb can be loaded only once.
38
- You can use rjb-loader to change classpath and java options, by adding 'before_load' to your gem or rails initializer.
39
- The 'after_load' hook can be used when your code needs an already loaded Rjb.
40
- For instance, when you need to import and use java classes.
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
- - &id003
70
- - ">="
71
- - !ruby/object:Gem::Version
72
- version: "0"
73
- required_rubygems_version: !ruby/object:Gem::Requirement
74
- requirements:
75
- - *id003
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.3
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
-