jruby-ehcache-rails3 1.0.0 → 1.1.0

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/README.txt CHANGED
@@ -62,7 +62,8 @@ $ sudo jruby -S gem install jruby-ehcache
62
62
 
63
63
 
64
64
  == LICENSE:
65
- Copyright (c) 2008 Dylan Stamat <dstamat@elctech.com>
65
+ Copyright (c) 2008 - 2010 Dylan Stamat <dstamat@elctech.com> and
66
+ Jason Voegele <jason@jvoegele.com>
66
67
 
67
68
  Permission is hereby granted, free of charge, to any person
68
69
  obtaining a copy of this software and associated documentation
@@ -11,8 +11,9 @@ module ActiveSupport
11
11
  def initialize(*args)
12
12
  args = args.flatten
13
13
  options = args.extract_options!
14
- super(*options)
15
- @ehcache = self.create_cache # This comes from the Ehcache::Rails mixin.
14
+ super(options)
15
+ self.create_cache_manager(options)
16
+ @ehcache = self.create_cache(options) # This comes from the Ehcache::Rails mixin.
16
17
  extend Strategy::LocalCache
17
18
  end
18
19
 
@@ -19,15 +19,25 @@ module Ehcache
19
19
  end
20
20
 
21
21
  DEFAULT_RAILS_CACHE_NAME = 'rails_cache'
22
+
23
+ attr_reader :cache_manager
22
24
 
23
- def create_cache_manager(*args)
24
- config = Ehcache::Config::Configuration.find(RAILS_CONFIG_DIR)
25
+ def create_cache_manager(options)
26
+ config = nil
27
+ if options[:ehcache_config]
28
+ Dir.chdir(RAILS_CONFIG_DIR) do
29
+ config = File.expand_path(options[:ehcache_config])
30
+ end
31
+ else
32
+ config = Ehcache::Config::Configuration.find(RAILS_CONFIG_DIR)
33
+ end
25
34
  @cache_manager = Ehcache::CacheManager.create(config)
26
35
  end
27
36
 
28
- def create_cache(name = DEFAULT_RAILS_CACHE_NAME)
29
- create_cache_manager if @cache_manager.nil?
30
- @cache = @cache_manager.cache(name)
37
+ def create_cache(options)
38
+ create_cache_manager(options) if @cache_manager.nil?
39
+
40
+ @cache = @cache_manager.cache(options[:cache_name] || DEFAULT_RAILS_CACHE_NAME)
31
41
  end
32
42
 
33
43
  at_exit do
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby-ehcache-rails3
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 0
8
- - 0
9
- version: 1.0.0
4
+ prerelease:
5
+ version: 1.1.0
10
6
  platform: ruby
11
7
  authors:
12
8
  - Dylan Stamat
@@ -15,23 +11,31 @@ autorequire:
15
11
  bindir: bin
16
12
  cert_chain: []
17
13
 
18
- date: 2010-11-15 00:00:00 -05:00
14
+ date: 2011-05-04 00:00:00 -07:00
19
15
  default_executable: ehcache
20
16
  dependencies:
21
17
  - !ruby/object:Gem::Dependency
22
18
  name: jruby-ehcache
23
19
  prerelease: false
24
20
  requirement: &id001 !ruby/object:Gem::Requirement
21
+ none: false
25
22
  requirements:
26
23
  - - ">="
27
24
  - !ruby/object:Gem::Version
28
- segments:
29
- - 1
30
- - 0
31
- - 0
32
- version: 1.0.0
25
+ version: 1.1.0
33
26
  type: :runtime
34
27
  version_requirements: *id001
28
+ - !ruby/object:Gem::Dependency
29
+ name: jruby-ehcache
30
+ prerelease: false
31
+ requirement: &id002 !ruby/object:Gem::Requirement
32
+ none: false
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 1.1.0
37
+ type: :runtime
38
+ version_requirements: *id002
35
39
  description: Rails 3 cache store provider using Ehcache
36
40
  email:
37
41
  - dstamat@elctech.com
@@ -46,33 +50,32 @@ files:
46
50
  - lib/active_support/cache/ehcache_store.rb
47
51
  - lib/ehcache/rails/ehcache_rails_common.rb
48
52
  - README.txt
53
+ - bin/ehcache
49
54
  has_rdoc: true
50
55
  homepage: http://ehcache.rubyforge.org
51
56
  licenses: []
52
57
 
53
58
  post_install_message:
54
- rdoc_options:
55
- - --charset=UTF-8
59
+ rdoc_options: []
60
+
56
61
  require_paths:
57
62
  - lib
58
63
  required_ruby_version: !ruby/object:Gem::Requirement
64
+ none: false
59
65
  requirements:
60
66
  - - ">="
61
67
  - !ruby/object:Gem::Version
62
- segments:
63
- - 0
64
68
  version: "0"
65
69
  required_rubygems_version: !ruby/object:Gem::Requirement
70
+ none: false
66
71
  requirements:
67
72
  - - ">="
68
73
  - !ruby/object:Gem::Version
69
- segments:
70
- - 0
71
74
  version: "0"
72
75
  requirements: []
73
76
 
74
77
  rubyforge_project: ehcache
75
- rubygems_version: 1.3.6
78
+ rubygems_version: 1.5.1
76
79
  signing_key:
77
80
  specification_version: 3
78
81
  summary: Rails 3 cache store provider using Ehcache