For a little more than a year now, I’ve been meaning to write a script to rename all of the files in my iTunes library so that they’re in proper English title case. In large part, this project was inspired by reading John Gruber’s post about a Perl script that he’d written to convert text strings into title case programmatically. After reading Gruber’s post, I grabbed a copy of Sam Souder’s transl
Recently MacRuby 0.6 was released. The development team put a lot of emphasis on improving compatibility with Ruby 1.9, and the viability of MacRuby as a tool for developing Mac OS X applications. Focus on these aspects took precedence over performance, but I was still curious to see how well it performed when compared to Ruby 1.8.7 and Ruby 1.9, respectively. This article showcases the results of
MacRuby 0.5 beta 2から、MacRubyでdtraceを使うことができます。dtraceのサンプルが/MacRuby/tags/0.6/sample-macruby/DTraceにあるので手軽に試せます。 動かし方は、 sudo dtrace -qs dtraceスクリプトファイル -c "起動するコマンド" $ sudo dtrace -qs methods_count.d -c "macruby fib.rb" という感じで動かせます。 MacRubyでサポートしているプローブ プローブ名実行タイミングarg0arg1arg2arg3 method-entryメソッド呼出開始クラス名メソッド名ソースファイル行番号 method-returnメソッド呼出終了クラス名メソッド名ソースファイル行番号 raise例外発生時クラス名ソースファイル行番号- 例:例外を検出してみる
MacRuby 0.6からmacrubydというデバッガがついてきたので、自分用にコマンドをメモ。未実装があったりします。これからもいろいろ変わりそうな感じです。 break ブレークポイントの設定。 ブレークポイントを設定するファイルと行番号を指定。 $ macrubyd test.rb test.rb:1> break test.rb:5 Added breakpoint 1. gdbのように、行番号だけ指定するといったことができないみたいです。TABでファイル名を補完することができます。 注意:いまのところファイル名は macrubyd 起動時に指定したファイルパスと全く同じ記述にしないとだめみたいです。 以下の例ではブレイクポイントにヒットしないで、走り抜けます。"break ./test.rb"と書くなら、"macrubyd ./test.rb"と起動時の記述もあわせる。 $ m
# -*- coding: utf-8 -*- require 'uri' p URI.escape("あ い う え お") p URI.escape("01234 abcd&!\"#$\%&\'()-=^~\\|@`[]{}:*;+,<.>/?_") 上のコードを実行した結果、 $ /usr/bin/ruby -v test_uri.rb ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0] "%E3%81%82%20%E3%81%84%20%E3%81%86%20%E3%81%88%20%E3%81%8A" "01234%20abcd&!%22%25&'()-=%5E~%5C%7C@%60%7B%7D:*;+,%3C.%3E/?_" $ /opt/local/bin/ruby -v test_uri.rb ruby
○○年にリリースされた楽曲でプレイリストを作りたいなと思ったのですが、CDから取り込んだトラックにリリース年が設定されていないものばかり。なので、各トラックにリリース年を設定するものを書いてみました。 MacRubyでScripting Bridgeを使えば簡単そうと思い着手したのですが、Amazonのサイトからリリース年を取得するのにNokogiriは使えないし、あげくにURI.escapeの返す値がバグっていたり。面倒になったので、iTunesから情報を取得&設定する箇所をMacRubyでやって、Amazonから情報を取得する箇所をMac OS Xに最初から入っていたrubyで処理しましたorz さすがに1トラックずつAmazonからデータを取得するのは効率が悪いので、アルバム単位でまとめてリリース年を設定するように変更しました。 itunes_set_track_year.rb #!
MacRuby is a version of Ruby 1.9, ported to run directly on top of Mac OS X core technologies such as the Objective-C common runtime and garbage collector, the CoreFoundation framework and the LLVM compiler infrastructure. MacRubyの最新版となるMacRuby 0.6が公開された。MacRubyはRuby 1.9に対応したRubyプラットフォーム。Mac OS Xのコア技術であるObjective-Cランタイムおよびガベージコレクタ、CoreFoundationフレームワーク、LLVMなどを使って開発されており、Mac OS Xの性能を発揮しやすいという特徴がある。
Build the skills your teams need Give your teams the O’Reilly learning platform and equip them with the resources that drive business outcomes. Click on a feature below to explore. Trusted content Live online events Courses Interactive learning Certification prep O’Reilly Answers AI Academy Assignments Insights Dashboard Trusted content you can count on More than 60K titles from O’Reilly and nearl
MacRuby 0.6 がリリースされました。0.5 のリリースから約3ヶ月。活発に開発が進められています。 http://www.macruby.org/blog/2010/04/30/macruby06.html 最近 MacRuby の動向をあまり観察していなかったので、この機に 0.6 での変更点をざっくりまとめてみたいと思います。なお内容はほぼ上のリリースノートと、そこからリンクされている tutorial の内容を抜粋/翻訳したものなので詳細な情報は本家を参照してください Cocoa 開発がより安定 In this release, we believe that MacRuby is now stable enough to consider using it to develop Cocoa applications. だそうです。バグをたくさん取ったしアプリケーション開発
MacRuby 0.6がリリースされています。id:nagachikaさんのMacRuby 0.6 リリース - PB memoにも詳しく変更点が書かれています。日本語で変更内容が読めてありがたいです(^ ^) いろいろと変更点がありますが、とりあえず新しいGCD APIをフィボナッチ数を求めるスクリプトで試してみました。 GCDを使わないバージョン # -*- coding: utf-8 -*- # filename : fib.rb def fib(n) raise if(n < 0) return 0 if(n == 0) return 1 if(n == 1) return fib(n - 1) + fib(n - 2) end puts fib(35) puts fib(36) $ time macruby -v fib.rb MacRuby version 0.6 (ruby
We are pleased to announce the immediate availability of MacRuby 0.6. In the 3 months since the previous release, a number of new features have been added and the overall stability of MacRuby has been substantially improved. You can download it from here. Please note that this package only runs on Snow Leopard (10.6). Users on Leopard (10.5) can also use MacRuby by building the sources from our re
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く