tenantify 0.0.1 → 0.0.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.
- checksums.yaml +4 -4
- data/lib/tenantify/middleware/strategies/default.rb +1 -1
- data/lib/tenantify/middleware/strategies/header.rb +1 -3
- data/lib/tenantify/middleware/strategies/host.rb +2 -3
- data/lib/tenantify/version.rb +1 -1
- data/spec/integration/middleware/one_strategy_spec.rb +1 -1
- data/spec/tenantify/middleware/strategies/default_spec.rb +1 -1
- data/spec/tenantify/middleware/strategies/header_spec.rb +1 -1
- data/spec/tenantify/middleware/strategies/host_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c8c42f9166c61f4cb6d478a4365f6c83e764a78
|
4
|
+
data.tar.gz: 5cdf09bd05953384efc79a95501a37196ec830ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a824126f2549f1808cb896344640407869dfed1d465c5e109677cbd05f74bca65b69eeb9ce94a48386b578df0029541cfbc0152f1c41f927c541f7190e357c84
|
7
|
+
data.tar.gz: a8ac937a975ab177eb65689b753525d592b9058c178061e7b4a08394125f0d1b7be58db2239293e598896d6bb1c20f23ab574828ec1db2fee750ff3a3177c9db
|
@@ -30,10 +30,9 @@ module Tenantify
|
|
30
30
|
# @param [rack_environment] the rack environment.
|
31
31
|
# @return [Symbol, nil] the found tenant of nil.
|
32
32
|
def tenant_for env
|
33
|
-
host
|
34
|
-
tenant = correspondence[host]
|
33
|
+
host = env["SERVER_NAME"]
|
35
34
|
|
36
|
-
|
35
|
+
correspondence[host]
|
37
36
|
end
|
38
37
|
|
39
38
|
private
|
data/lib/tenantify/version.rb
CHANGED
@@ -10,7 +10,7 @@ RSpec.describe Tenantify::Middleware::Strategies::Default do
|
|
10
10
|
let(:env) { double 'env' }
|
11
11
|
|
12
12
|
it 'returns the same tenant for any env' do
|
13
|
-
expect(subject.tenant_for(env)).to eq
|
13
|
+
expect(subject.tenant_for(env)).to eq 'the_tenant'
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -11,7 +11,7 @@ RSpec.describe Tenantify::Middleware::Strategies::Header do
|
|
11
11
|
let(:env) { {'X-Tenant' => 'the_tenant'} }
|
12
12
|
|
13
13
|
it 'returns the header content' do
|
14
|
-
expect(subject.tenant_for(env)).to eq
|
14
|
+
expect(subject.tenant_for(env)).to eq 'the_tenant'
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -16,7 +16,7 @@ RSpec.describe Tenantify::Middleware::Strategies::Host do
|
|
16
16
|
let(:env) { {"SERVER_NAME" => 'www.host_c.com'} }
|
17
17
|
|
18
18
|
it 'chooses the proper tenant' do
|
19
|
-
expect(subject.tenant_for(env)).to eq
|
19
|
+
expect(subject.tenant_for(env)).to eq 'tenant_2'
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tenantify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaime Cabot Campins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|