Cookies op Tweakers

Tweakers maakt gebruik van cookies, onder andere om de website te analyseren, het gebruiksgemak te vergroten en advertenties te tonen. Door gebruik te maken van deze website, of door op 'Ga verder' te klikken, geef je toestemming voor het gebruik van cookies. Wil je meer informatie over cookies en hoe ze worden gebruikt, bekijk dan ons cookiebeleid.

Meer informatie

Door , , 2 reacties
Bron: RubyCocoa

De ontwikkelaars van RubyCocoa hebben enkele dagen geleden versie 0.11.0 aangekondigd en op de servers van SourceForge klaargezet ter download. RubyCocoa maakt het mogelijk om in de scripttaal Ruby programma's te ontwikkelen in Cocoa. Daarnaast is het uiteraard mogelijk om webapplicaties te schrijven in het framework van Ruby. Welke veranderingen de ontwikkelaars in RubyCocoa 0.11.0 hebben doorgevoerd, is hieronder te lezen:

Features:
  • Now shipping with RDoc HTML/ri files covering the frameworks RubyCocoa supports. The methods and their documentation come from the latest reference documentation from Apple (07-05-2007) and have been parsed and manipulated to look like the syntax used on the Ruby side of RubyCocoa.
  • Better global support for the C bits of frameworks, thanks to the new BridgeSupport changes. More exposure of C symbols, support for string constants, inline functions, functions with pointer-like arguments, function pointer arguments, opaque structures, magic-cookie constants, and more. Support for endianness-specific elements. Support for QuartzComposer.
  • Introduced ActiveRecord bindings. It means that you can now use ActiveRecord in the same way you would use CoreData when writing the backend of your application. It also has support for ActiveRecord migrations. It comes with some extra OSX support, like creating and connecting to a SQLite database in the user's ~/Library. There's also a NSTableView subclass which has one extra instance method which allows you to scaffold the table columns for a given model.
  • Added support for overriding class methods, using #objc_class_method. #objc_export has been deprecated and #objc_method should be used instead.
  • Added support for aliasing Objective-C methods from ruby, through #objc_alias_method and #objc_alias_class_method.
  • Introduced new RBBundle API, to use RubyCocoa in a bundle (like SIMBL).
  • Added syntax-sugar APIs to manage property lists. OSA.load_plist, to deserialize plist data of any format to a Ruby object. #to_plist(format=nil), to convert the given Ruby object to plist data of the given format (XML by default).
  • Better interface of basic Objective-C types and their Ruby equivalents. NSString responds to all methods String does. Time objects are converted to NSDate objects. Added NSObject#to_ruby, which converts the given Cocoa type to the Ruby equivalent (converting sub-elements for NSArray and NSDictionary).
  • Support for C/Objective-C APIs using format strings. RubyCocoa is now able to parse the format string value and appropriately convert the variable arguments to the right type.
  • Better ObjcPtr API. #assign, to assign a value to the pointer. #[], to retrieve something at a particular index. #[]=, to assign something at a particular index. #regard_as, to specify the Objective-C encoding of the receiver.
  • New tool: rb_nibtool.rb, to synchronize nib files with RubyCocoa source files. Added #ib_action to declare IBAction methods. Not necessary unless you want to use the tool.
  • New tool: standalonify.rb, to detect all the Ruby dependencies of your application (including gems) and generate a new application with everything inside, to make easier its deployment.
  • Added Xcode templates to do Ruby unit testing.
  • RubyCocoa can now build 64-bit and fundamentally work on a 64-bit environment. However all tests are not passing yet.
  • New sample code: sample/ViewModelDemo, sample/RubyAnywhere, sample/VPRubyPluginEnabler, sample/Fortune.wdgt, sample/CocoaRepl, sample/MailDemo/MailDemoActiveRecordBindings.
Bug fixes:
  • Ruby 1.9 compatibility fixes.
  • Now manually decoding the Objective-C runtime types.
  • Better RBObject retention mechanism.
  • Make sure builtin frameworks cannot be required twice.
  • Fixed a memory leak when calling RBApplicationMain more than once.
  • Converted the Xcode templates property lists from the old OpenStep format to UTF-8 XML.
  • Fixed the import of NSProxy-based classes.
  • Fixed a bug in the direct override code.
  • Various fixes to make Cocoa printing functional (see the PathDemo sample for an example).
  • Make sure everything is compiled with -O3. This is to make sure the FFI-generated closures are callable from the generated objc_msgSent_stret calls by GCC. Otherwise closures return C structure may cause memory corruption.
  • Fixed a bug in the OCException class (making sure #userInfo is binded to the right instance variable).
  • Deprecated ns_override, ns_outlet.
  • Make sure to return nil when easy dispatching void methods.
  • Fixed a dispatching issue about omitted pointers and CFType-like args.
  • Ported to the 2.0 Objective-C runtime. Compatibility with the previous runtime is ensured.
  • Do not access ruby_frame->last_func directly.
  • Make sure to ignore classes that start with a lower character. Normally Ruby forbids this but some SWIG-based extensions have such class names.
  • Now converting Ruby arrays to C-like arrays for arguments of type 'in' that represent an array of a variable length.
  • Fixed ObjCID#inspect.
  • Fixed memory leaks in Ruby <-> ObjC messaging.
  • Allows RubyCocoa to be called by Objective-C from a thread that isn't the main one, by routing the NSInvocation / FFI closure into the main thread via the main run loop. Prints a warning before routing. This is to avoid a crash since Ruby isn't thread-safe.
  • Refactored attachments to add methods directly to the Objective-C class and not using modules anymore, fixed NSEnumerator#to_a.
  • Fixed direct method override feature for Ruby > 1.8.2 and < 1.8.5.
  • Better backtrace information of exceptions raised from Ruby.
  • When wrapping a returned ocid in a Ruby object, if the wanted class name can't be a constant (because starting with '_' or [a-z]), try to use the superclass name when possible.
  • Do not crash if one resource (for example rb_main.rb) isn't found, but propose a clear message to the user instead.
  • Added support for getting C_ARY_B type arguments by reference.
  • Now configure the deployment target based on the --macosx-deployment-target parameter passed to install.rb config.
  • Fixed a bug in [-setValue:forUndefinedKey:] to not insert nil values in the cache dictionary.
  • Introduced a new config phase variable, 'build-as-embeddable', turned on by default, which builds RubyCocoa.framework with an INSTALL_PATH set to @executable_path/../Frameworks/RubyCocoa.framework/RubyCocoa. When turned off, INSTALL_PATH will get an absolute path value (the value of the 'frameworks' config phase variable).
  • Fixed some bugs when messaging Ruby from Objective-C. Fixed a bug when the Ruby proxy cannot be determined, and another when OSX methods couldn't be called directly on an Objective-C class from Ruby (DirectOverride).
  • Do not allow pointers arguments that don't have an 'out' type modifier to be omitted.
  • Ignore the 'Nil' Foundation enumeration.
  • Better behavior for C-array like arguments with a length argument. Do not emit a warning anymore if a value is passed for the length argument. If the value is either negative or greater than the size of the given array, raise an exception. Otherwise, just pass the value.
  • OSX.objc_symbol_to_obj has been obsoleted.
  • Added support to decode structure fields of the union type.
  • Properly handle exceptions NSGetSizeAndAlignment could throw.
  • Increased the method encoding buffer when analyzing its arguments.
Versienummer:0.11.0
Besturingssystemen:macOS
Website:RubyCocoa
Download:http://downloads.sourceforge.net/rubycocoa/RubyCocoa-0.11.0-OSX10.4universal.dmg
Bestandsgrootte:5,62MB
Licentietype:Voorwaarden (GNU/BSD/etc.)

Updategeschiedenis

Moderatie-faq Wijzig weergave

Reacties (2)

Daarnaast is het uiteraard mogelijk om webapplicaties te schrijven in het framework van Ruby.
In de bovenstaande quote wordt de suggestie gewekt dat webapplicaties per definitie iets te maken hebben met Ruby, of dat RubyCocoa iets met webapplicaties te maken heeft. Dit is niet het geval. RubyCocoa is een Ruby binding voor de Cocoa classes in Mac OS X.

Ruby on Rails het bekende webapplicatie framework en RubyCocoa zijn inderdaad beide voor/in Ruby gemaakt maar dat is de enige connectie tussen webapplicaties, RubyCocoa en Ruby.

edit:
Tikfoutje verbeterd om Daenney blij te maken.
Ruby on Rails hoor, niet Ruby of Rails

Op dit item kan niet meer gereageerd worden.



Apple iOS 10 Google Pixel Apple iPhone 7 Sony PlayStation VR AMD Radeon RX 480 4GB Battlefield 1 Google Android Nougat Watch Dogs 2

© 1998 - 2016 de Persgroep Online Services B.V. Tweakers vormt samen met o.a. Autotrack en Carsom.nl de Persgroep Online Services B.V. Hosting door True