service_double 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ServiceDouble
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  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.1
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-05 00:00:00.000000000 Z
12
+ date: 2013-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday