waiting_on_rails 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +2 -3
- data/bin/waiting-on +5 -0
- data/bin/waiting-on-rails +5 -0
- data/bin/waiting-on-rake +5 -0
- data/lib/waiting_on_rails/anything.rb +1 -1
- data/lib/waiting_on_rails/player.rb +8 -2
- data/lib/waiting_on_rails/rails.rb +2 -2
- data/lib/waiting_on_rails/rake.rb +1 -1
- data/lib/waiting_on_rails/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8eab0ceab8bfc3b23b43b5ad68b7d6f6f48e097cb8f6ce878dd750d3ce23e69a
|
4
|
+
data.tar.gz: aad27b0e48d377a7b40323ee9af19301a70f9d145c7eef50b3a6a487d78727e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da4f747e7e75c11b1245f4c49fff115101eb171f6a878a9f5b747fde35295e533dc70e63770ef3166c82dbbcdc94533fe97035660b2f53a065a489422ee06a13
|
7
|
+
data.tar.gz: 5d4f9b2022441c352a02f1e98574adb073fcd1d6a7dd2c2410381cd25dfb4526881820917473e48430c23e507d874daa27a8306780903cf33eb59d3f08f0a654
|
data/README.md
CHANGED
@@ -10,7 +10,6 @@ What's the difference? Aside from running the required task, they also play some
|
|
10
10
|
You can use the third one, `waiting-on` with any command and it'll play music until it's done:
|
11
11
|
|
12
12
|
waiting-on rspec spec
|
13
|
-
waiting-on cucumber
|
14
13
|
waiting-on cap deploy
|
15
14
|
|
16
15
|
## Gotchas
|
@@ -22,6 +21,7 @@ Also, it only works for the following webservers:
|
|
22
21
|
- WEBrick
|
23
22
|
- Mongrel
|
24
23
|
- Thin
|
24
|
+
- Puma
|
25
25
|
|
26
26
|
It should be possible to add support for more by adding to the `matches_server_start?` method in [this file](https://github.com/AndrewRadev/waiting-on-rails/blob/master/lib/waiting_on_rails/rails.rb). Again, pull requests welcome.
|
27
27
|
|
@@ -39,11 +39,10 @@ On Linux, you should use your distribution's package manager. For Arch Linux, th
|
|
39
39
|
|
40
40
|
pacman -S mplayer
|
41
41
|
|
42
|
-
You could run `waiting-on-rails` without using `bundle exec` (unless it's run by a bundle-exec-ed script, like with a Procfile), but you probably won't be able to with `waiting-on-rake`. So if you're serious about battling boring loading times, you're going to have to add it to your Gemfile with a
|
42
|
+
You could run `waiting-on-rails` without using `bundle exec` (unless it's run by a bundle-exec-ed script, like with a Procfile), but you probably won't be able to with `waiting-on-rake`. So if you're serious about battling boring loading times, you're going to have to add it to your Gemfile with a `require: false`. If you just want a quick laugh, install the gem globally and start your project with `waiting-on-rails s`. Preferably in front of your unsuspecting coworkers. Amusement not guaranteed, but very likely.
|
43
43
|
|
44
44
|
## TODO
|
45
45
|
|
46
|
-
- Implement `waiting-on-spork`?
|
47
46
|
- Implement continuing from a point. Could save a temporary file somewhere with the time at which the music was stopped.
|
48
47
|
- Implement simple configuration, controlling what song to play, or even something different to do (like show a notification). Warning: might make the project actually useful, consider carefully.
|
49
48
|
|
data/bin/waiting-on
CHANGED
data/bin/waiting-on-rails
CHANGED
data/bin/waiting-on-rake
CHANGED
@@ -6,8 +6,14 @@ module WaitingOnRails
|
|
6
6
|
@music_path = full_path(music_path)
|
7
7
|
end
|
8
8
|
|
9
|
-
def start
|
10
|
-
|
9
|
+
def start(loop: false)
|
10
|
+
if loop
|
11
|
+
loop_flag = '-loop 0'
|
12
|
+
else
|
13
|
+
loop_flag = ''
|
14
|
+
end
|
15
|
+
|
16
|
+
@pid = spawn("mplayer #{loop_flag} #{@music_path}", out: '/dev/null', err: '/dev/null')
|
11
17
|
end
|
12
18
|
|
13
19
|
def stop
|
@@ -16,7 +16,7 @@ module WaitingOnRails
|
|
16
16
|
end
|
17
17
|
|
18
18
|
spawn_rails_subprocess(args) do |output, pid|
|
19
|
-
@music_player.start
|
19
|
+
@music_player.start(loop: true)
|
20
20
|
handle_signals(pid, output)
|
21
21
|
main_loop(output)
|
22
22
|
end
|
@@ -81,7 +81,7 @@ module WaitingOnRails
|
|
81
81
|
def matches_server_start?(string)
|
82
82
|
patterns = [
|
83
83
|
'WEBrick::HTTPServer#start', # WEBrick
|
84
|
-
'Listening on', # Thin
|
84
|
+
'Listening on', # Thin, Puma
|
85
85
|
]
|
86
86
|
|
87
87
|
patterns.any? { |p| string.include?(p) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waiting_on_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Radev
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-02-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 3.0.0
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 3.0.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +67,7 @@ files:
|
|
67
67
|
- vendor/attempt_2.mp3
|
68
68
|
- vendor/ding.wav
|
69
69
|
- vendor/test.mp3
|
70
|
-
homepage: http://github.com/AndrewRadev/
|
70
|
+
homepage: http://github.com/AndrewRadev/waiting-on-rails
|
71
71
|
licenses: []
|
72
72
|
metadata: {}
|
73
73
|
post_install_message:
|
@@ -85,8 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: 1.3.6
|
87
87
|
requirements: []
|
88
|
-
|
89
|
-
rubygems_version: 2.2.0
|
88
|
+
rubygems_version: 3.0.0
|
90
89
|
signing_key:
|
91
90
|
specification_version: 4
|
92
91
|
summary: Plays elevator music until `rails server` boots
|