platform_sh 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe97479e3a48a0e81274343bcd1a879a47924549207bbf35216d4e8e3ddfd78a
4
- data.tar.gz: 459317e327b61bcf6ce794d7fad6a76c7ecdef9582fe8522dc417a427adb0854
3
+ metadata.gz: 6b6af1db4bf930f94f759a2c575532f76c8e0b8cfb9f31be4a65fc4b9f422409
4
+ data.tar.gz: e984ea591ecda012d3f569fe3f05dd5aa58b423cc6508e8b4176246a3b6d1e77
5
5
  SHA512:
6
- metadata.gz: 70c1ffc94864a2e72a1f4d57dfddf2646991c303a434091ab7c80dd11291406dbee9051dda99d7bd894ea688af5b11714e99d738719437c2b4ad0d30069ca329
7
- data.tar.gz: 3fb1b4a8158bce8287c501e1b80d8e4d4da98ab2db73e6e132d245368a83f457bf8ac3f32bee71b59642c9ae6226b189d702c9927ef2b034f2e393986dcf6d49
6
+ metadata.gz: edd2a3c6b3711f8ecd193968aecbd198fbf93428f78a72d3361d76432bd51a728ed199005f2a90e0a1ceae6d34780f444f55161a79776919bbb8e01c434c5034
7
+ data.tar.gz: ebf82517232fdf704d9b5d517fb6049af604301235f96b88a298600178dfb1238294d707968edf44c12623385f5617a443595c5e5b7745fad4810d8753ffab70
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.6.1
data/README.md CHANGED
@@ -24,6 +24,10 @@ Or install it yourself as:
24
24
  You could now use `@config["relationships"]["database"][0]` to get the configuration hash of the
25
25
  database relationship.
26
26
 
27
+ The Gem can also export in the environment URLs that can be picked up by libraries for their configuration.
28
+
29
+ PlatformSH::export_services_urls
30
+
27
31
  ## Development
28
32
 
29
33
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/lib/platform_sh.rb CHANGED
@@ -5,7 +5,9 @@ require 'logger'
5
5
  require 'uri'
6
6
 
7
7
  $logger = Logger.new(STDOUT)
8
- $logger.level = Logger::WARN
8
+ # Default to Log level DEBUG unless the env variable is presnet, then set it to
9
+ # WARN
10
+ $logger.level = ENV['DEBUG'] || $DEBUG ? Logger::DEBUG : Logger::WARN
9
11
 
10
12
  class PlatformSH
11
13
  'use strict'
@@ -28,7 +30,7 @@ class PlatformSH
28
30
  conf["variables"] = read_base64_json('PLATFORM_VARIABLES')
29
31
  end
30
32
  else
31
- $logger.warn "This is not running on platform.sh"
33
+ $logger.info "This is not running on platform.sh"
32
34
  return nil
33
35
  end
34
36
  conf
@@ -150,6 +152,10 @@ class PlatformSH
150
152
  self.guess_url("http","http://%{host}:%{port}", 8086)
151
153
  end
152
154
 
155
+ def self.guess_kafka_url
156
+ self.guess_url("kafka","%{host}:%{port}")
157
+ end
158
+
153
159
  def self.export_services_urls
154
160
  ENV['DATABASE_URL']=PlatformSH::guess_database_url
155
161
  ENV['MONGODB_URL']=PlatformSH::guess_mongodb_url
@@ -158,6 +164,8 @@ class PlatformSH
158
164
  ENV['RABBITMQ_URL']=PlatformSH::guess_rabbitmq_url
159
165
  ENV['SOLR_URL']=PlatformSH::guess_solr_url
160
166
  ENV['INFLUXDB_URL']=PlatformSH::guess_influxdb_url
167
+ ENV['KAFKA_URL']=PlatformSH::guess_kafka_url
168
+ ENV['HOSTNAME']=PlatformSH::guess_hostname
161
169
  end
162
170
 
163
171
  end
@@ -1,3 +1,3 @@
1
1
  class PlatformSH
2
- VERSION = "0.2.8"
2
+ VERSION = "0.2.9"
3
3
  end
data/platform.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_development_dependency "bundler", "~> 1.12"
22
+ spec.add_development_dependency "bundler", "~> 2.0"
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
24
  spec.add_development_dependency "rspec", "~> 3.0"
25
25
  spec.add_development_dependency "byebug"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: platform_sh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ori Pekelman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-25 00:00:00.000000000 Z
11
+ date: 2019-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.12'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.12'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -75,6 +75,7 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
77
  - ".rspec"
78
+ - ".ruby-version"
78
79
  - ".travis.yml"
79
80
  - Gemfile
80
81
  - LICENSE.txt
@@ -104,8 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
105
  - !ruby/object:Gem::Version
105
106
  version: '0'
106
107
  requirements: []
107
- rubyforge_project:
108
- rubygems_version: 2.7.6
108
+ rubygems_version: 3.0.1
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Platform.sh helper gem to ease interacting with the environment