plek 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/plek.rb +14 -0
  2. data/lib/plek/version.rb +1 -1
  3. metadata +4 -4
@@ -15,6 +15,10 @@ class Plek
15
15
  # Find the URI for a service/application.
16
16
  def find(service, options = {})
17
17
  name = name_for(service)
18
+ if service_uri = defined_service_uri_for(name)
19
+ return service_uri
20
+ end
21
+
18
22
  host = "#{name}.#{parent_domain}"
19
23
 
20
24
  if options[:force_http] or HTTP_DOMAINS.include?(parent_domain)
@@ -61,4 +65,14 @@ class Plek
61
65
  fallback_str
62
66
  end
63
67
  end
68
+
69
+ def defined_service_uri_for(service)
70
+ service_name = service.upcase.gsub(/-/,'_')
71
+ var_name = "PLEK_SERVICE_#{service_name}_URI"
72
+
73
+ if (uri = ENV[var_name] and ! uri.empty?)
74
+ return uri
75
+ end
76
+ return nil
77
+ end
64
78
  end
@@ -1,3 +1,3 @@
1
1
  class Plek
2
- VERSION = '1.5.0'
2
+ VERSION = '1.6.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plek
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-01 00:00:00.000000000 Z
12
+ date: 2013-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -68,7 +68,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
68
  version: '0'
69
69
  segments:
70
70
  - 0
71
- hash: -3126104763394143192
71
+ hash: 1007845104173101081
72
72
  required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  segments:
79
79
  - 0
80
- hash: -3126104763394143192
80
+ hash: 1007845104173101081
81
81
  requirements: []
82
82
  rubyforge_project:
83
83
  rubygems_version: 1.8.23