cangrejo 0.1.4 → 0.1.5
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.
- checksums.yaml +4 -4
- data/lib/cangrejo/modes/local.rb +6 -2
- data/lib/cangrejo/support/launcher.rb +5 -4
- data/lib/cangrejo/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5d9cb5f49f576488055b6f9e9164bbfb6af271b4
|
|
4
|
+
data.tar.gz: af63078d5ff257624f736e463ab96e8df5be5871
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1efc55a238a31a5962e11a41122ec066f1955129a65cd44f4c840f6ce39e4b40325a59f16ab3810cbdf68da8ef382dad617dbfca4f8c3b25cb9163d7c8d2d793
|
|
7
|
+
data.tar.gz: eede15bb49b8efb34b51520e71fa83fea70819d0768e719a88a36b166626fbfda07fcb923ac41bf17202156037608ffb6a890f5fda5e5702731398824e34309b
|
data/lib/cangrejo/modes/local.rb
CHANGED
|
@@ -22,11 +22,15 @@ module Cangrejo
|
|
|
22
22
|
private
|
|
23
23
|
|
|
24
24
|
def init_launcher
|
|
25
|
-
@launcher = Support::Launcher.new @path,
|
|
25
|
+
@launcher = Support::Launcher.new @path, timeout: launch_timeout, argv: launch_cmd_arguments
|
|
26
26
|
@launcher.launch
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
def
|
|
29
|
+
def launch_timeout
|
|
30
|
+
5.0
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def launch_cmd_arguments
|
|
30
34
|
['--no-reload']
|
|
31
35
|
end
|
|
32
36
|
|
|
@@ -13,9 +13,10 @@ module Cangrejo
|
|
|
13
13
|
SPAWN_TIMEOUT = 5
|
|
14
14
|
KILL_TIMEOUT = 5
|
|
15
15
|
|
|
16
|
-
def initialize(_path, _options=
|
|
16
|
+
def initialize(_path, _options={})
|
|
17
17
|
@path = _path
|
|
18
|
-
@
|
|
18
|
+
@timeout = _options.fetch(:timeout, SPAWN_TIMEOUT)
|
|
19
|
+
@argv = _options.fetch(:argv, [])
|
|
19
20
|
select_socket_file
|
|
20
21
|
end
|
|
21
22
|
|
|
@@ -26,7 +27,7 @@ module Cangrejo
|
|
|
26
27
|
def launch
|
|
27
28
|
gem_path = File.join(@path, 'Gemfile')
|
|
28
29
|
# TODO: for some reason, the gemfile path must be specified here, maybe because of rbenv?
|
|
29
|
-
@pid = Process.spawn({ 'BUNDLE_GEMFILE' => gem_path }, "bin/crabfarm s --host=#{host} #{@
|
|
30
|
+
@pid = Process.spawn({ 'BUNDLE_GEMFILE' => gem_path }, "bin/crabfarm s --host=#{host} #{@argv.join(' ')}", chdir: @path, pgroup: true)
|
|
30
31
|
wait_for_socket
|
|
31
32
|
end
|
|
32
33
|
|
|
@@ -45,7 +46,7 @@ module Cangrejo
|
|
|
45
46
|
end
|
|
46
47
|
|
|
47
48
|
def wait_for_socket
|
|
48
|
-
Timeout::timeout(
|
|
49
|
+
Timeout::timeout(@timeout, LaunchTimeout) do
|
|
49
50
|
# TODO: detect if the process crashes before timeout
|
|
50
51
|
sleep 0.1 while not File.exist? @socket_file
|
|
51
52
|
end
|
data/lib/cangrejo/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cangrejo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ignacio Baixas
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-08-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rest-client
|
|
@@ -87,7 +87,6 @@ executables: []
|
|
|
87
87
|
extensions: []
|
|
88
88
|
extra_rdoc_files: []
|
|
89
89
|
files:
|
|
90
|
-
- lib/cangrejo.rb
|
|
91
90
|
- lib/cangrejo/configurator.rb
|
|
92
91
|
- lib/cangrejo/errors.rb
|
|
93
92
|
- lib/cangrejo/modes/git.rb
|
|
@@ -100,6 +99,7 @@ files:
|
|
|
100
99
|
- lib/cangrejo/session.rb
|
|
101
100
|
- lib/cangrejo/support/launcher.rb
|
|
102
101
|
- lib/cangrejo/version.rb
|
|
102
|
+
- lib/cangrejo.rb
|
|
103
103
|
homepage: ''
|
|
104
104
|
licenses:
|
|
105
105
|
- MIT
|
|
@@ -120,8 +120,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
120
120
|
version: '0'
|
|
121
121
|
requirements: []
|
|
122
122
|
rubyforge_project:
|
|
123
|
-
rubygems_version: 2.
|
|
123
|
+
rubygems_version: 2.0.14
|
|
124
124
|
signing_key:
|
|
125
125
|
specification_version: 4
|
|
126
126
|
summary: Crabfarm client for ruby
|
|
127
127
|
test_files: []
|
|
128
|
+
has_rdoc:
|