sonic-pi-cli 0.0.4 → 0.0.5

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sonic_pi.rb +6 -9
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04134a6ca8a18fa541d125769286b79471e73358
4
- data.tar.gz: a0755613302da38527122b885ae2796c92a6e7be
3
+ metadata.gz: 9baf05899bbbce4df8a843d4751c0c9bfa08a552
4
+ data.tar.gz: b49222531c954d2751a907aa1aef977f22536cc5
5
5
  SHA512:
6
- metadata.gz: f0470ad219ef6f84ba7021ad0872a1c3ad31be0f661c06c631ba754cbaf1e9cf60af4865ca22d63bc0fcee21fa4995a8255bea4eadf588081ef36d95b45682f1
7
- data.tar.gz: 48a73410ed6d6e86780b8a3e11d0dbf3da8bdf4baaadeae1b278f7696b92912f92c6bab578f96c65b2d6d53701da7cef81a63dacf2bfe7bcbb0748764f43a5ea
6
+ metadata.gz: d4a170127eb3d8f89bd4e543aefb53bcc9c0fe78ffeeec69efb761366aecd6ea833b909bd6e9601b7531fcbec23a98ac7ab9413f93449f4efc8f7216105bc823
7
+ data.tar.gz: 0f37817499349e424c64408d8abf232657b67b0fc1952c64ab61f72a2af7e15c4321ac67ac48d3b9f514e89a9370d7e77dc372308d2c697b1b6bff5fe51b3730
@@ -11,18 +11,17 @@ class SonicPi
11
11
  GUI_ID = 'SONIC_PI_CLI'
12
12
 
13
13
  def run(command)
14
- client.send(run_command(command))
14
+ send_command(RUN_COMMAND, command)
15
15
  end
16
16
 
17
17
  def stop
18
- client.send(stop_command)
18
+ send_command(STOP_COMMAND)
19
19
  end
20
20
 
21
21
  def test_connection!
22
22
  begin
23
23
  OSC::Server.new(PORT)
24
24
  abort("ERROR: Sonic Pi is not listening on #{PORT} - is it running?")
25
-
26
25
  rescue
27
26
  # everything is good
28
27
  end
@@ -31,15 +30,13 @@ class SonicPi
31
30
  private
32
31
 
33
32
  def client
34
- client ||= OSC::Client.new(SERVER, PORT)
33
+ @client ||= OSC::Client.new(SERVER, PORT)
35
34
  end
36
35
 
37
- def run_command(command)
38
- OSC::Message.new(RUN_COMMAND, GUI_ID, "#{command}")
36
+ def send_command(call_type, command=nil)
37
+ prepared_command = OSC::Message.new(call_type, GUI_ID, command)
38
+ client.send(prepared_command)
39
39
  end
40
40
 
41
- def stop_command
42
- OSC::Message.new(STOP_COMMAND, GUI_ID)
43
- end
44
41
  end
45
42
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sonic-pi-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Johnstone
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  version: '0'
54
54
  requirements: []
55
55
  rubyforge_project:
56
- rubygems_version: 2.2.2
56
+ rubygems_version: 2.2.5
57
57
  signing_key:
58
58
  specification_version: 4
59
59
  summary: Sonic Pi CLI