diarize-ruby 0.3.5 → 0.3.6

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: 60c12288c00918b56f6a0280ff4d85905c615809
4
- data.tar.gz: d0cd4559dc7a36d7805f53cdfe6bf2fa2f8e4325
3
+ metadata.gz: 36e00b3c5b5a169cc746f0cf140e3d1fbb5e2055
4
+ data.tar.gz: d082d84e13a307504f5fac7916549d3d201a5415
5
5
  SHA512:
6
- metadata.gz: 1c3487810b743160c4b1d2731c47162d9374f2294a4c3b498a88597d04a6735f477c9cc16302afefd6d8522cb88880203a83395a0783d5d9cd2920592c187019
7
- data.tar.gz: d2e48414dd62f61683098f781cca16ad346f7645b3e6aecc1129c1df22cfae1615e177f00a398210dfbf124049a8d02bdf16c234a11b6fc2114dc29952de0175
6
+ metadata.gz: 0d44decde02e7d5f74e4dac4247c9e2ff1f5d95f169112f1b34108c3e510be74f68d393705135e76d93719da6ea09539ff9ee46aed235d82c5fe6e3e2909acaf
7
+ data.tar.gz: f15c9b16585f52566e532d8417b23cb946629fda36db1d0b6de189cb6be0004a5893c0816a34b1acd636c63bde375e237e9871697001116cae3694e08ef207e0
data/.gitignore CHANGED
@@ -13,6 +13,7 @@
13
13
  *.so
14
14
  *.o
15
15
  *.a
16
+ *.pid
16
17
  mkmf.log
17
18
  *.pstore
18
19
  log/
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [v0.3.6] - 2016-11-16
2
+
3
+ - Add pidfile option to diarize server command (--pidfile, -P)
4
+ - Change diarize option port (--port, -p)
5
+
1
6
  ## [v0.3.5] - 2016-11-16
2
7
 
3
8
  - Refactor server interface to build_audio
data/bin/diarize CHANGED
@@ -57,22 +57,10 @@ arguments :strict
57
57
 
58
58
  #-v, --verbose
59
59
  desc 'Print more verbose output'
60
- switch [:v, :verbose]
61
-
62
- #-H, --host HOSTNAME
63
- desc 'Host, e.g. "www.example.com"'
64
- default_value 'localhost'
65
- arg_name 'HOSTNAME'
66
- flag [:H, :host]
67
-
68
- #-P, --port PORT
69
- desc 'Port number'
70
- default_value 9999
71
- arg_name 'PORT'
72
- flag [:P, :port]
60
+ switch [:verbose, :v]
73
61
 
74
62
  desc 'start console'
75
- command [:c, :console] do |console|
63
+ command [:console, :c] do |console|
76
64
  console.action do |global_options, options, args|
77
65
  require 'irb'
78
66
 
@@ -81,7 +69,8 @@ command [:c, :console] do |console|
81
69
  end
82
70
  end
83
71
 
84
- command [:r, :remote] do |remote|
72
+ desc 'use remote server'
73
+ command [:remote, :r] do |remote|
85
74
  remote.command [:a, :audio] do |audio|
86
75
  audio.desc 'diarize remote audio segments FILENAME'
87
76
  audio.arg_name 'FILENAME', :multiple
@@ -107,7 +96,8 @@ command [:r, :remote] do |remote|
107
96
  end
108
97
  end
109
98
 
110
- command [:a, :audio] do |audio|
99
+ desc 'audio file'
100
+ command [:audio, :a] do |audio|
111
101
  audio.desc 'diarize audio segments FILENAME'
112
102
  audio.arg_name 'FILENAME', :multiple
113
103
  audio.command [:se, :segment, :segments] do |segments|
@@ -132,7 +122,7 @@ command [:a, :audio] do |audio|
132
122
  end
133
123
 
134
124
  desc 'start server'
135
- command [:s, :server] do |server|
125
+ command [:server, :s] do |server|
136
126
  server.action do |global_options, options, args|
137
127
  merged_options = options.merge(global_options)
138
128
  argv = merged_options.reject {|k, v| !k.is_a?(String)}
@@ -141,41 +131,45 @@ command [:s, :server] do |server|
141
131
  argv = argv.to_a.flatten
142
132
 
143
133
  uri = "druby://#{merged_options[:host]}:#{merged_options[:port]}"
144
- $stdout.puts "Drb server"
134
+ $stdout.puts "DRb server"
145
135
  $stdout.puts "diarize-ruby #{Diarize::VERSION}"
146
136
  $stdout.puts "Arguments: #{argv.inspect}" if global_options[:verbose]
137
+ if merged_options[:pidfile]
138
+ $stdout.puts "Pidfile '#{merged_options[:pidfile]}' (#{$$})"
139
+ end
147
140
  $stdout.puts "Listening on #{uri}, CTRL+C to stop"
148
141
  server = Diarize::Server.new
149
142
  DRb.start_service(uri, server)
150
143
  DRb.thread.join
151
144
  end
152
145
 
153
- #-H, --host HOSTNAME
154
- server.desc 'Host, e.g. "www.example.com"'
146
+ #-h, --host HOSTNAME
147
+ server.desc 'Host, e.g. "localhost"'
155
148
  server.default_value 'localhost'
156
149
  server.arg_name 'HOSTNAME'
157
- server.flag [:H, :host]
150
+ server.flag [:h, :host]
158
151
 
159
- #-P, --port PORT
152
+ #-p, --port PORT
160
153
  server.desc 'Port number'
161
154
  server.default_value 9999
162
155
  server.arg_name 'PORT'
163
- server.flag [:P, :port]
156
+ server.flag [:p, :port]
157
+
158
+ #-P, --pidfile PIDFILE
159
+ server.desc 'PID file'
160
+ server.arg_name 'PIDFILE'
161
+ server.flag [:P, :pidfile]
164
162
  end
165
163
 
166
164
  pre do |global, command, options, args|
167
- # Pre logic here
168
- # Return true to proceed; false to abort and not call the
169
- # chosen command
170
- # Use skips_pre before a command to skip this block
171
- # on that command only
165
+ if command.name == :server
166
+ File.write(options[:pidfile], $$) if options[:pidfile]
167
+ end
172
168
  true
173
169
  end
174
170
 
175
- post do |global,command,options,args|
176
- # Post logic here
177
- # Use skips_post before a command to skip this
178
- # block on that command only
171
+ post do |global, command, options, args|
172
+ true
179
173
  end
180
174
 
181
175
  on_error do |exception|
@@ -186,6 +180,6 @@ end
186
180
 
187
181
  begin
188
182
  exit run(ARGV)
189
- rescue
183
+ rescue UncaughtThrowError
190
184
  $stdout.puts "Bye."
191
185
  end
@@ -1,3 +1,3 @@
1
1
  module Diarize
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ class VersionTest < Test::Unit::TestCase
4
+
5
+ def test_current_version
6
+ assert_equal "0.3.6", Diarize::VERSION
7
+ end
8
+
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diarize-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yves Raimond
@@ -163,6 +163,7 @@ files:
163
163
  - test/speaker_test.rb
164
164
  - test/super_vector_test.rb
165
165
  - test/test_helper.rb
166
+ - test/version_test.rb
166
167
  homepage: https://github.com/chinshr/diarize-ruby
167
168
  licenses:
168
169
  - GNU Affero General Public License version 3
@@ -198,3 +199,4 @@ test_files:
198
199
  - test/speaker_test.rb
199
200
  - test/super_vector_test.rb
200
201
  - test/test_helper.rb
202
+ - test/version_test.rb