stubby 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,3 @@
1
- require 'thor'
2
-
3
1
  require 'stubby/registry'
4
2
  require 'stubby/extensions/dns'
5
3
  require 'stubby/extensions/http'
@@ -11,6 +9,7 @@ module Stubby
11
9
 
12
10
  # TODO: filesystem watch all config directories for change
13
11
  desc "start ENVIRONMENT", "Starts stubby HTTP and DNS servers"
12
+ option :stubfile, default: "Stubfile.json"
14
13
  long_desc <<-LONGDESC
15
14
  > $ sudo stubby start [ENVIRONMENT='development']
16
15
 
@@ -25,7 +24,9 @@ module Stubby
25
24
  LONGDESC
26
25
 
27
26
  def start(environment="development")
28
- unless File.exists?("Stubfile.json")
27
+ stubfile = File.expand_path(options[:stubfile])
28
+
29
+ unless File.exists?(stubfile)
29
30
  puts "[ERROR]: Stubfile.json not found!"
30
31
  return
31
32
  end
@@ -40,7 +41,7 @@ module Stubby
40
41
  return
41
42
  end
42
43
 
43
- environments = MultiJson.load(File.read("Stubfile.json"))
44
+ environments = MultiJson.load(File.read(stubfile))
44
45
 
45
46
  File.write(pidfile, Process.pid)
46
47
 
data/lib/stubby/cli.rb CHANGED
@@ -1,3 +1,2 @@
1
1
  require 'thor'
2
-
3
2
  require 'stubby/cli/application'
data/lib/stubby.rb CHANGED
@@ -1,9 +1,10 @@
1
1
  STUBBY_MASTER="172.16.123.1"
2
2
 
3
- require 'oj'
4
- require 'multi_json'
5
3
  require 'rubygems'
6
4
  require 'bundler/setup'
5
+
6
+ require 'oj'
7
+ require 'multi_json'
7
8
  require 'stubby/extensions/dns/osx'
8
9
  require 'stubby/extensions/dns'
9
10
  require 'stubby/extensions/http'
metadata CHANGED
@@ -1,11 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stubby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Kassemi
9
+ - Glen Holcomb
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
@@ -270,6 +271,7 @@ dependencies:
270
271
  description: ''
271
272
  email:
272
273
  - jkassemi@gmail.com
274
+ - damnbigman@gmail.com
273
275
  executables:
274
276
  - stubby
275
277
  extensions: []