config_server 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 2583c16164af166f046609b2105bc10fd59970ae
4
- data.tar.gz: d82db544e9306d3524f9aec546099df1a4c9a2a3
3
+ metadata.gz: 958907a637ed9d05897996fade187850d12a1e9e
4
+ data.tar.gz: ca005753b0049621bc2c89e9b391916cdd4d593b
5
5
  SHA512:
6
- metadata.gz: 5b0c0721800b09b6fe0561920c04f028ec9c999c557407430297ed2c155db35eab3ccd99702cb33bbc4b786d8c0f008c00566c2542ecd943e42b68c3f835f303
7
- data.tar.gz: 38dcd62497811299e18fdac9de58caf3f0d0eb365ad4d7f0e08025a777414dcc3754ebfe9246e67aeedec877d8db4709c66084b7d75d186258e0a5d8a14572d7
6
+ metadata.gz: b01dbc1b2fc3a02f795ce71d485b8b938bdac7f71f796a72b36c024ed5ef5679e80fd567b9ab9fb02335436ca506b7d3ea9ba0a7833e782e2c34ed95dfdf63df
7
+ data.tar.gz: 129173a592d48a4623904346bd47dd01ea29a2ce8e8748d6522f41ba7d57d4306e556c6229ff66649acd3a6cf5dcc26219d9fd3a9245936998dd469ff1c81e2d
data/README.md CHANGED
@@ -32,38 +32,15 @@ file and mount it into the container:
32
32
 
33
33
  $ docker run -d -p 8080:8080 -v /path/to/your/config.yml:/usr/src/app/config.yml nanit/config_server
34
34
 
35
- ## Option 2: Running Your Ruby Script
35
+ ## Option 2: Running Directly On Your Machine
36
36
 
37
37
  ### 1. Install config_server Gem
38
38
 
39
- Add this line to your application's Gemfile:
40
-
41
- ```ruby
42
- gem 'config_server'
43
- ```
44
-
45
- And then execute:
46
-
47
- $ bundle
48
-
49
- Or install it yourself as:
50
-
51
39
  $ gem install config_server
52
40
 
53
- ### 2. Run Your Ruby Script
54
-
55
- Then create the following ruby file:
56
- ```ruby
57
- #my_configuration_server.rb
58
-
59
- require 'config_server'
60
-
61
- ConfigServer.start("config.yml")
62
- ```
63
-
64
- Then run:
41
+ ### 2. Run The Server
65
42
 
66
- $ bundle exec ruby my_configuration_server.rb
43
+ $ CONFIG_FILE=/path/to/config.yml config_server
67
44
 
68
45
  ## Querying The Server
69
46
 
data/docker/Dockerfile CHANGED
@@ -2,4 +2,4 @@ FROM ruby:2.2-onbuild
2
2
 
3
3
  EXPOSE 8080
4
4
 
5
- CMD ["bundle", "exec", "ruby", "server.rb"]
5
+ CMD ["bundle", "exec", "config_server"]
data/docker/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- config_server (0.1.1)
4
+ config_server (0.1.3)
5
5
  rack
6
6
  rack (1.6.4)
7
7
 
@@ -1,4 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
1
3
  require 'config_server'
2
4
 
3
5
  $stdout.sync = true
4
- ConfigServer.start("config.yml")
6
+
7
+ ConfigServer.start
data/lib/config_server.rb CHANGED
@@ -4,7 +4,9 @@ require "rack"
4
4
  require "rack/server"
5
5
 
6
6
  module ConfigServer
7
- def self.start(config_file)
8
- Rack::Server.start(:Host => "0.0.0.0", app: ConfigServer::App.new(config_file))
7
+ def self.start
8
+ port = ENV["SERVER_PORT"] || 8080
9
+ config_file = ENV["CONFIG_FILE"] || "config.yml"
10
+ Rack::Server.start(:Host => "0.0.0.0", :Port => port, :app => ConfigServer::App.new(config_file))
9
11
  end
10
12
  end
@@ -1,3 +1,3 @@
1
1
  module ConfigServer
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erez Rabih
@@ -83,7 +83,8 @@ dependencies:
83
83
  description: A Ruby RACK server which servers YAML files directly from request path
84
84
  email:
85
85
  - erez.rabih@gmail.com
86
- executables: []
86
+ executables:
87
+ - config_server
87
88
  extensions: []
88
89
  extra_rdoc_files: []
89
90
  files:
@@ -103,7 +104,7 @@ files:
103
104
  - docker/Dockerfile
104
105
  - docker/Gemfile
105
106
  - docker/Gemfile.lock
106
- - docker/server.rb
107
+ - exe/config_server
107
108
  - lib/config_server.rb
108
109
  - lib/config_server/app.rb
109
110
  - lib/config_server/version.rb