Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor edits to extconf and lib/rbosa.rb to make it work on system 1.8…

….x as well as on RVM-installed 1.9.2 (tested on OS X)
  • Loading branch information...
commit 2a78143ebd1520d953be4ec3c0618f7690f06f9c 1 parent b53dba2
@pbosetti authored
Showing with 17 additions and 8 deletions.
  1. +7 −2 extconf.rb
  2. +5 −5 rubyosa.gemspec
  3. +5 −1 src/lib/rbosa.rb
View
9 extconf.rb
@@ -38,8 +38,13 @@
# Avoid `ID' and `T_DATA' symbol collisions between Ruby and Carbon.
# (adapted code from RubyAEOSA - FUJIMOTO Hisakuni <hisa@fobj.com>)
-ruby_h = "#{Config::CONFIG['rubyhdrdir']}/ruby.h"
-intern_h = "#{Config::CONFIG['rubyhdrdir']}/ruby/intern.h"
+if RUBY_VERSION =~ /^1.9/ then
+ ruby_h = "#{Config::CONFIG['rubyhdrdir']}/ruby.h"
+ intern_h = "#{Config::CONFIG['rubyhdrdir']}/ruby/intern.h"
+else
+ ruby_h = "#{Config::CONFIG['archdir']}/ruby.h"
+ intern_h = "#{Config::CONFIG['archdir']}/intern.h"
+end
new_filename_prefix = 'osx_'
[ ruby_h, intern_h ].each do |src_path|
dst_fname = File.join('./src', new_filename_prefix + File.basename(src_path))
View
10 rubyosa.gemspec
@@ -1,14 +1,14 @@
Gem::Specification.new do |s|
- s.name = 'pbosetti-rubyosa'
+ s.name = 'rubyosa19'
s.version = '0.5.4'
- s.date = '2009-11-09'
+ s.date = '2011-03-03'
s.summary = 'A Ruby/AppleEvent bridge.'
- s.email = 'lsansonetti@apple.com'
- s.homepage = 'http://rubyosa.rubyforge.org'
+ s.email = 'p4010@me.com'
+ s.homepage = 'http://github.com/pbosetti/rubyosa'
s.rubyforge_project = 'rubyosa'
s.description = "RubyOSA is a bridge that connects Ruby to the Apple Event Manager, automatically populating the API according to the target application's scriptable definition. This version is 1.9.2 compatible!"
s.has_rdoc = false
- s.authors = ['Laurent Sansonetti']
+ s.authors = ['Laurent Sansonetti', 'Paolo Bosetti (adapting for 1.9)']
s.files = ['README.markdown', 'COPYRIGHT', 'AUTHORS', 'extconf.rb', 'src/rbosa.c', 'src/rbosa.h', 'src/rbosa_conv.c', 'src/rbosa_sdef.c', 'src/rbosa_err.c', 'src/lib/rbosa.rb', 'src/lib/rbosa_properties.rb', 'sample/Finder/show_desktop.rb', 'sample/iChat/uptime.rb', 'sample/iTunes/control.rb', 'sample/iTunes/fade_volume.rb', 'sample/iTunes/inspect.rb', 'sample/QuickTime/play_all.rb', 'sample/misc/sdef.rb', 'sample/BBEdit/unix_script.rb', 'sample/TextEdit/hello_world.rb', 'sample/iChat/image.rb', 'sample/iTunes/artwork.rb', 'sample/Mail/get_selected_mail.rb', 'sample/AddressBook/inspect.rb', 'sample/iTunes/tag_genre_lastfm.rb', 'data/rubyosa/rdoc_html.rb', 'sample/Photoshop/new_doc.rb', 'sample/Photoshop/new_doc_with_text.rb', 'sample/iTunes/name_that_tune.rb']
s.extensions = ['extconf.rb']
s.executables = ['rdoc-osa']
View
6 src/lib/rbosa.rb
@@ -36,7 +36,11 @@
class String
def to_4cc
- OSA.__four_char_code__(Iconv.iconv('MACROMAN', 'UTF-8', self).to_s)
+ if RUBY_VERSION =~ /^1.9/ then
+ OSA.__four_char_code__(Iconv.iconv('MACROMAN', 'UTF-8', self)[0].to_s)
+ else
+ OSA.__four_char_code__(Iconv.iconv('MACROMAN', 'UTF-8', self).to_s)
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.