jruby-ehcache 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -44,7 +44,7 @@ Jeweler::Tasks.new do |gemspec|
44
44
  gemspec.description = 'Rails 3 cache store provider using Ehcache'
45
45
  gemspec.files = FileList['lib/active_support/**/*', 'lib/ehcache/rails/**/*']
46
46
  gemspec.test_files = []
47
- gemspec.add_dependency 'jruby-ehcache', ">=1.1.1"
47
+ gemspec.add_dependency 'jruby-ehcache', ">=1.1.2"
48
48
  end
49
49
 
50
50
  Jeweler::Tasks.new do |gemspec|
@@ -54,7 +54,7 @@ Jeweler::Tasks.new do |gemspec|
54
54
  gemspec.description = 'Rails 2 cache store provider using Ehcache'
55
55
  gemspec.files = FileList['lib/active_support/**/*', 'lib/ehcache/rails/**/*']
56
56
  gemspec.test_files = []
57
- gemspec.add_dependency 'jruby-ehcache', ">=1.1.1"
57
+ gemspec.add_dependency 'jruby-ehcache', ">=1.1.2"
58
58
  end
59
59
 
60
60
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.1.2
data/lib/ehcache/java.rb CHANGED
@@ -3,6 +3,25 @@ require 'java'
3
3
  EHCACHE_LIBS_DIR = "#{Ehcache::EHCACHE_HOME}/ext"
4
4
 
5
5
  module Ehcache
6
+ module Rails
7
+ RAILS_ROOT_DIR = if defined?(::Rails)
8
+ ::Rails.root.to_s
9
+ elsif defined?(RAILS_ROOT)
10
+ RAILS_ROOT
11
+ end
12
+ if RAILS_ROOT_DIR
13
+ RAILS_LIB_DIR = File.join(RAILS_ROOT_DIR, 'lib')
14
+ Dir["#{RAILS_LIB_DIR}/**/*.jar"].each do |jar|
15
+ $CLASSPATH << File.expand_path(jar)
16
+ end
17
+ end
18
+ end
19
+ Dir["#{EHCACHE_LIBS_DIR}/**/*.jar"].each do |jar|
20
+ $CLASSPATH << File.expand_path(jar)
21
+ end
22
+ LOG = Java::OrgSlf4j::LoggerFactory.getLogger("JRubyEhcache")
23
+ LOG.info("Using Ehcache version #{Java::NetSfEhcacheUtil::ProductInfo.new.getVersion()}")
24
+ =begin
6
25
  slf4j_loader = lambda { Java::OrgSlf4j::LoggerFactory.getLogger("JRubyEhcache") }
7
26
  begin
8
27
  LOG = slf4j_loader.call
@@ -28,7 +47,7 @@ module Ehcache
28
47
  VERSION = ehcache_version_loader.call
29
48
  LOG.info("Using bundled Ehcache #{VERSION}")
30
49
  end
31
-
50
+ =end
32
51
  include_package 'net.sf.ehcache'
33
52
 
34
53
  module Config
@@ -0,0 +1,42 @@
1
+ begin
2
+ require 'ehcache'
3
+ rescue LoadError => e
4
+ $stderr.puts "You don't have ehcache installed in your application."
5
+ $stderr.puts "Please add it to your Gemfile and run bundle install"
6
+ raise e
7
+ end
8
+
9
+ module Ehcache
10
+ # Mixin module providing facilities for the Rails 2 and Rails 3 Cache::Store
11
+ # implementations.
12
+ module Rails
13
+
14
+ RAILS_CONFIG_DIR = File.join(RAILS_ROOT, 'config')
15
+
16
+ DEFAULT_RAILS_CACHE_NAME = 'rails_cache'
17
+
18
+ attr_reader :cache_manager
19
+
20
+ def create_cache_manager(options)
21
+ config = nil
22
+ if options[:ehcache_config]
23
+ Dir.chdir(RAILS_CONFIG_DIR) do
24
+ config = File.expand_path(options[:ehcache_config])
25
+ end
26
+ else
27
+ config = Ehcache::Config::Configuration.find(RAILS_CONFIG_DIR)
28
+ end
29
+ @cache_manager = Ehcache::CacheManager.create(config)
30
+ end
31
+
32
+ def create_cache(options)
33
+ create_cache_manager(options) if @cache_manager.nil?
34
+
35
+ @cache = @cache_manager.cache(options[:cache_name] || DEFAULT_RAILS_CACHE_NAME)
36
+ end
37
+
38
+ at_exit do
39
+ @cache_manager.shutdown if @cache_manager
40
+ end
41
+ end
42
+ end
metadata CHANGED
@@ -1,117 +1,122 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: jruby-ehcache
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 1.1.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.2
5
+ segments:
6
+ - 1
7
+ - 1
8
+ - 2
9
+ prerelease: false
6
10
  platform: ruby
7
- authors:
8
- - Dylan Stamat
9
- - Jason Voegele
10
- autorequire:
11
+ authors:
12
+ - Dylan Stamat
13
+ - Jason Voegele
14
+ autorequire: !!null
11
15
  bindir: bin
12
16
  cert_chain: []
13
-
14
- date: 2011-05-05 00:00:00 -07:00
17
+ date: 2011-10-24 00:00:00.000000000 -04:00
15
18
  default_executable: ehcache
16
- dependencies:
17
- - !ruby/object:Gem::Dependency
18
- name: activesupport
19
- prerelease: false
20
- requirement: &id001 !ruby/object:Gem::Requirement
21
- none: false
22
- requirements:
23
- - - ">="
24
- - !ruby/object:Gem::Version
25
- version: "0"
26
- type: :runtime
27
- version_requirements: *id001
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: activesupport
22
+ requirement: &2156568300 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ segments:
29
+ - 0
30
+ type: :runtime
31
+ prerelease: false
32
+ version_requirements: *2156568300
28
33
  description: JRuby interface to the popular Java caching library Ehcache
29
- email:
30
- - dstamat@elctech.com
31
- - jvoegele@terracotta.org
32
- executables:
33
- - ehcache
34
+ email:
35
+ - dstamat@elctech.com
36
+ - jvoegele@terracotta.org
37
+ executables:
38
+ - ehcache
34
39
  extensions: []
35
-
36
- extra_rdoc_files:
37
- - README.txt
38
- files:
39
- - History.txt
40
- - License.txt
41
- - Manifest.txt
42
- - PostInstall.txt
43
- - README.txt
44
- - Rakefile
45
- - VERSION
46
- - bin/ehcache
47
- - config/ehcache.yml
48
- - config/ehcache_manual_rmi.yml
49
- - examples/ehcache.xml
50
- - examples/jruby-ehcache.rb
51
- - ext/ehcache-2.4.2/ehcache-core-2.4.2.jar
52
- - ext/ehcache-2.4.2/ehcache-terracotta-2.4.2.jar
53
- - ext/ehcache-2.4.2/slf4j-api-1.6.1.jar
54
- - ext/ehcache-2.4.2/slf4j-jdk14-1.6.1.jar
55
- - ext/ehcache-2.4.2/terracotta-toolkit-1.2-runtime-3.1.0.jar
56
- - lib/ehcache.rb
57
- - lib/ehcache/cache.rb
58
- - lib/ehcache/cache_manager.rb
59
- - lib/ehcache/config.rb
60
- - lib/ehcache/element.rb
61
- - lib/ehcache/extensions.rb
62
- - lib/ehcache/java.rb
63
- - lib/ehcache/yaml_config.rb
64
- - script/console
65
- - script/destroy
66
- - script/generate
67
- - script/txt2html
68
- - spec/cache_manager_spec.rb
69
- - spec/cache_spec.rb
70
- - spec/spec.opts
71
- - spec/spec_helper.rb
72
- - tasks/deployment.rake
73
- - tasks/environment.rake
74
- - tasks/website.rake
75
- - test/ehcache.xml
76
- - test/ehcache.yml
77
- - test/test_cache.rb
78
- - test/test_cache_manager.rb
79
- - test/test_configuration.rb
80
- - test/test_ehcache.rb
81
- - test/test_element.rb
82
- - test/test_helper.rb
83
- - test/test_yaml_config.rb
84
- - website/index.html
85
- - website/javascripts/rounded_corners_lite.inc.js
86
- - website/stylesheets/screen.css
87
- - website/template.html.erb
40
+ extra_rdoc_files:
41
+ - README.txt
42
+ files:
43
+ - History.txt
44
+ - License.txt
45
+ - Manifest.txt
46
+ - PostInstall.txt
47
+ - README.txt
48
+ - Rakefile
49
+ - VERSION
50
+ - bin/ehcache
51
+ - config/ehcache.yml
52
+ - config/ehcache_manual_rmi.yml
53
+ - examples/ehcache.xml
54
+ - examples/jruby-ehcache.rb
55
+ - ext/ehcache-2.4.6/ehcache-core-2.4.6.jar
56
+ - ext/ehcache-2.4.6/ehcache-terracotta-2.4.6.jar
57
+ - ext/ehcache-2.4.6/slf4j-api-1.6.1.jar
58
+ - ext/ehcache-2.4.6/slf4j-jdk14-1.6.1.jar
59
+ - ext/ehcache-2.4.6/terracotta-toolkit-1.3-runtime-3.3.0.jar
60
+ - lib/ehcache.rb
61
+ - lib/ehcache/cache.rb
62
+ - lib/ehcache/cache_manager.rb
63
+ - lib/ehcache/config.rb
64
+ - lib/ehcache/element.rb
65
+ - lib/ehcache/extensions.rb
66
+ - lib/ehcache/java.rb
67
+ - lib/ehcache/rails/ehcache_rails_common.rb
68
+ - lib/ehcache/yaml_config.rb
69
+ - script/console
70
+ - script/destroy
71
+ - script/generate
72
+ - script/txt2html
73
+ - spec/cache_manager_spec.rb
74
+ - spec/cache_spec.rb
75
+ - spec/spec.opts
76
+ - spec/spec_helper.rb
77
+ - tasks/deployment.rake
78
+ - tasks/environment.rake
79
+ - tasks/website.rake
80
+ - test/ehcache.xml
81
+ - test/ehcache.yml
82
+ - test/test_cache.rb
83
+ - test/test_cache_manager.rb
84
+ - test/test_configuration.rb
85
+ - test/test_ehcache.rb
86
+ - test/test_element.rb
87
+ - test/test_helper.rb
88
+ - test/test_yaml_config.rb
89
+ - website/index.html
90
+ - website/javascripts/rounded_corners_lite.inc.js
91
+ - website/stylesheets/screen.css
92
+ - website/template.html.erb
88
93
  has_rdoc: true
89
94
  homepage: http://ehcache.rubyforge.org
90
95
  licenses: []
91
-
92
- post_install_message:
96
+ post_install_message: !!null
93
97
  rdoc_options: []
94
-
95
- require_paths:
96
- - lib
97
- required_ruby_version: !ruby/object:Gem::Requirement
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
98
101
  none: false
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- version: "0"
103
- required_rubygems_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ! '>='
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ segments:
107
+ - 0
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
109
  none: false
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- version: "0"
110
+ requirements:
111
+ - - ! '>='
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ segments:
115
+ - 0
109
116
  requirements: []
110
-
111
117
  rubyforge_project: ehcache
112
- rubygems_version: 1.5.1
113
- signing_key:
118
+ rubygems_version: 1.3.7
119
+ signing_key: !!null
114
120
  specification_version: 3
115
121
  summary: JRuby interface to Ehcache
116
122
  test_files: []
117
-