arproxy 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arproxy.rb +1 -0
- data/lib/arproxy/config.rb +5 -0
- data/lib/arproxy/plugin.rb +28 -0
- data/lib/arproxy/version.rb +1 -1
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aff4b1e2e9d04fb1cd291d380c0f0e05b078478e
|
4
|
+
data.tar.gz: 3ded9580916768e26579b8603fbbc4a229a80bb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0e68d2d7ded1a965e908ba10b5b8dca9d55c1a7fe033363a26b942e44da76b05d5d48e437eaab400ef458be8ff2f47ab29cbb28b4d2b1b0a68ceb097ee25ddd
|
7
|
+
data.tar.gz: cd75029e902d7a3b86d11915587004f3c30f746b52b38298eff9bfbd4ea638870bd5121ee4522911ecb1f996300416744fedf8d33b4f4cef4131eaa318735782
|
data/lib/arproxy.rb
CHANGED
data/lib/arproxy/config.rb
CHANGED
@@ -12,6 +12,11 @@ module Arproxy
|
|
12
12
|
@proxies << [proxy_class, options]
|
13
13
|
end
|
14
14
|
|
15
|
+
def plugin(name, *options)
|
16
|
+
plugin_class = Plugin.get(name)
|
17
|
+
use(plugin_class, *options)
|
18
|
+
end
|
19
|
+
|
15
20
|
def adapter_class
|
16
21
|
raise Arproxy::Error, "config.adapter must be set" unless @adapter
|
17
22
|
case @adapter
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Arproxy
|
2
|
+
module Plugin
|
3
|
+
class << self
|
4
|
+
def register(name, klass)
|
5
|
+
name = name.to_s
|
6
|
+
@plugins ||= {}
|
7
|
+
|
8
|
+
if @plugins.has_key?(name)
|
9
|
+
raise Arproxy::Error, "Plugin has already been registered: #{name}"
|
10
|
+
end
|
11
|
+
|
12
|
+
@plugins[name] = klass
|
13
|
+
end
|
14
|
+
|
15
|
+
def get(name)
|
16
|
+
name = name.to_s
|
17
|
+
require "arproxy/plugin/#{name}"
|
18
|
+
plugin = @plugins[name]
|
19
|
+
|
20
|
+
unless plugin
|
21
|
+
raise Arproxy::Error, "Plugin is not found: #{name}"
|
22
|
+
end
|
23
|
+
|
24
|
+
plugin
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/arproxy/version.rb
CHANGED
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arproxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Issei Naruta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.0.0
|
27
27
|
description: Arproxy is a proxy between ActiveRecord and database adapter
|
@@ -30,13 +30,14 @@ executables: []
|
|
30
30
|
extensions: []
|
31
31
|
extra_rdoc_files: []
|
32
32
|
files:
|
33
|
+
- lib/arproxy.rb
|
33
34
|
- lib/arproxy/base.rb
|
34
35
|
- lib/arproxy/chain_tail.rb
|
35
36
|
- lib/arproxy/config.rb
|
36
37
|
- lib/arproxy/error.rb
|
38
|
+
- lib/arproxy/plugin.rb
|
37
39
|
- lib/arproxy/proxy_chain.rb
|
38
40
|
- lib/arproxy/version.rb
|
39
|
-
- lib/arproxy.rb
|
40
41
|
homepage: https://github.com/cookpad/arproxy
|
41
42
|
licenses: []
|
42
43
|
metadata: {}
|
@@ -46,17 +47,17 @@ require_paths:
|
|
46
47
|
- lib
|
47
48
|
required_ruby_version: !ruby/object:Gem::Requirement
|
48
49
|
requirements:
|
49
|
-
- -
|
50
|
+
- - ">="
|
50
51
|
- !ruby/object:Gem::Version
|
51
52
|
version: '0'
|
52
53
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
54
|
requirements:
|
54
|
-
- -
|
55
|
+
- - ">="
|
55
56
|
- !ruby/object:Gem::Version
|
56
57
|
version: '0'
|
57
58
|
requirements: []
|
58
59
|
rubyforge_project:
|
59
|
-
rubygems_version: 2.
|
60
|
+
rubygems_version: 2.4.5
|
60
61
|
signing_key:
|
61
62
|
specification_version: 4
|
62
63
|
summary: Proxy between ActiveRecord and DB adapter
|