sonic-pi-cli 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sonic_pi.rb +5 -2
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04134a6ca8a18fa541d125769286b79471e73358
|
4
|
+
data.tar.gz: a0755613302da38527122b885ae2796c92a6e7be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0470ad219ef6f84ba7021ad0872a1c3ad31be0f661c06c631ba754cbaf1e9cf60af4865ca22d63bc0fcee21fa4995a8255bea4eadf588081ef36d95b45682f1
|
7
|
+
data.tar.gz: 48a73410ed6d6e86780b8a3e11d0dbf3da8bdf4baaadeae1b278f7696b92912f92c6bab578f96c65b2d6d53701da7cef81a63dacf2bfe7bcbb0748764f43a5ea
|
data/lib/sonic_pi.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
require 'socket'
|
2
2
|
require 'rubygems'
|
3
3
|
require 'osc-ruby'
|
4
|
+
require 'securerandom'
|
4
5
|
|
5
6
|
class SonicPi
|
6
7
|
RUN_COMMAND = "/run-code"
|
7
8
|
STOP_COMMAND = "/stop-all-jobs"
|
8
9
|
SERVER = 'localhost'
|
9
10
|
PORT = 4557
|
11
|
+
GUI_ID = 'SONIC_PI_CLI'
|
10
12
|
|
11
13
|
def run(command)
|
12
14
|
client.send(run_command(command))
|
@@ -20,6 +22,7 @@ class SonicPi
|
|
20
22
|
begin
|
21
23
|
OSC::Server.new(PORT)
|
22
24
|
abort("ERROR: Sonic Pi is not listening on #{PORT} - is it running?")
|
25
|
+
|
23
26
|
rescue
|
24
27
|
# everything is good
|
25
28
|
end
|
@@ -32,11 +35,11 @@ class SonicPi
|
|
32
35
|
end
|
33
36
|
|
34
37
|
def run_command(command)
|
35
|
-
OSC::Message.new(RUN_COMMAND, "#{command}")
|
38
|
+
OSC::Message.new(RUN_COMMAND, GUI_ID, "#{command}")
|
36
39
|
end
|
37
40
|
|
38
41
|
def stop_command
|
39
|
-
OSC::Message.new(STOP_COMMAND)
|
42
|
+
OSC::Message.new(STOP_COMMAND, GUI_ID)
|
40
43
|
end
|
41
44
|
end
|
42
45
|
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sonic-pi-cli
|
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
|
- Nick Johnstone
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: osc-ruby
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
description: A simple command line interface for Sonic Pi
|
@@ -31,8 +31,8 @@ executables:
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
-
- lib/sonic_pi.rb
|
35
34
|
- bin/sonic_pi
|
35
|
+
- lib/sonic_pi.rb
|
36
36
|
homepage: http://rubygems.org/gems/sonic-pi-cli
|
37
37
|
licenses:
|
38
38
|
- MIT
|
@@ -43,17 +43,17 @@ require_paths:
|
|
43
43
|
- lib
|
44
44
|
required_ruby_version: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
55
|
rubyforge_project:
|
56
|
-
rubygems_version: 2.
|
56
|
+
rubygems_version: 2.2.2
|
57
57
|
signing_key:
|
58
58
|
specification_version: 4
|
59
59
|
summary: Sonic Pi CLI
|