livecode 0.0.2 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/bin/livecode +68 -0
- data/extras/textmate/Ruby Livecode.tmbundle/Commands/Execute Document.tmCommand +38 -0
- data/extras/textmate/Ruby Livecode.tmbundle/Commands/Execute Selection:Line.tmCommand +40 -0
- data/extras/textmate/Ruby Livecode.tmbundle/Commands/Execute Selection:Scope.tmCommand +40 -0
- data/extras/textmate/Ruby Livecode.tmbundle/Commands/Start.tmCommand +25 -0
- data/extras/textmate/Ruby Livecode.tmbundle/Commands/Stop.tmCommand +25 -0
- data/extras/textmate/Ruby Livecode.tmbundle/Syntaxes/Ruby Livecode.tmLanguage +25 -0
- data/extras/textmate/Ruby Livecode.tmbundle/info.plist +43 -0
- data/lib/livecode_server.rb +1 -1
- data/livecode.gemspec +12 -5
- metadata +12 -5
- data/bin/livecode_server +0 -34
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/bin/livecode
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
4
|
+
|
5
|
+
require 'pathname'
|
6
|
+
require 'rubygems'
|
7
|
+
require 'daemons'
|
8
|
+
require 'livecode_server'
|
9
|
+
|
10
|
+
class Daemons::Controller
|
11
|
+
def print_usage
|
12
|
+
puts "Usage: #{@app_name} <command> <options> -- <application options>"
|
13
|
+
puts
|
14
|
+
puts "Server control commands:"
|
15
|
+
puts " start Start the server"
|
16
|
+
puts " stop Stop the server"
|
17
|
+
puts " restart Stop and restart the server"
|
18
|
+
puts " run Start the server and stay on top"
|
19
|
+
puts " status Show server status"
|
20
|
+
#puts " zap set the application to a stopped state"
|
21
|
+
puts
|
22
|
+
puts "Tools:"
|
23
|
+
puts " update_textmate Install or update the TextMate bundle"
|
24
|
+
puts
|
25
|
+
puts "* and where <options> may contain several of the following:"
|
26
|
+
puts @optparse.usage
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
LivecodeServer.make_dir!
|
31
|
+
|
32
|
+
daemon_options = {
|
33
|
+
:dir_mode => :normal,
|
34
|
+
:dir => LivecodeServer::CONFIG_DIR
|
35
|
+
}
|
36
|
+
|
37
|
+
case ARGV.first
|
38
|
+
when 'update_textmate'
|
39
|
+
puts "Updating Textmate bundle.."
|
40
|
+
`sudo mkdir -p /Library/Application\\ Support/TextMate/Bundles`
|
41
|
+
if File.exists?("/Library/Application Support/TextMate/Bundles/Ruby Livecode.tmbundle")
|
42
|
+
`sudo rm /Library/Application\\ Support/TextMate/Bundles/Ruby\\ Livecode.tmbundle`
|
43
|
+
end
|
44
|
+
bundle_path = Pathname.new(File.join(File.dirname(File.expand_path($0)), '../extras/textmate/Ruby Livecode.tmbundle')).realpath.to_s
|
45
|
+
escaped_bundle_path = bundle_path.gsub(/\s/, '\ ')
|
46
|
+
`sudo ln -s #{escaped_bundle_path} /Library/Application\\ Support/TextMate/Bundles/Ruby\\ Livecode.tmbundle`
|
47
|
+
`osascript -e 'tell app "TextMate" to reload bundles'`
|
48
|
+
else
|
49
|
+
group = Daemons.run_proc(File.basename($0), daemon_options) do
|
50
|
+
LivecodeServer.make_dir!
|
51
|
+
unless LivecodeServer.running?
|
52
|
+
server = LivecodeServer::Daemon.new
|
53
|
+
DRb.start_service nil, server
|
54
|
+
LivecodeServer.register_uri DRb.uri
|
55
|
+
puts "Started Livecode server on #{DRb.uri}"
|
56
|
+
puts "Press ^C to exit"
|
57
|
+
trap_proc = proc{
|
58
|
+
puts "Exiting..."
|
59
|
+
LivecodeServer.register_shutdown
|
60
|
+
exit
|
61
|
+
}
|
62
|
+
%w{SIGINT TERM}.each{|s| trap s, trap_proc}
|
63
|
+
DRb.thread.join
|
64
|
+
else
|
65
|
+
puts "Livecode server appears to be running on #{LivecodeServer.uri}. Please check your processes."
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>beforeRunningCommand</key>
|
6
|
+
<string>nop</string>
|
7
|
+
<key>command</key>
|
8
|
+
<string>#!/usr/bin/env ruby -KU
|
9
|
+
|
10
|
+
require 'rubygems'
|
11
|
+
require 'livecode_server'
|
12
|
+
code = STDIN.read
|
13
|
+
client = LivecodeServer::Client.new
|
14
|
+
|
15
|
+
begin
|
16
|
+
client.run code
|
17
|
+
rescue LivecodeServer::ConnectionError => e
|
18
|
+
puts "Livecode server not running!\n\n"
|
19
|
+
puts '- Press ⌘B to start in daemon mode'
|
20
|
+
puts '- Run in Terminal with "livecode run"'
|
21
|
+
rescue Exception => e
|
22
|
+
puts "Error!"
|
23
|
+
puts " #{e.class}: #{e}"
|
24
|
+
end</string>
|
25
|
+
<key>input</key>
|
26
|
+
<string>document</string>
|
27
|
+
<key>keyEquivalent</key>
|
28
|
+
<string>@r</string>
|
29
|
+
<key>name</key>
|
30
|
+
<string>Execute Document</string>
|
31
|
+
<key>output</key>
|
32
|
+
<string>showAsTooltip</string>
|
33
|
+
<key>scope</key>
|
34
|
+
<string>source.ruby.livecode</string>
|
35
|
+
<key>uuid</key>
|
36
|
+
<string>D0828725-3DE5-43FB-BDEC-FF90DB9DE9A7</string>
|
37
|
+
</dict>
|
38
|
+
</plist>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>beforeRunningCommand</key>
|
6
|
+
<string>nop</string>
|
7
|
+
<key>command</key>
|
8
|
+
<string>#!/usr/bin/env ruby -KU
|
9
|
+
|
10
|
+
require 'rubygems'
|
11
|
+
require 'livecode_server'
|
12
|
+
code = STDIN.read
|
13
|
+
client = LivecodeServer::Client.new
|
14
|
+
|
15
|
+
begin
|
16
|
+
client.run code
|
17
|
+
rescue LivecodeServer::ConnectionError => e
|
18
|
+
puts "Livecode server not running!\n\n"
|
19
|
+
puts '- Press ⌘B to start in daemon mode'
|
20
|
+
puts '- Run in Terminal with "livecode run"'
|
21
|
+
rescue Exception => e
|
22
|
+
puts "Error!"
|
23
|
+
puts " #{e.class}: #{e}"
|
24
|
+
end</string>
|
25
|
+
<key>fallbackInput</key>
|
26
|
+
<string>line</string>
|
27
|
+
<key>input</key>
|
28
|
+
<string>selection</string>
|
29
|
+
<key>keyEquivalent</key>
|
30
|
+
<string>@e</string>
|
31
|
+
<key>name</key>
|
32
|
+
<string>Execute Selection/Line</string>
|
33
|
+
<key>output</key>
|
34
|
+
<string>showAsTooltip</string>
|
35
|
+
<key>scope</key>
|
36
|
+
<string>source.ruby.livecode</string>
|
37
|
+
<key>uuid</key>
|
38
|
+
<string>A171158B-D12C-4A2A-A40E-221873AE80E4</string>
|
39
|
+
</dict>
|
40
|
+
</plist>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>beforeRunningCommand</key>
|
6
|
+
<string>nop</string>
|
7
|
+
<key>command</key>
|
8
|
+
<string>#!/usr/bin/env ruby -KU
|
9
|
+
|
10
|
+
require 'rubygems'
|
11
|
+
require 'livecode_server'
|
12
|
+
code = STDIN.read
|
13
|
+
client = LivecodeServer::Client.new
|
14
|
+
|
15
|
+
begin
|
16
|
+
client.run code
|
17
|
+
rescue LivecodeServer::ConnectionError => e
|
18
|
+
puts "Livecode server not running!\n\n"
|
19
|
+
puts '- Press ⌘B to start in daemon mode'
|
20
|
+
puts '- Run in Terminal with "livecode run"'
|
21
|
+
rescue Exception => e
|
22
|
+
puts "Error!"
|
23
|
+
puts " #{e.class}: #{e}"
|
24
|
+
end</string>
|
25
|
+
<key>fallbackInput</key>
|
26
|
+
<string>scope</string>
|
27
|
+
<key>input</key>
|
28
|
+
<string>selection</string>
|
29
|
+
<key>keyEquivalent</key>
|
30
|
+
<string>^e</string>
|
31
|
+
<key>name</key>
|
32
|
+
<string>Execute Selection/Scope</string>
|
33
|
+
<key>output</key>
|
34
|
+
<string>showAsTooltip</string>
|
35
|
+
<key>scope</key>
|
36
|
+
<string>source.ruby.livecode</string>
|
37
|
+
<key>uuid</key>
|
38
|
+
<string>F1A4B1E4-3324-4E7F-B102-EA9FC8D5EED3</string>
|
39
|
+
</dict>
|
40
|
+
</plist>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>beforeRunningCommand</key>
|
6
|
+
<string>nop</string>
|
7
|
+
<key>command</key>
|
8
|
+
<string>#!/usr/bin/env ruby
|
9
|
+
|
10
|
+
puts "Starting Livecode server... (Press ⇧⌘B to stop)"
|
11
|
+
puts `livecode start`</string>
|
12
|
+
<key>input</key>
|
13
|
+
<string>none</string>
|
14
|
+
<key>keyEquivalent</key>
|
15
|
+
<string>@b</string>
|
16
|
+
<key>name</key>
|
17
|
+
<string>Start</string>
|
18
|
+
<key>output</key>
|
19
|
+
<string>showAsTooltip</string>
|
20
|
+
<key>scope</key>
|
21
|
+
<string>source.ruby.livecode</string>
|
22
|
+
<key>uuid</key>
|
23
|
+
<string>3D80B4C9-9D0F-42BD-9440-E69FDE044CBA</string>
|
24
|
+
</dict>
|
25
|
+
</plist>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>beforeRunningCommand</key>
|
6
|
+
<string>nop</string>
|
7
|
+
<key>command</key>
|
8
|
+
<string>#!/usr/bin/env ruby
|
9
|
+
|
10
|
+
puts "Stopping Livecode server..."
|
11
|
+
puts `livecode stop`</string>
|
12
|
+
<key>input</key>
|
13
|
+
<string>none</string>
|
14
|
+
<key>keyEquivalent</key>
|
15
|
+
<string>@B</string>
|
16
|
+
<key>name</key>
|
17
|
+
<string>Stop</string>
|
18
|
+
<key>output</key>
|
19
|
+
<string>showAsTooltip</string>
|
20
|
+
<key>scope</key>
|
21
|
+
<string>source.ruby.livecode</string>
|
22
|
+
<key>uuid</key>
|
23
|
+
<string>7AAC044D-D320-47B8-85E6-F20D3EE6B3D7</string>
|
24
|
+
</dict>
|
25
|
+
</plist>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>fileTypes</key>
|
6
|
+
<array>
|
7
|
+
<string>rblive</string>
|
8
|
+
</array>
|
9
|
+
<key>keyEquivalent</key>
|
10
|
+
<string>~@R</string>
|
11
|
+
<key>name</key>
|
12
|
+
<string>Ruby Livecode</string>
|
13
|
+
<key>patterns</key>
|
14
|
+
<array>
|
15
|
+
<dict>
|
16
|
+
<key>include</key>
|
17
|
+
<string>source.ruby</string>
|
18
|
+
</dict>
|
19
|
+
</array>
|
20
|
+
<key>scopeName</key>
|
21
|
+
<string>source.ruby.livecode</string>
|
22
|
+
<key>uuid</key>
|
23
|
+
<string>5005ED25-4281-4325-B6B6-35C4A219200A</string>
|
24
|
+
</dict>
|
25
|
+
</plist>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>mainMenu</key>
|
6
|
+
<dict>
|
7
|
+
<key>items</key>
|
8
|
+
<array>
|
9
|
+
<string>D0828725-3DE5-43FB-BDEC-FF90DB9DE9A7</string>
|
10
|
+
<string>A171158B-D12C-4A2A-A40E-221873AE80E4</string>
|
11
|
+
<string>F1A4B1E4-3324-4E7F-B102-EA9FC8D5EED3</string>
|
12
|
+
<string>------------------------------------</string>
|
13
|
+
<string>8C97BBC9-9456-4329-BAAB-AB223FEFC72F</string>
|
14
|
+
</array>
|
15
|
+
<key>submenus</key>
|
16
|
+
<dict>
|
17
|
+
<key>8C97BBC9-9456-4329-BAAB-AB223FEFC72F</key>
|
18
|
+
<dict>
|
19
|
+
<key>items</key>
|
20
|
+
<array>
|
21
|
+
<string>3D80B4C9-9D0F-42BD-9440-E69FDE044CBA</string>
|
22
|
+
<string>7AAC044D-D320-47B8-85E6-F20D3EE6B3D7</string>
|
23
|
+
</array>
|
24
|
+
<key>name</key>
|
25
|
+
<string>Server</string>
|
26
|
+
</dict>
|
27
|
+
</dict>
|
28
|
+
</dict>
|
29
|
+
<key>name</key>
|
30
|
+
<string>Ruby Livecode</string>
|
31
|
+
<key>ordering</key>
|
32
|
+
<array>
|
33
|
+
<string>5005ED25-4281-4325-B6B6-35C4A219200A</string>
|
34
|
+
<string>D0828725-3DE5-43FB-BDEC-FF90DB9DE9A7</string>
|
35
|
+
<string>A171158B-D12C-4A2A-A40E-221873AE80E4</string>
|
36
|
+
<string>F1A4B1E4-3324-4E7F-B102-EA9FC8D5EED3</string>
|
37
|
+
<string>3D80B4C9-9D0F-42BD-9440-E69FDE044CBA</string>
|
38
|
+
<string>7AAC044D-D320-47B8-85E6-F20D3EE6B3D7</string>
|
39
|
+
</array>
|
40
|
+
<key>uuid</key>
|
41
|
+
<string>2A003063-9054-4398-9E53-F0139603A721</string>
|
42
|
+
</dict>
|
43
|
+
</plist>
|
data/lib/livecode_server.rb
CHANGED
data/livecode.gemspec
CHANGED
@@ -5,15 +5,15 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{livecode}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Inge J\303\270rgensen"]
|
12
|
-
s.date = %q{2009-10-
|
13
|
-
s.default_executable = %q{
|
12
|
+
s.date = %q{2009-10-22}
|
13
|
+
s.default_executable = %q{livecode}
|
14
14
|
s.description = %q{A toolkit for livecoding using Ruby and TextMate on OSX}
|
15
15
|
s.email = %q{inge@elektronaut.no}
|
16
|
-
s.executables = ["
|
16
|
+
s.executables = ["livecode"]
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"LICENSE",
|
19
19
|
"README.rdoc"
|
@@ -25,7 +25,14 @@ Gem::Specification.new do |s|
|
|
25
25
|
"README.rdoc",
|
26
26
|
"Rakefile",
|
27
27
|
"VERSION",
|
28
|
-
"bin/
|
28
|
+
"bin/livecode",
|
29
|
+
"extras/textmate/Ruby Livecode.tmbundle/Commands/Execute Document.tmCommand",
|
30
|
+
"extras/textmate/Ruby Livecode.tmbundle/Commands/Execute Selection:Line.tmCommand",
|
31
|
+
"extras/textmate/Ruby Livecode.tmbundle/Commands/Execute Selection:Scope.tmCommand",
|
32
|
+
"extras/textmate/Ruby Livecode.tmbundle/Commands/Start.tmCommand",
|
33
|
+
"extras/textmate/Ruby Livecode.tmbundle/Commands/Stop.tmCommand",
|
34
|
+
"extras/textmate/Ruby Livecode.tmbundle/Syntaxes/Ruby Livecode.tmLanguage",
|
35
|
+
"extras/textmate/Ruby Livecode.tmbundle/info.plist",
|
29
36
|
"lib/livecode.rb",
|
30
37
|
"lib/livecode_server.rb",
|
31
38
|
"lib/livecode_server/client.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: livecode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Inge J\xC3\xB8rgensen"
|
@@ -9,8 +9,8 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
13
|
-
default_executable:
|
12
|
+
date: 2009-10-22 00:00:00 +02:00
|
13
|
+
default_executable: livecode
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: daemons
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
description: A toolkit for livecoding using Ruby and TextMate on OSX
|
26
26
|
email: inge@elektronaut.no
|
27
27
|
executables:
|
28
|
-
-
|
28
|
+
- livecode
|
29
29
|
extensions: []
|
30
30
|
|
31
31
|
extra_rdoc_files:
|
@@ -38,7 +38,14 @@ files:
|
|
38
38
|
- README.rdoc
|
39
39
|
- Rakefile
|
40
40
|
- VERSION
|
41
|
-
- bin/
|
41
|
+
- bin/livecode
|
42
|
+
- extras/textmate/Ruby Livecode.tmbundle/Commands/Execute Document.tmCommand
|
43
|
+
- extras/textmate/Ruby Livecode.tmbundle/Commands/Execute Selection:Line.tmCommand
|
44
|
+
- extras/textmate/Ruby Livecode.tmbundle/Commands/Execute Selection:Scope.tmCommand
|
45
|
+
- extras/textmate/Ruby Livecode.tmbundle/Commands/Start.tmCommand
|
46
|
+
- extras/textmate/Ruby Livecode.tmbundle/Commands/Stop.tmCommand
|
47
|
+
- extras/textmate/Ruby Livecode.tmbundle/Syntaxes/Ruby Livecode.tmLanguage
|
48
|
+
- extras/textmate/Ruby Livecode.tmbundle/info.plist
|
42
49
|
- lib/livecode.rb
|
43
50
|
- lib/livecode_server.rb
|
44
51
|
- lib/livecode_server/client.rb
|
data/bin/livecode_server
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
4
|
-
|
5
|
-
require 'rubygems'
|
6
|
-
require 'daemons'
|
7
|
-
require 'livecode_server'
|
8
|
-
|
9
|
-
LivecodeServer.make_dir!
|
10
|
-
|
11
|
-
daemon_options = {
|
12
|
-
:dir_mode => :normal,
|
13
|
-
:dir => LivecodeServer::CONFIG_DIR
|
14
|
-
}
|
15
|
-
|
16
|
-
group = Daemons.run_proc(File.basename($0), daemon_options) do
|
17
|
-
server = LivecodeServer::Daemon.new
|
18
|
-
unless LivecodeServer.running?
|
19
|
-
DRb.start_service nil, server
|
20
|
-
LivecodeServer.register_uri DRb.uri
|
21
|
-
puts "Started Livecode server on #{DRb.uri}"
|
22
|
-
puts "Press ^C to exit"
|
23
|
-
trap_proc = proc{
|
24
|
-
puts "Exiting..."
|
25
|
-
LivecodeServer.register_shutdown
|
26
|
-
exit
|
27
|
-
}
|
28
|
-
%w{SIGINT TERM}.each{|s| trap s, trap_proc}
|
29
|
-
DRb.thread.join
|
30
|
-
else
|
31
|
-
puts "Livecode server appears to be running on #{LivecodeServer.uri}. Please check your processes."
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|