service_double 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -6,13 +6,14 @@ module ServiceDouble
|
|
6
6
|
|
7
7
|
class Configuration
|
8
8
|
|
9
|
-
attr_accessor :url, :log_file, :timeout, :server
|
9
|
+
attr_accessor :url, :log_file, :timeout, :server, :disable_bundler
|
10
10
|
|
11
11
|
def initialize
|
12
12
|
@url = nil
|
13
13
|
@server = nil
|
14
14
|
@log_file = nil
|
15
15
|
@timeout = 2
|
16
|
+
@disable_bundler = true
|
16
17
|
end
|
17
18
|
|
18
19
|
def url
|
@@ -18,9 +18,10 @@ module ServiceDouble
|
|
18
18
|
|
19
19
|
def_delegators :connection, :get, :post, :head, :delete, :put, :patch
|
20
20
|
|
21
|
-
attr_reader :root_url, :log_file, :started_at, :timeout, :server, :name
|
21
|
+
attr_reader :config, :root_url, :log_file, :started_at, :timeout, :server, :name
|
22
22
|
|
23
23
|
def initialize(config)
|
24
|
+
@config = config
|
24
25
|
@root_url = config.url
|
25
26
|
@log_file = config.log_file
|
26
27
|
@timeout = config.timeout
|
@@ -32,7 +33,7 @@ module ServiceDouble
|
|
32
33
|
FileUtils.mkdir_p(File.dirname(log_file)) if log_file.is_a?(String)
|
33
34
|
args = %w(ruby -r sinatra -r json) << server << "-p" << port
|
34
35
|
args << { :out => log_file, :err => log_file }
|
35
|
-
@pid = Process.spawn(*args)
|
36
|
+
@pid = Process.spawn(env, *args)
|
36
37
|
@started_at = Time.now
|
37
38
|
wait until up?
|
38
39
|
end
|
@@ -88,6 +89,14 @@ module ServiceDouble
|
|
88
89
|
}
|
89
90
|
end
|
90
91
|
|
92
|
+
def env
|
93
|
+
if config.disable_bundler
|
94
|
+
{"RUBYOPT" => "", "BUNDLE_BIN_PATH" => "", "BUNDLE_GEM_PATH" => ""}
|
95
|
+
else
|
96
|
+
{}
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
91
100
|
end
|
92
101
|
|
93
102
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: service_double
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
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-03-
|
12
|
+
date: 2013-03-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|