theine2 1.0.1 → 1.0.3

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
  SHA256:
3
- metadata.gz: '0569d1e4b9059ba3a9228c19c1eca9003140ae7bf64d55be6bdd7b4bef0ea639'
4
- data.tar.gz: b32c8402acd9a6a1d8e21eee4300620b9ec303d01f51bc784a75b20afcc103ce
3
+ metadata.gz: c482aaf0dd5830e9f49a584ab4da6b7798efd0d91e8fbf237b28f248b653caa4
4
+ data.tar.gz: 8e0ced1eab6f3d02736d4407d8849c6003945407f9b906699e1cbfc8f61af3e7
5
5
  SHA512:
6
- metadata.gz: 1921874b76a08145aebd2f55df36656ffd41c2a33c094a855ddc4dc87dec0c07bdb1a08b5463687f7387ecf0735df4861483baec46311c6d167547676a6b2476
7
- data.tar.gz: d29cd18ea9a00ca0de70de5fdd7f8c96acbbba20916920f1fb25959f5ee5b0ba2c5e45da24bda320175d4046b2e56a59ab0cb843517de922eb6171732bddc28e
6
+ metadata.gz: de82c0ebcbb7bb8e5630ae7eb93edc5b3f44c4a23b3800a30c063b99365b35faeaa02860dcc061e6ec60b546fe573c64b70094fa32e557e78bd97a71e3669ffa
7
+ data.tar.gz: fc08f09de1348514d6838d0e5e8b0c7a5e183731ea5741894d0bf63fb716c1d1ea7aea81c994b84b2c056a17b3ccc89ef78b303d6c304581224e570de91253f3
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ script = <<EOS
3
+ #!/bin/bash
4
+ echo "Starting Theine Server in background mode..."
5
+ theine_server &
6
+ echo $! > tmp/pids/theine_server.pid
7
+ EOS
8
+
9
+ exec(script)
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ script = <<EOS
3
+ #!/bin/bash
4
+ echo "Stopping Theine Server..."
5
+ kill -15 $(cat tmp/pids/theine_server.pid)
6
+ rm tmp/pids/theine_server.pid
7
+ EOS
8
+
9
+ exec(script)
10
+
@@ -1,5 +1,13 @@
1
1
  require 'yaml'
2
2
 
3
+ # if Gem::Specification::find_by_name('pry')
4
+ # require 'pry'
5
+ # end
6
+
7
+ # if Gem::Specification::find_by_name('pry-nav')
8
+ # require 'pry-nav'
9
+ # end
10
+
3
11
  module Theine
4
12
  class ConfigReader
5
13
  attr_reader :rails_root
@@ -26,7 +26,7 @@ module Theine
26
26
  def add_worker
27
27
  path = File.expand_path('../worker.rb', __FILE__)
28
28
  port = @workers_mutex.synchronize { @available_ports.shift }
29
- puts "(spawn #{"#{port} #{debug}".strip})" if !config.silent
29
+ puts "(spawning worker #{"#{port} #{debug}".strip})" if !config.silent
30
30
  spawn("screen", "-d", "-m", "-S", worker_session_name(port),
31
31
  "sh", "-c",
32
32
  "jruby #{debug} #{path} #{config.base_port.to_s} #{port.to_s} #{config.rails_root}")
@@ -44,7 +44,7 @@ module Theine
44
44
  end
45
45
 
46
46
  def worker_boot(port)
47
- puts "+ worker #{port}" if !config.silent
47
+ puts "(booting worker #{port})" if !config.silent
48
48
 
49
49
  @workers_mutex.synchronize do
50
50
  @spawning_workers.delete(port)
@@ -53,7 +53,7 @@ module Theine
53
53
  end
54
54
 
55
55
  def worker_done(port)
56
- puts "- worker #{port}" if !config.silent
56
+ puts "(removing worker #{port})" if !config.silent
57
57
  @workers_mutex.synchronize do
58
58
  @workers_in_use.delete(port)
59
59
  @available_ports << port
@@ -104,7 +104,7 @@ module Theine
104
104
  end
105
105
  private
106
106
  def kill_worker(port)
107
- print "- worker #{port}" if !config.silent
107
+ print "(stopping worker - #{port})" if !config.silent
108
108
  worker_pid = @worker_pids[port]
109
109
  worker_pid ||= DRbObject.new_with_uri("druby://localhost:#{port}").pid
110
110
  system("kill -9 #{worker_pid} > /dev/null 2>&1")
@@ -139,13 +139,12 @@ module Theine
139
139
  end
140
140
 
141
141
  def rails_reload!
142
- if Rails.version.to_f >= 5.1
142
+ if defined? ActiveSupport::Reloader
143
143
  Rails.application.reloader.reload!
144
- Rails.application.reloader.prepare!
145
144
  else
146
145
  ActionDispatch::Reloader.cleanup!
147
146
  ActionDispatch::Reloader.prepare!
148
- end
147
+ end
149
148
  end
150
149
 
151
150
  def start_service
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theine2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Berdajs
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-11-27 00:00:00.000000000 Z
12
+ date: 2019-12-01 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A Rails preloader for JRuby
15
15
  email: ron.a.williams@gmail.com
@@ -18,6 +18,8 @@ executables:
18
18
  - theine_current_ruby
19
19
  - theine_server
20
20
  - theine_set_ruby
21
+ - theine_start
22
+ - theine_stop
21
23
  extensions: []
22
24
  extra_rdoc_files: []
23
25
  files:
@@ -25,6 +27,8 @@ files:
25
27
  - bin/theine_current_ruby
26
28
  - bin/theine_server
27
29
  - bin/theine_set_ruby
30
+ - bin/theine_start
31
+ - bin/theine_stop
28
32
  - lib/theine.rb
29
33
  - lib/theine/client.rb
30
34
  - lib/theine/config.rb
@@ -49,8 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
53
  - !ruby/object:Gem::Version
50
54
  version: '0'
51
55
  requirements: []
52
- rubyforge_project:
53
- rubygems_version: 2.7.10
56
+ rubygems_version: 3.0.6
54
57
  signing_key:
55
58
  specification_version: 4
56
59
  summary: Theine2