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.
Files changed (55) hide show
  1. data/CHANGES +45 -0
  2. data/README +5 -1
  3. data/TODO +3 -23
  4. data/doc/aem-manual/04_references.html +6 -6
  5. data/doc/aem-manual/05_targettingapplications.html +3 -3
  6. data/doc/aem-manual/07_findapp.html +1 -1
  7. data/doc/appscript-manual/04_gettinghelp.html +81 -7
  8. data/doc/appscript-manual/05_keywordconversion.html +18 -18
  9. data/doc/appscript-manual/07_applicationobjects.html +4 -4
  10. data/doc/appscript-manual/08_realvsgenericreferences.html +2 -2
  11. data/doc/appscript-manual/09_referenceforms.html +12 -14
  12. data/doc/appscript-manual/11_applicationcommands.html +1 -1
  13. data/doc/appscript-manual/14_notes.html +12 -12
  14. data/doc/osax-manual/index.html +2 -0
  15. data/rb-appscript.gemspec +2 -2
  16. data/sample/AB_list_people_with_emails.rb +3 -0
  17. data/sample/Add_iCal_event.rb +3 -0
  18. data/sample/Create_daily_iCal_todos.rb +2 -0
  19. data/sample/Export_Address_Book_phone_numbers.rb +3 -0
  20. data/sample/Hello_world.rb +3 -0
  21. data/sample/List_iTunes_playlist_names.rb +3 -0
  22. data/sample/Make_Mail_message.rb +3 -0
  23. data/sample/Open_file_in_TextEdit.rb +3 -0
  24. data/sample/Organize_Mail_messages.rb +3 -0
  25. data/sample/Print_folder_tree.rb +3 -0
  26. data/sample/Select_all_HTML_files.rb +3 -0
  27. data/sample/Set_iChat_status.rb +3 -0
  28. data/sample/Simple_Finder_GUI_Scripting.rb +6 -3
  29. data/sample/Stagger_Finder_windows.rb +3 -0
  30. data/sample/TextEdit_demo.rb +3 -0
  31. data/sample/iTunes_top40_to_html.rb +3 -0
  32. data/src/SendThreadSafe.c +380 -0
  33. data/src/SendThreadSafe.h +139 -0
  34. data/src/lib/_aem/aemreference.rb +46 -18
  35. data/src/lib/_aem/codecs.rb +19 -3
  36. data/src/lib/_aem/mactypes.rb +2 -6
  37. data/src/lib/_aem/send.rb +1 -1
  38. data/src/lib/_aem/typewrappers.rb +2 -2
  39. data/src/lib/_appscript/referencerenderer.rb +10 -4
  40. data/src/lib/_appscript/reservedkeywords.rb +4 -4
  41. data/src/lib/_appscript/terminology.rb +43 -35
  42. data/src/lib/aem.rb +8 -4
  43. data/src/lib/appscript.rb +78 -15
  44. data/src/lib/kae.rb +4 -0
  45. data/src/lib/osax.rb +9 -6
  46. data/src/rbae.c +102 -23
  47. data/test/test_aemreference.rb +4 -4
  48. data/test/test_appscriptcommands.rb +2 -2
  49. data/test/test_appscriptreference.rb +4 -4
  50. data/test/test_codecs.rb +14 -1
  51. data/test/test_findapp.rb +1 -1
  52. data/test/test_mactypes.rb +1 -1
  53. data/test/test_osax.rb +1 -1
  54. data/test/testall.sh +1 -1
  55. metadata +4 -2
@@ -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').starts_with('foo').not,
56
- 'AEM.its.elements("cwor").starts_with("foo").not', nil],
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').start, 'AEM.app.elements("docu").start', nil],
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.starts_with('foo').not,
61
- 'its.words.starts_with("foo").not', nil],
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.start, @s+'.documents.start', nil],
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
@@ -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/findapp"
@@ -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/mactypes"
data/test/test_osax.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 'osax'
data/test/testall.sh CHANGED
@@ -3,7 +3,7 @@
3
3
  for f in `ls | grep '^test_'`;
4
4
  do
5
5
  echo $f
6
- /usr/local/bin/ruby $f
6
+ /usr/local/bin/ruby -w $f
7
7
  echo
8
8
  echo
9
9
  done
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.3.0
7
- date: 2007-01-18 00:00:00 +00:00
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