plek 0.4.0 → 0.5.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/lib/plek.rb +5 -25
- data/lib/plek/version.rb +1 -1
- metadata +5 -5
data/lib/plek.rb
CHANGED
@@ -9,44 +9,34 @@ class Plek
|
|
9
9
|
"production.assets" => "static.production.alphagov.co.uk",
|
10
10
|
"production.cdn" => "d17tffe05zdvwj.cloudfront.net",
|
11
11
|
"production.publication-preview" => "private-frontend.production.alphagov.co.uk",
|
12
|
-
"production.whitehall" => "whitehall.production.alphagov.co.uk",
|
13
|
-
"production.whitehall-search" => "whitehall-search.production.alphagov.co.uk",
|
14
12
|
"production.#{DEFAULT_PATTERN}" => "%s.production.alphagov.co.uk",
|
15
13
|
|
16
14
|
"preview.www" => "www.preview.alphagov.co.uk",
|
17
15
|
"preview.assets" => "static.preview.alphagov.co.uk",
|
18
16
|
"preview.cdn" => "djb1962t8apu5.cloudfront.net",
|
19
17
|
"preview.publication-preview" => "private-frontend.preview.alphagov.co.uk",
|
20
|
-
"preview.tariff" => "tariff.preview.alphagov.co.uk",
|
21
|
-
"preview.whitehall" => "whitehall.preview.alphagov.co.uk",
|
22
|
-
"preview.whitehall-search" => "whitehall-search.preview.alphagov.co.uk",
|
23
18
|
"preview.#{DEFAULT_PATTERN}" => "%s.preview.alphagov.co.uk",
|
24
19
|
|
25
20
|
"staging.frontend" => "demo.alphagov.co.uk",
|
26
21
|
"staging.publisher" => "guides.staging.alphagov.co.uk",
|
27
22
|
"staging.assets" => "static.staging.alphagov.co.uk",
|
28
|
-
"staging.assets" => "static.staging.alphagov.co.uk",
|
29
23
|
"staging.publication-preview" => "private-frontend.staging.alphagov.co.uk",
|
30
24
|
"staging.#{DEFAULT_PATTERN}" => "%s.staging.alphagov.co.uk",
|
31
25
|
|
32
26
|
"development.assets" => "static.dev.gov.uk",
|
33
27
|
"development.cdn" => "static.dev.gov.uk",
|
34
|
-
"development.whitehall" => "whitehall.dev.gov.uk",
|
35
|
-
"development.whitehall-search" => "whitehall-search.dev.gov.uk",
|
36
28
|
"development.publication-preview"=> "www.dev.gov.uk",
|
37
29
|
"development.#{DEFAULT_PATTERN}" => "%s.dev.gov.uk",
|
38
30
|
|
39
31
|
"test.publication-preview" => "www.test.gov.uk",
|
40
32
|
"test.cdn" => "static.test.gov.uk",
|
41
|
-
"test.whitehall" => "whitehall.test.alphagov.co.uk",
|
42
|
-
"test.whitehall-search" => "whitehall-search.test.alphagov.co.uk",
|
43
33
|
"test.#{DEFAULT_PATTERN}" => "%s.test.gov.uk",
|
44
34
|
}.freeze
|
45
35
|
|
46
36
|
attr_accessor :environment
|
47
37
|
private :environment=
|
48
38
|
|
49
|
-
def initialize
|
39
|
+
def initialize(environment)
|
50
40
|
self.environment = environment
|
51
41
|
end
|
52
42
|
|
@@ -55,29 +45,19 @@ class Plek
|
|
55
45
|
name = name_for service
|
56
46
|
host = SERVICES[service_key_for(name)]
|
57
47
|
host ||= SERVICES["#{environment}.#{DEFAULT_PATTERN}"].to_s % name
|
58
|
-
|
59
|
-
if
|
60
|
-
"http://#{host}"
|
61
|
-
elsif (environment == 'preview' or environment == 'production')
|
48
|
+
|
49
|
+
if environment == 'preview' || environment == 'production'
|
62
50
|
"https://#{host}"
|
63
51
|
else
|
64
52
|
"http://#{host}"
|
65
53
|
end
|
66
54
|
end
|
67
55
|
|
68
|
-
def
|
69
|
-
/^whitehall/.match(service)
|
70
|
-
end
|
71
|
-
|
72
|
-
def search?(service)
|
73
|
-
service == 'search' or service == 'rummager'
|
74
|
-
end
|
75
|
-
|
76
|
-
def service_key_for name
|
56
|
+
def service_key_for(name)
|
77
57
|
"#{environment}.#{name}"
|
78
58
|
end
|
79
59
|
|
80
|
-
def name_for
|
60
|
+
def name_for(service)
|
81
61
|
name = service.to_s.dup
|
82
62
|
name.downcase!
|
83
63
|
name.strip!
|
data/lib/plek/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: plek
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.5.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Craig R Webster
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-09-
|
13
|
+
date: 2012-09-20 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: builder
|
@@ -55,8 +55,8 @@ extensions: []
|
|
55
55
|
extra_rdoc_files: []
|
56
56
|
|
57
57
|
files:
|
58
|
-
- lib/plek/version.rb
|
59
58
|
- lib/plek.rb
|
59
|
+
- lib/plek/version.rb
|
60
60
|
- README.md
|
61
61
|
homepage:
|
62
62
|
licenses: []
|
@@ -71,7 +71,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
71
71
|
requirements:
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
hash:
|
74
|
+
hash: -3610201643130859393
|
75
75
|
segments:
|
76
76
|
- 0
|
77
77
|
version: "0"
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
requirements:
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
hash:
|
83
|
+
hash: -3610201643130859393
|
84
84
|
segments:
|
85
85
|
- 0
|
86
86
|
version: "0"
|