foreman_memcache 0.0.1 → 0.0.3

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cbbefb90e7fb2376dac8358db4376be0fc1f486e
4
+ data.tar.gz: 3be1ec3983151162337951b5789a13398017e6c9
5
+ SHA512:
6
+ metadata.gz: 0cd5240136586e86feab97271db3f90c32f7595e78fd43af451a54183ca12960cc4b45d182a02977e85c1d25056ebfde5d2809308c16397575492d7dad112b50
7
+ data.tar.gz: 96901c5478292cda7d7f2c239c0cb9165e7e1188a4b0cafe4c1a89c141c923225b6609c552f13b04079b4163c63a704193b2ac78560009d861ab549ab69390c3
data/README.rdoc CHANGED
@@ -5,6 +5,25 @@ Adds memcache support for foreman (http://theforeman.org).
5
5
  This Foreman plugin allows to use memcache as a cache storaged and session information.
6
6
  this is useful when you want to deploy foreman across multiple servers and / or speed up foreman cache performance.
7
7
 
8
- You would need to install memcache, currently we default to memcache installed on the same system as where foreman is running.
8
+ You will need to install a memcached instance to use this plugin.
9
9
 
10
- in later patch we would extract the settings into a configuration file.
10
+ ## Configuration
11
+
12
+ By default, the plugin will enable memcache-based caching pointing to memcached on the local host.
13
+
14
+ The memcache host(s) and options can be changed by adding settings to `/usr/share/foreman/config/settings.plugins.d/foreman_memcache.yaml`, or Foreman's own `settings.yaml`.
15
+
16
+ Example config file:
17
+
18
+ ```yaml
19
+ :memcache:
20
+ :hosts:
21
+ - cache-1.example.com
22
+ - cache-2.example.com
23
+ :options:
24
+ :namespace: foreman
25
+ :expires_in: 86400
26
+ :compress: true
27
+ ```
28
+
29
+ The :options hash contains settings as per the [Dalli configuration reference](https://github.com/mperham/dalli#configuration). The namespace will default to 'foreman' unless specified.
@@ -0,0 +1,10 @@
1
+ # Example foreman_memcache config file
2
+ # Copy to config/settings.plugins.d/foreman_memcache.yaml
3
+ :memcache:
4
+ :hosts:
5
+ - cache-1.example.com
6
+ - cache-2.example.com
7
+ :options:
8
+ :namespace: foreman
9
+ :expires_in: 86400
10
+ :compress: true
@@ -2,10 +2,13 @@ module ForemanMemcache
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace ForemanMemcache
4
4
  initializer "setup_memcache", :before => :initialize_cache do |app|
5
-
6
- # config.cache_store = :dalli_store, 'cache-1.example.com', 'cache-2.example.com',
7
- # { :namespace => NAME_OF_RAILS_APP, :expires_in => 1.day, :compress => true }
8
- app.config.cache_store = :dalli_store
5
+ args = [:dalli_store]
6
+ if (s = SETTINGS[:memcache])
7
+ Array.wrap(s[:hosts]).each { |h| args << h }
8
+ args << { :namespace => 'foreman' }.merge(s[:options] || {})
9
+ end
10
+ Rails.logger.info "memcached cache backend enabled: #{args}"
11
+ app.config.cache_store = args
9
12
  end
10
13
 
11
14
  initializer "setup_memcache", :after => :load_config_initializers do |app|
@@ -1,3 +1,3 @@
1
1
  module ForemanMemcache
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,100 +1,64 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: foreman_memcache
3
- version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 1
10
- version: 0.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Ohad Levy
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2013-04-03 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- prerelease: false
22
- name: rails
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 21
29
- segments:
30
- - 3
31
- - 2
32
- - 13
33
- version: 3.2.13
34
- type: :runtime
35
- requirement: *id001
36
- - !ruby/object:Gem::Dependency
37
- prerelease: false
11
+ date: 2013-09-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
38
14
  name: dalli
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
- version: "0"
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
48
20
  type: :runtime
49
- requirement: *id002
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
50
27
  description: adds memcache support to foreman
51
- email:
28
+ email:
52
29
  - ohadlevy@gmail.com
53
30
  executables: []
54
-
55
31
  extensions: []
56
-
57
32
  extra_rdoc_files: []
58
-
59
- files:
33
+ files:
60
34
  - lib/foreman_memcache.rb
61
35
  - lib/foreman_memcache/version.rb
62
36
  - lib/tasks/foreman_memcache_tasks.rake
63
37
  - MIT-LICENSE
64
38
  - Rakefile
65
39
  - README.rdoc
40
+ - foreman_memcache.yaml.example
66
41
  homepage: http://theforeman.org
67
42
  licenses: []
68
-
43
+ metadata: {}
69
44
  post_install_message:
70
45
  rdoc_options: []
71
-
72
- require_paths:
46
+ require_paths:
73
47
  - lib
74
- required_ruby_version: !ruby/object:Gem::Requirement
75
- none: false
76
- requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- hash: 3
80
- segments:
81
- - 0
82
- version: "0"
83
- required_rubygems_version: !ruby/object:Gem::Requirement
84
- none: false
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- hash: 3
89
- segments:
90
- - 0
91
- version: "0"
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
92
58
  requirements: []
93
-
94
59
  rubyforge_project:
95
- rubygems_version: 1.8.25
60
+ rubygems_version: 2.0.7
96
61
  signing_key:
97
- specification_version: 3
62
+ specification_version: 4
98
63
  summary: Adds memcache integeration to foreman
99
64
  test_files: []
100
-