sonic-pi-cli 0.0.2 → 0.0.3

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/sonic_pi +2 -0
  3. data/lib/sonic_pi.rb +10 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43a8553e55e26d9d8524c48384d9d11ead78fa79
4
- data.tar.gz: 3758816b1415ba22926de0e4c12125c059c20cfb
3
+ metadata.gz: 751cbddd0c1c6e579f05c1f2669fdcd16a6a0b83
4
+ data.tar.gz: cc327c35ad46eba1e675a2ff8c638953d9ea9a19
5
5
  SHA512:
6
- metadata.gz: 23560119840b4fc6b1697f11acfa9faba06cdba26dda6fda00a1ecd3f485478098b8ad9b8019b9f909125d20ae786705f47371f8480af99a37d585267d665ddf
7
- data.tar.gz: 1294baad72f65a96efe0af2311675d8c0218bf2de477f9c1671782ff6cd27d30fd24f35b1b700d31a8149f1f7126bf53d303ccb099d72a1bfdb94496d57907a9
6
+ metadata.gz: 69cade9cdd9e4e7b9e45f9de5e41a11186b6068badc16ff8b861d8d4a94b596992cf1762300d9d573bee1f3ab9b6845ec3506b84f536ec7d0a8df5e81c1b289a
7
+ data.tar.gz: 132b9076ba9a2ec4983e06fa04a14cc55ba421b46c68aa6dacf023fb22e966972d6ce8d405e4e0e30e882552e33c92eb3bce3042a83acafbe6cbeb1a7c440ea2
@@ -45,6 +45,8 @@ end
45
45
  def run
46
46
  app = SonicPi.new
47
47
 
48
+ app.test_connection!
49
+
48
50
  case args_and_stdin
49
51
  when '--help', ''
50
52
  print_help
@@ -1,4 +1,4 @@
1
-
1
+ require 'socket'
2
2
  require 'rubygems'
3
3
  require 'osc-ruby'
4
4
 
@@ -16,6 +16,15 @@ class SonicPi
16
16
  client.send(stop_command)
17
17
  end
18
18
 
19
+ def test_connection!
20
+ begin
21
+ OSC::Server.new(PORT)
22
+ abort("ERROR: Sonic Pi is not listening on #{PORT} - is it running?")
23
+ rescue
24
+ # everything is good
25
+ end
26
+ end
27
+
19
28
  private
20
29
 
21
30
  def client
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.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Johnstone