cangrejo 0.1.4 → 0.1.5

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: 2568c9ffefd9a5c7334ac5afa62e4ddb28a8001d
4
- data.tar.gz: 74643edc28a1d17e42b056cbe1a2a8e9fb2fe265
3
+ metadata.gz: 5d9cb5f49f576488055b6f9e9164bbfb6af271b4
4
+ data.tar.gz: af63078d5ff257624f736e463ab96e8df5be5871
5
5
  SHA512:
6
- metadata.gz: c5f270a3299bfd41efe555fade77c0c87e01c71bf2897c1751189be6ec41cd9e12bccac31e2e5dc1be80faa696a6c6fcb27666107482342cf0db3c277a6a539c
7
- data.tar.gz: e4a919816d2a75474dbe1e0fdbc6369ef7ab346fc153cea01cba9316acdea84be9847c950048fee2c4fab7f1ee7078bd5e1ad9293831dfa815ff0739e423ab8f
6
+ metadata.gz: 1efc55a238a31a5962e11a41122ec066f1955129a65cd44f4c840f6ce39e4b40325a59f16ab3810cbdf68da8ef382dad617dbfca4f8c3b25cb9163d7c8d2d793
7
+ data.tar.gz: eede15bb49b8efb34b51520e71fa83fea70819d0768e719a88a36b166626fbfda07fcb923ac41bf17202156037608ffb6a890f5fda5e5702731398824e34309b
@@ -22,11 +22,15 @@ module Cangrejo
22
22
  private
23
23
 
24
24
  def init_launcher
25
- @launcher = Support::Launcher.new @path, launcher_options
25
+ @launcher = Support::Launcher.new @path, timeout: launch_timeout, argv: launch_cmd_arguments
26
26
  @launcher.launch
27
27
  end
28
28
 
29
- def launcher_options
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=nil)
16
+ def initialize(_path, _options={})
17
17
  @path = _path
18
- @options = _options || []
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} #{@options.join(' ')}", chdir: @path, pgroup: true)
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(SPAWN_TIMEOUT, LaunchTimeout) do
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
@@ -1,3 +1,3 @@
1
1
  module Cangrejo
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
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
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-05-29 00:00:00.000000000 Z
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.4.7
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: