Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 472

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 487

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 494

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 530

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-includes/cache.php on line 103

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-includes/theme.php on line 623

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/custom_posts/custom_posts.php on line 22

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 46

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 67

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 75

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 92

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiRender.php on line 70

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 181

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 538

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 695

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 1087

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112
titaniumとcoffeeと | おれせか
おれせか

なんかそれっぽいのをうにうに。

最近お仕事でtitaniumでのiphoneアプリ開発などちょいちょいしております。

で、最初はフツーにjavascriptをガリガリ書いてたのですが、coffeescriptなるものの噂を聞いたので使ってみるとこりゃいいやということに。

で、こっから本題。

で、coffeescriptってjsにコンパイルしなきゃいけないんですが毎度叩くのもなんだかなーて感じだったのでwatchrていうgemがあったのでこいつをインストール。

  • coffee_compile.watchr
    coffee_files = %r{^(.*\.coffee)$}
    
    watch(coffee_files) do
      cmd = "coffee --bare --compile ."
      puts "$#{cmd}"
      `#{cmd}`
    end

で、下記で実行。

watchr -d coffee_compile.watchr

しかし、追加ファイル感知してくれないとか、ファイル削除のイベントがなぜか止まらないとかあったので、結局使わなくなったり。

というわけで、毎度コンパイル叩くことにしたんだけど、

ちょっとは楽しようということでRakefile書いた

  • Rakefile
    task :default => ["coffee:compile"]
    
    def show_and_cmd(title, cmd = nil)
      cmd = title if cmd.nil?
      puts %{===== #{title} =====}
      puts %{$#{cmd}}
      system cmd
    end
    
    namespace :coffee do
      desc "Compile coffee scripts"
      task :compile do
        show_and_cmd 'compile coffee', %{coffee --bare --compile .}
      end
    
      desc "Watch coffee scripts"
      task :watch do
        watchr_file = 'coffee_compile.watchr'
        show_and_cmd 'watching files', %{watchr -l #{watchr_file}}
        puts ''
        show_and_cmd 'watch coffee', %{watchr -d #{watchr_file}}
      end
    end

これで、

rake #または rake coffee:compile

でコンパイルできるぜー。ひゃっほい。

いちおう念のため、watchrのほうも

rake coffee:watch

でいけるようにしてたり。

あと、titaniumのほうも

titaniumって普段はbuildやシミュレータの起動をtitanium developerてアプリを立ち上げといて、その中にあるボタンをぽちっとなするわけなんですが、毎度これ起動しとくのヤダナーと思ってたんですよ。

と思ってたら、なんかコマンドラインで叩けるらしいじゃないですか。
コマンドラインでTitanium Mobileを操作する - kaz_konno’ blog: walkthisway

やったー!

というわけでRakefile修正。

task :default => ['coffee:compile', 'titanium:run']

def show_and_cmd(title, cmd = nil)
  cmd = title if cmd.nil?
  puts %{===== #{title} =====}
  puts %{$#{cmd}}
  system cmd
end

namespace :titanium do
  desc "build & run on iphone simulator"
  task :run do
    show_and_cmd 'build & run', '/Library/Application\ Support/Titanium/mobilesdk/osx/1.7.X/iphone/builder.py run ./'
  end
end

namespace :coffee do
  desc "Compile coffee scripts"
  task :compile do
    show_and_cmd 'compile coffee', %{coffee --bare --compile .}
  end
  desc "Watch coffee scripts"
  task :watch do
    watchr_file = 'coffee_compile.watchr'
    show_and_cmd 'watching files', %{watchr -l #{watchr_file}}
    puts ''
    show_and_cmd 'watch coffee', %{watchr -d #{watchr_file}}
  end
end

namespace :git do
  desc %{Show "git diff -- *.coffee"}
  task :diff do
    show_and_cmd 'git diff *.coffee', 'git diff -- \*.coffee'
  end
end

「rake」で以下まとめて出来るようになったよー。

  1. coffeescriptのコンパイル
  2. titaniumのビルド
  3. iphone simulatorの起動

やったー!

#ちなみにRakefieの最後に書いてあるrake git:diffはcoffeeファイルの差分だけ見たくてよく使うコマンドだったのでついでに追加しといた。

PAGETOP
PAGETOP
PAGETOP

Comments (10)

Refrain from earning funds by just Eu Joining, loan provider wire or simply revenue structure. If you work with an individual’s mastercard you could as a minimum remember you get your hard earned cash to come back for those who attain hardly any see.ありませ

[2013/04/25 (木) 13:03]

Thanks your post,The post is written in very a good manner and it entails much useful information for me. I am happy to find your distinguished way of writing the post.
http://www.shtcshillong.org

[2014/01/02 (木) 11:06]

在庫情報随時コピー更新!(*^-^*)
100%品質保証!コピー靴満足保障!
財布服のグッチコピー着たのが少なくて、靴も不十分です。
コピーの商品がグッチコピー低価格でお客様に
品質を最大限本物と同等とする為に相応の材質にて製作靴している為です。
しもやけを生んで、風邪を引いて風邪を引きます後の結果財布コピー。

[2015/02/12 (木) 16:53]

ほんとはまとめて変換しないでちゃんと対象ファイルしっかり選んで変換したほうがきっといいよ!

[2015/09/16 (水) 13:03]

このシャネル腕時計のブランドの自分、
シャネル激安http://www.cctoh.com/
93―01チップを基礎にする93―02は自動的に鎖の機械のチップに行って駆動します。
シャネル財布
シャネルピアス
シャネル眼鏡
シャネルバッグ
シャネル腕時計
シャネル靴
このチップは48時間の動力を持って貯蓄して、
シャネル激安腕時計の使用更におだやかで心地良くて、
飛行する陀はずみ車は8粒のねじの調節の後の改良システムでと腕時計、
シャネル完璧な精密で正確な度を確保しました。

[2015/11/18 (水) 00:38]

良い書き込み記事をありがとう!それは実際にはアミューズメントアカウントです。

[2015/11/23 (月) 17:43]

bundle exec rails g migration add_max_attempts_to_delayed_jobs max_attempts:integer

[2016/01/06 (水) 17:44]

bundle exec rails g migration add_max_attempts_to_delayed_jobs max_attempts:integer

[2016/01/07 (木) 10:55]

宝のスーパーコピーめでたい(ミュウミュウ)。

[2016/01/15 (金) 17:42]

↑の記事を読んで、おおこりゃいいやと思いつつ使ってみた時に気づいたことメモ。

[2016/03/31 (木) 09:57]
PAGETOP

Comment Form

PAGETOP

Trackbacks (1)

llaneza

titaniumとcoffeeと | おれせか

[2014/09/22 (月) 06:27]
PAGETOP

Trackback URL

PAGETOP

Search