rb-appscript 0.3.0 → 0.4.0
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.
- data/CHANGES +45 -0
- data/README +5 -1
- data/TODO +3 -23
- data/doc/aem-manual/04_references.html +6 -6
- data/doc/aem-manual/05_targettingapplications.html +3 -3
- data/doc/aem-manual/07_findapp.html +1 -1
- data/doc/appscript-manual/04_gettinghelp.html +81 -7
- data/doc/appscript-manual/05_keywordconversion.html +18 -18
- data/doc/appscript-manual/07_applicationobjects.html +4 -4
- data/doc/appscript-manual/08_realvsgenericreferences.html +2 -2
- data/doc/appscript-manual/09_referenceforms.html +12 -14
- data/doc/appscript-manual/11_applicationcommands.html +1 -1
- data/doc/appscript-manual/14_notes.html +12 -12
- data/doc/osax-manual/index.html +2 -0
- data/rb-appscript.gemspec +2 -2
- data/sample/AB_list_people_with_emails.rb +3 -0
- data/sample/Add_iCal_event.rb +3 -0
- data/sample/Create_daily_iCal_todos.rb +2 -0
- data/sample/Export_Address_Book_phone_numbers.rb +3 -0
- data/sample/Hello_world.rb +3 -0
- data/sample/List_iTunes_playlist_names.rb +3 -0
- data/sample/Make_Mail_message.rb +3 -0
- data/sample/Open_file_in_TextEdit.rb +3 -0
- data/sample/Organize_Mail_messages.rb +3 -0
- data/sample/Print_folder_tree.rb +3 -0
- data/sample/Select_all_HTML_files.rb +3 -0
- data/sample/Set_iChat_status.rb +3 -0
- data/sample/Simple_Finder_GUI_Scripting.rb +6 -3
- data/sample/Stagger_Finder_windows.rb +3 -0
- data/sample/TextEdit_demo.rb +3 -0
- data/sample/iTunes_top40_to_html.rb +3 -0
- data/src/SendThreadSafe.c +380 -0
- data/src/SendThreadSafe.h +139 -0
- data/src/lib/_aem/aemreference.rb +46 -18
- data/src/lib/_aem/codecs.rb +19 -3
- data/src/lib/_aem/mactypes.rb +2 -6
- data/src/lib/_aem/send.rb +1 -1
- data/src/lib/_aem/typewrappers.rb +2 -2
- data/src/lib/_appscript/referencerenderer.rb +10 -4
- data/src/lib/_appscript/reservedkeywords.rb +4 -4
- data/src/lib/_appscript/terminology.rb +43 -35
- data/src/lib/aem.rb +8 -4
- data/src/lib/appscript.rb +78 -15
- data/src/lib/kae.rb +4 -0
- data/src/lib/osax.rb +9 -6
- data/src/rbae.c +102 -23
- data/test/test_aemreference.rb +4 -4
- data/test/test_appscriptcommands.rb +2 -2
- data/test/test_appscriptreference.rb +4 -4
- data/test/test_codecs.rb +14 -1
- data/test/test_findapp.rb +1 -1
- data/test/test_mactypes.rb +1 -1
- data/test/test_osax.rb +1 -1
- data/test/testall.sh +1 -1
- metadata +4 -2
data/test/test_aemreference.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/usr/local/bin/ruby
|
1
|
+
#!/usr/local/bin/ruby -w
|
2
2
|
|
3
3
|
require 'test/unit'
|
4
4
|
require "_aem/aemreference"
|
@@ -52,8 +52,8 @@ class TC_AEMReferences < Test::Unit::TestCase
|
|
52
52
|
[AEMReference::Its.elements('cwor').property('leng').gt(0),
|
53
53
|
'AEM.its.elements("cwor").property("leng").gt(0)', nil],
|
54
54
|
[AEMReference::Its.elements('cwor').le(''), 'AEM.its.elements("cwor").le("")', nil],
|
55
|
-
[AEMReference::Its.elements('cwor').
|
56
|
-
'AEM.its.elements("cwor").
|
55
|
+
[AEMReference::Its.elements('cwor').begins_with('foo').not,
|
56
|
+
'AEM.its.elements("cwor").begins_with("foo").not', nil],
|
57
57
|
|
58
58
|
|
59
59
|
[AEMReference::Its.elements('cwor').contains('foo'), 'AEM.its.elements("cwor").contains("foo")', nil],
|
@@ -75,7 +75,7 @@ class TC_AEMReferences < Test::Unit::TestCase
|
|
75
75
|
'AEM.its.property("pnam").ne("foo").and(AEM.its.elements("cfol").eq([])).not',
|
76
76
|
AEMReference::Its.property('pnam').eq('foo').not.and(AEMReference::Its.elements('cfol').eq([])).not],
|
77
77
|
|
78
|
-
[AEMReference::App.elements('docu').
|
78
|
+
[AEMReference::App.elements('docu').beginning, 'AEM.app.elements("docu").beginning', nil],
|
79
79
|
[AEMReference::App.elements('docu').end, 'AEM.app.elements("docu").end', nil],
|
80
80
|
[AEMReference::App.elements('docu').by_index(3).before, 'AEM.app.elements("docu").by_index(3).before', nil],
|
81
81
|
[AEMReference::App.elements('docu').by_name('foo').after, 'AEM.app.elements("docu").by_name("foo").after', nil],
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/usr/local/bin/ruby
|
1
|
+
#!/usr/local/bin/ruby -w
|
2
2
|
|
3
3
|
require 'test/unit'
|
4
4
|
require 'appscript'
|
@@ -51,7 +51,7 @@ class TC_AppscriptNewApp < Test::Unit::TestCase
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def test_by_pid
|
54
|
-
pid = `top -l1 | grep Finder | awk '{ print $1 }'`.to_i
|
54
|
+
pid = `top -l1 | grep Finder | awk '{ print $1 }'`.to_i # note: this line will return a bad result if more than one user is logged in
|
55
55
|
a = Appscript.app.by_pid(pid)
|
56
56
|
assert_instance_of(Appscript::Reference, a.name)
|
57
57
|
assert_equal("app.by_pid(#{pid})", a.to_s)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/usr/local/bin/ruby
|
1
|
+
#!/usr/local/bin/ruby -w
|
2
2
|
|
3
3
|
require 'test/unit'
|
4
4
|
require "appscript"
|
@@ -57,8 +57,8 @@ class TC_AppscriptReferences < Test::Unit::TestCase
|
|
57
57
|
[Appscript.its.words.size.gt(0),
|
58
58
|
'its.words.size.gt(0)', nil],
|
59
59
|
[Appscript.its.words.le(''), 'its.words.le("")', nil],
|
60
|
-
[Appscript.its.words.
|
61
|
-
'its.words.
|
60
|
+
[Appscript.its.words.begins_with('foo').not,
|
61
|
+
'its.words.begins_with("foo").not', nil],
|
62
62
|
|
63
63
|
|
64
64
|
[Appscript.its.words.contains('foo'), 'its.words.contains("foo")', nil],
|
@@ -84,7 +84,7 @@ class TC_AppscriptReferences < Test::Unit::TestCase
|
|
84
84
|
'its.name.ne("foo").and(its.words.eq([])).not',
|
85
85
|
Appscript.its.name.eq('foo').not.and(Appscript.its.words.eq([])).not],
|
86
86
|
|
87
|
-
[@te.documents.
|
87
|
+
[@te.documents.beginning, @s+'.documents.beginning', nil],
|
88
88
|
[@te.documents.end, @s+'.documents.end', nil],
|
89
89
|
[@te.documents[3].before, @s+'.documents[3].before', nil],
|
90
90
|
[@te.documents['foo'].after, @s+'.documents["foo"].after', nil],
|
data/test/test_codecs.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/usr/local/bin/ruby
|
1
|
+
#!/usr/local/bin/ruby -w
|
2
2
|
|
3
3
|
require 'test/unit'
|
4
4
|
require 'aem'
|
@@ -156,4 +156,17 @@ class TC_Codecs < Test::Unit::TestCase
|
|
156
156
|
d = @c.pack(val)
|
157
157
|
assert_equal(expected_val, @c.unpack(d))
|
158
158
|
end
|
159
|
+
|
160
|
+
def test_units
|
161
|
+
val = MacTypes::Units.new(3.3, :inches)
|
162
|
+
assert_equal(:inches, val.type)
|
163
|
+
assert_equal(3.3, val.value)
|
164
|
+
d = @c.pack(val)
|
165
|
+
assert_equal('inch', d.type)
|
166
|
+
assert_equal(3.3, @c.unpack(d.coerce(KAE::TypeFloat)))
|
167
|
+
val2 = @c.unpack(d)
|
168
|
+
assert_equal(val, val2)
|
169
|
+
assert_equal(:inches, val2.type)
|
170
|
+
assert_equal(3.3, val2.value)
|
171
|
+
end
|
159
172
|
end
|
data/test/test_findapp.rb
CHANGED
data/test/test_mactypes.rb
CHANGED
data/test/test_osax.rb
CHANGED
data/test/testall.sh
CHANGED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rb-appscript
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.4.0
|
7
|
+
date: 2007-08-17 00:00:00 +01:00
|
8
8
|
summary: Ruby appscript (rb-appscript) is a high-level, user-friendly Apple event bridge that allows you to control scriptable Mac OS X applications using ordinary Ruby scripts.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -96,6 +96,8 @@ files:
|
|
96
96
|
- sample/TextEdit_demo.rb
|
97
97
|
- src/lib
|
98
98
|
- src/rbae.c
|
99
|
+
- src/SendThreadSafe.c
|
100
|
+
- src/SendThreadSafe.h
|
99
101
|
- src/lib/_aem
|
100
102
|
- src/lib/_appscript
|
101
103
|
- src/lib/aem.rb
|