nsidc-config_injector_client 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,20 @@
1
1
  require 'rest_client'
2
2
  require 'json'
3
+ require 'uri'
3
4
 
4
5
  module Nsidc
5
6
  class ConfigInjectorClient
6
7
 
7
- def initialize service_endpoint
8
- @service_endpoint = service_endpoint
8
+ def initialize(service_endpoint, environment = 'production')
9
+ environment = 'integration' if environment == 'development'
10
+
11
+ if environment == 'production'
12
+ @service_endpoint = service_endpoint
13
+ else
14
+ service_uri = URI.parse(service_endpoint)
15
+ service_uri.host.prepend("#{environment}.")
16
+ @service_endpoint = service_uri.to_s
17
+ end
9
18
  end
10
19
 
11
20
  # Server returns json response of key value pair, value is null if not found.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nsidc-config_injector_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2014-08-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &9029620 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,12 +21,18 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
24
+ version_requirements: *9029620
25
+ - !ruby/object:Gem::Dependency
26
+ name: rspec
27
+ requirement: &9028980 !ruby/object:Gem::Requirement
25
28
  none: false
26
29
  requirements:
27
30
  - - ! '>='
28
31
  - !ruby/object:Gem::Version
29
32
  version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *9028980
30
36
  description: .
31
37
  email: ''
32
38
  executables: []
@@ -55,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
61
  version: '0'
56
62
  requirements: []
57
63
  rubyforge_project:
58
- rubygems_version: 1.8.25
64
+ rubygems_version: 1.8.11
59
65
  signing_key:
60
66
  specification_version: 3
61
67
  summary: Ruby client for the NSIDC config injector service