qcmd 0.1.16 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 707ee3b51441841675e789ad5b17fd2428e0697d
4
+ data.tar.gz: 5032fafb3d1e8c81aa1795db3de8d5ff7d565d96
5
+ SHA512:
6
+ metadata.gz: 7aaf67fb6dc77e5bb30d98ba480d085d77f0a9a98fc047c3c041a87d1509944ee098b01b56a2e19640d2bde2af4a23a00054b24fe1aa6c99719ace3864266913
7
+ data.tar.gz: 6d1167201144fde30b35bd08ee0f0fdd8bccc89548b709bf8e2ecfb3d9554d427ee4bc17c547133d651d8cc2e979d9479b08843efc679bdb08130f43b1aa4551
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  .rake_tasks~
19
+ .ruby-version
@@ -417,7 +417,9 @@ module Qcmd
417
417
  if !Qcmd.context.machine_connected?
418
418
  disconnected_machine_warning
419
419
  else
420
- machine.workspaces = Qcmd::Action.evaluate(args).map {|ws| QLab::Workspace.new(ws)}
420
+ machine.workspaces = Qcmd::Action.evaluate(args).map {|ws|
421
+ QLab::Workspace.new(ws)
422
+ }
421
423
  Handler.print_workspace_list
422
424
  end
423
425
 
@@ -25,21 +25,16 @@ module OSC
25
25
  # send an OSC::Message
26
26
  def send msg
27
27
  @sending_socket.send msg
28
-
29
-
30
28
  if block_given? || @handler
31
29
  messages = response
32
30
  if !messages.nil?
33
31
  messages.each do |message|
34
- # puts "[TCP::Client] got message #{ message }"
35
32
  if block_given?
36
33
  yield message
37
34
  else
38
35
  @handler.handle message
39
36
  end
40
37
  end
41
- else
42
- # puts "[TCP::Client] response is nil"
43
38
  end
44
39
  end
45
40
  end
@@ -47,6 +42,7 @@ module OSC
47
42
  def response
48
43
  if received_messages = receive_raw
49
44
  received_messages.map do |message|
45
+ Qcmd.debug "[TCP::Client] message #{ message.inspect }"
50
46
  OSCPacket.messages_from_network(message)
51
47
  end.flatten
52
48
  else
@@ -80,8 +76,7 @@ module OSC
80
76
  # add SLIP encoded message to list
81
77
  messages << buffer.join
82
78
 
83
- # reset state and keep reading from the port until there's
84
- # nothing left
79
+ # reset state and keep reading from the port until there's nothing left
85
80
  buffer.clear
86
81
  received = 0
87
82
  failed = false
@@ -109,8 +104,8 @@ module OSC
109
104
  end
110
105
 
111
106
  # wait one second to see if the socket might become readable (and a
112
- # response forthcoming). normal usage is send + wait for response,
113
- # we have to give QLab a reasonable amount of time in which to respond.
107
+ # response forthcoming). normal usage is send + receive response, but
108
+ # if app doesn't intend to respond we should eventually ignore it.
114
109
 
115
110
  IO.select([@socket], [], [], 1)
116
111
  failed = true
@@ -1,5 +1,5 @@
1
1
  module Qcmd
2
- VERSION = "0.1.16"
2
+ VERSION = "0.2.0"
3
3
 
4
4
  class << self
5
5
  def installed_version
@@ -19,10 +19,12 @@ Gem::Specification.new do |gem|
19
19
 
20
20
  gem.add_runtime_dependency 'dnssd', '= 2.0'
21
21
  gem.add_runtime_dependency 'json', '= 1.7.7'
22
- gem.add_runtime_dependency 'osc-ruby', '= 1.0.0'
22
+ gem.add_runtime_dependency 'osc-ruby', '= 1.1.0'
23
23
  gem.add_runtime_dependency 'trollop', '= 2.0'
24
24
 
25
25
  gem.add_development_dependency "rspec", '~> 2.10.0'
26
26
  gem.add_development_dependency "cucumber", '= 1.2.1'
27
27
  gem.add_development_dependency "aruba"
28
+
29
+ gem.required_ruby_version = '>= 1.9'
28
30
  end
@@ -0,0 +1,2 @@
1
+ Example code playing with `qcmd` and the libraries it depends on. Any of these
2
+ can be used as starting points for more interesting sketches-in-code.
@@ -0,0 +1,16 @@
1
+ require 'rubygems'
2
+ require 'osc-ruby'
3
+
4
+ module OSC
5
+ class Client
6
+ def initialize(host, port)
7
+ @so = UDPSocket.new
8
+ # so we can send broadcast packets
9
+ @so.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true)
10
+ @so.connect(host, port)
11
+ end
12
+ end
13
+ end
14
+
15
+ c = OSC::Client.new '255.255.255.255', 53000
16
+ c.send(OSC::Message.new(ARGV[0] || "/go"))
@@ -38,7 +38,7 @@ describe Qcmd::Commands do
38
38
 
39
39
  describe 'machine commands' do
40
40
  it 'should not raise errors' do
41
- Qcmd.context.machine_connected?.should be_true
41
+ Qcmd.context.machine_connected?.should be true
42
42
  test_log
43
43
 
44
44
  Qcmd::Commands::MACHINE.each do |machine_command|
@@ -139,7 +139,7 @@ describe Qcmd::Commands do
139
139
 
140
140
  Qcmd::Commands::CUE.each do |cue_command|
141
141
  expect {
142
- test_log "using cue #{ @cue } : #{ @cue.data }"
142
+ test_log "using cue #{ @cue } : #{ @cue.data.inspect }"
143
143
  cmd = "/workspace/#{workspace.id}/cue/#{ @cue.number }/#{ cue_command }"
144
144
 
145
145
  test_log "sending #{ cmd }"
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qcmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Adam Bachman
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-06 00:00:00.000000000 Z
11
+ date: 2014-06-30 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: dnssd
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - '='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - '='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: json
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - '='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - '='
44
39
  - !ruby/object:Gem::Version
@@ -46,23 +41,20 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: osc-ruby
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - '='
52
46
  - !ruby/object:Gem::Version
53
- version: 1.0.0
47
+ version: 1.1.0
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - '='
60
53
  - !ruby/object:Gem::Version
61
- version: 1.0.0
54
+ version: 1.1.0
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: trollop
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - '='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - '='
76
67
  - !ruby/object:Gem::Version
@@ -78,23 +69,20 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rspec
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ~>
73
+ - - "~>"
84
74
  - !ruby/object:Gem::Version
85
75
  version: 2.10.0
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ~>
80
+ - - "~>"
92
81
  - !ruby/object:Gem::Version
93
82
  version: 2.10.0
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: cucumber
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - '='
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - '='
108
95
  - !ruby/object:Gem::Version
@@ -110,17 +97,15 @@ dependencies:
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: aruba
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - ">="
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  description: A simple interactive QLab 3 command line controller
@@ -132,7 +117,7 @@ executables:
132
117
  extensions: []
133
118
  extra_rdoc_files: []
134
119
  files:
135
- - .gitignore
120
+ - ".gitignore"
136
121
  - CHANGELOG.md
137
122
  - Gemfile
138
123
  - LICENSE.txt
@@ -180,6 +165,8 @@ files:
180
165
  - lib/vendor/sexpistol/sexpistol/sexpistol.rb
181
166
  - lib/vendor/sexpistol/sexpistol/sexpistol_parser.rb
182
167
  - qcmd.gemspec
168
+ - sample/README.md
169
+ - sample/broadcast_socket.rb
183
170
  - sample/dnssd.rb
184
171
  - sample/fast-rate-change.rb
185
172
  - sample/simple_console.rb
@@ -194,27 +181,26 @@ files:
194
181
  - spec/unit/qlab_spec.rb
195
182
  homepage: https://github.com/Figure53/qcmd
196
183
  licenses: []
184
+ metadata: {}
197
185
  post_install_message:
198
186
  rdoc_options: []
199
187
  require_paths:
200
188
  - lib
201
189
  required_ruby_version: !ruby/object:Gem::Requirement
202
- none: false
203
190
  requirements:
204
- - - ! '>='
191
+ - - ">="
205
192
  - !ruby/object:Gem::Version
206
- version: '0'
193
+ version: '1.9'
207
194
  required_rubygems_version: !ruby/object:Gem::Requirement
208
- none: false
209
195
  requirements:
210
- - - ! '>='
196
+ - - ">="
211
197
  - !ruby/object:Gem::Version
212
198
  version: '0'
213
199
  requirements: []
214
200
  rubyforge_project:
215
- rubygems_version: 1.8.24
201
+ rubygems_version: 2.2.2
216
202
  signing_key:
217
- specification_version: 3
203
+ specification_version: 4
218
204
  summary: QLab 3 console
219
205
  test_files:
220
206
  - features/support/setup.rb