ラベル RubyMotion の投稿を表示しています。 すべての投稿を表示
ラベル RubyMotion の投稿を表示しています。 すべての投稿を表示

2013年7月6日土曜日

第2回 RubyMotion もくもく会 Osakaに参加してきたーヘ(^o^)ノ #rubymotionosaka

前回は参加できなかったので…

今日こそは!!!

少し遅れましたが参加できましたヘ(^o^)ノ

場所は前回と同じ1×1株式会社さんです(前回参加してませんが…)

勉強会の場所を提供してくれるのは本当にありがたいですー

あ(・∀・)り(・∀・)が(・∀・)と(・∀・)う!

Apple TVでコードレビューもすーいすい

僕が本日試したのはProMotion

naoyaさんのブログで紹介されていて興味津々だったので試してみました

GitHubにはTutorialもあるのでよい

もくもく会の最後にProMotionを使ったコードと使わなかったコードを比べてみました

みなさんの反応も上々www

帰宅してもう少し調べてみるとTeacupにも対応しているみたい

期待大ヘ(^o^)ノ

現地ではbundle installでpath指定すると動かなかったのですが…

帰宅しチャレンジするとすんなり動きました(;・∀・)

よくわからない…

rakeするとGemがないとメッセージはでるもののちゃんと動いています

楽しかったー

次回も参加するぞーヘ(^o^)ノ

( ̄(エ) ̄)彡☆

2012年9月26日水曜日

RubyMotion1.24でBubbleWrapを動かしてみる

( ̄(エ) ̄)彡☆

RubyMotionでWeb APIからJSONファイルを取得してみたで、BubbleWrapが動かないと書いた。

RubyMotion1.24ではconfigsをサポートしなくなったからみたいです…

Qiitaに投稿が「RubyMotionを1.24にしたらBubbleWrapが動かなくなった」

僕はRVMを使ってるのでパスはこんなかんじ

~/.rvm/gems/1.9.3/gems/bubble-wrap-1.1.3/lib/bubble-wrap/ext/motion_project_app.rb
#この2行を削除
configs.each_value &bw_config
config.validate

#追加
config.setup_blocks << bw_config

これでおっけー(>Д<)ゝ

しかーし、Qiitaにコメントが…

@Watson1978さんがブランチを作ってくれてるみたいです アリガト!(´▽`)

app_path/Gemfile
$ cat > Gemfile
source :rubygems

gem "rake"
gem 'bubble-wrap', '~> 1.1.3', :git => "git://github.com/Watson1978/BubbleWrap.git", :branch => "configs"

$ bundle install

app_path/Rakefile
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
require 'bubble-wrap' ←追加

Motion::Project::App.setup do |app|
  # Use `rake config' to see complete project settings.
  app.name = 'app_name'
end

これだと既存のgemとごっちゃになるので、以下のオプションを付けた方がいいみたい
$ bundle install --path vendor/bundle


ぽちさんの[RubyMotion] Bundlerを使って楽をしてみた!を参考にさせてもらいましたー

「RubyMotionもくもく会」行きたかったな(つд⊂)エーン

2012年9月25日火曜日

Redcarを使ってみた

( ̄(エ) ̄)彡☆

TwitterのTLに…


Redcar is written in Ruby and runs on JRuby.

おぉ…Ruby製のオープンソースエディタ!(JRuby)

プラグインもRubyで書けるヘ(^o^)ノ

install
$ gem install redcar

Redcar+RubyMotion


plugin redcar-rubymotion
#fresh install
$ cd ~/.redcar/plugins
$ git clone git://github.com/kattrali/redcar-rubymotion.git rubymotion

#upgrade
$ cd ~/.redcar/plugins/rubymotion
$ git fetch origin && git checkout 0.8

多少、もっさり感はありますが… Javaやからかな?

今から色々触っていくよ

2012年9月23日日曜日

RubyMotionでWeb APIからJSONファイルを取得してみた

( ̄(エ) ̄)彡☆

RubyMotionでWeb APIを叩いてJSONファイルを取得ヘ(^o^)ノ

BubbleWrapが便利→BubbleWrap-GitHub

でも、RubyMotion1.24では動かない…

んじゃ、スクラッチで実装すればイイじゃね?

って事で、サンプルコードを書いてみたヽ(´ー`)ノ

app/app_delegate.rb
class AppDelegate
 def application(application, didFinishLaunchingWithOptions:launchOptions)
  #connpass api
  url = "http://connpass.com/api/v1/event/?keyword=rubymotion"

  Dispatch::Queue.concurrent.async do
    error_ptr = Pointer.new(:object)

    data = NSData.alloc.initWithContentsOfURL(NSURL.URLWithString(url), options:NSDataReadingUncached, error:error_ptr)

    json = NSJSONSerialization.JSONObjectWithData(data, options:0, error:error_ptr)
    
    #JSONファイルの内容を表示
    p json
  end
  true
 end
end

rakeするとコンソールにJSONファイルの内容が表示されたはず♪

RubyMotionではAPI を直接叩けるのでホントに便利ヽ(´ー`)ノ

2012年9月21日金曜日

RubyMotion1.24のアップデートがすごかった

( ̄(エ) ̄)彡☆

Mac OS Xの10.8.2、Xcode4.5がリリースされました。

RubyMotionも1.24にアップデートヘ(^o^)ノ

@watson1978さんがRubyMotionコミッタの一員になって初のアップデートの内容がすごい!

Retina Displayに対応
$ rake retina=4   # starts the 4-inch simulator (iPhone 5)
$ rake retina=3.5 # starts the 3.5-inch simulator (iPhone 4S and older)

Device Debugが可能に
$ rake simulator debug=1
$ rake device debug=1

‎= RubyMotion 1.24 = 

* Added support for the GM version of the iOS 6 SDK.
* Added support for the iPhone5 architecture (armv7s).
* Added new values for the `retina' option of `rake simulator': `3.5' (for
iPhone4) and `4' (for iPhone5). A `true' value will default to `3.5' in
case the simulator target is lesser than 6.0, otherwise, `4' will be used.
* Added debugging support (experimental) for both simulator and device.
Simply set the `debug' parameter to any value to attach the debugger
(ex. `rake debug=1' for simulator and `rake device debug=1' for device).
The Ruby code compiles with relevant DWARF metadata and the debugger
used is gdb. Note that the debugger experience is a work in progress and
will be significantly improved in future releases.
Check out http://www.rubymotion.com/developer-center/articles/debugging
* Fixed the `development' mode to not compile with LLVM optimizations. This
results in faster compilation times and also better debugging support,
but the code might run a bit slower. The `release' mode builds with the
entire optimization passes.
* Added to the build system the `mode' option which can be used to specify
the build mode, either `development' (default) or `release'. You can now
test your app in release mode by using `rake mode=release' for simulator
and `rake device mode=release' for device.
* Fixed the build system not to execute the user-defined application setup
block twice, which is no longer necessary with the new `mode' option.
* Removed the `archive:development' and `archive:release' tasks which are
no longer necessary with the new `mode' option.
* Added the `archive:distribution' task which builds an .ipa with distribution
settings (certificate, default entitlements, symbols stripped).
* Fixed `rake spec' to produce an .app bundle that uses a different bundle
identifier than the regular app. This is necessary in Xcode 4.5 to avoid
simulator installation issues.
* Fixed a bug in the simulator launcher when output to stdout would not be 
displayed in case the rake process was piped to another process
(ex. `rake spec | ...').
* Added the Dispatch.once method, which wraps the dispatch_once() function,
that can be useful to implement singletons. Usage: Dispatch.once { ... }.
* Added support for `define_method'. Like `attr_*', it cannot be used to 
overwrite existing Objective-C methods due to limitations of the compiler.
* Fixed a bug when converting Bignum objects into 'long long' types.
* Fixed a bug in the build system where relative source paths pointing to the
parent directory would not properly be expanded and would trigger build
failures.
* Fixed several bugs in String#% related to arguments and precision format.
* Improved String#[]= performance. 50 times faster.
* Improved String#length performance with multibyte characters. If String
includes multibyte characters, its length will be cached and reused.
500 times faster.
* Improved String#reverse performance with ASCII-compatible string. 30 times
faster.
* Improved Fixnum/Float modulo performance. 2 times faster.
* Fixed memory leaks in String#{reverse, reverse!}
* Fixed a bug when calling a method on an uninitialized Regexp object.
(ex. Regexp.allocate.to_s).
* Fixed a bug when calling NSArray#flatten(level) with 0.
* Fixed bugs in NSArray#rindex, NSArray#values_at, NSArray#values_at,
NSDictionary#values_at and Kernel.#sprintf which could raise uncatchable
exceptions.
* Fixed a bug in Dispatch::Source.timer which couldn't handle the
Dispatch::TIME_FOREVER constant for interval.
* Fixed a bug in NSArray#delete_if where nil could not be returned if the
receiver did not change.
* Added the following methods: NSArray#rotate, NSMutableArray#rotate!,
NSMutableArray#sort_by!, NSMutableArray#select!, NSMutableArray#keep_if,
NSMutableDictionary#select!, NSMutableDictionary#keep_if.

まさに盛りだくさんヽ(´ー`)ノ

業務アプリでも使ってこかな…

2012年9月20日木曜日

RubyMotion タブバー

( ̄(エ) ̄)彡☆

RubyMotionでタブバーを実装してみる

RubyMotion Tutorialはコチラ→RubyMotion Tutorial

app/app_delegate.rb
controller.tabBarItem = 
 UITabBarItem.alloc.initWithTabBarSystemItem(UITabBarSystemItemFavorites, tag: 1)

カスタムアイコンを使ってみる

app/app_delegate.rb
controller.tabBarItem = 
 UITabBarItem.alloc.initWithTitle('HOME', image:UIImage.imageNamed('home.png'), tag: 1)

connpass用のアプリを作ってるので完成したらGitHubでも公開するよーヘ(^o^)ノ

2012年7月22日日曜日

第一回 RubyMotion 勉強会

このイベントのイメージ画像

参加してきましたーヾ(。╹◡╹。)

主催者の@satococoaさん

発表資料→RubyMotion は誰得?

MacRubyコミッタの@watson1978さん

発表資料→Differences CRuby/MacRuby/RubyMotion

LTは
@pchwさん

@haraken3さん
発表資料→SublimeRubyMotionBuilderの紹介

@mah_labさん

やはりみなさんレベル高かったですねー

モチベーションが一気に上がりました

とても勉強になったし、RubyMotionでアプリを作っていきます (`・ω・´)キリッ

やっぱりRubyで書けるメリットはとても大きい

ObjC力もつくので一石二鳥???ですw

第二回も開催してほしいな><

参加者、関係者のみなさんおつかれさまでした( ̄∇ ̄)

でわ( ̄(エ) ̄)彡☆