• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

アプリをリリースするとき、日付はとても大事です。
(プレスリリースなどに関係するし)

Shopping Pinkをリリースしようとした際、iTunes ConnectにあるAvailability Dateについての詳しい情報があまりなくちょっと困りました。で、その時の経験でわかったのは、

その国のローカル時間でStoreに出される(ようだ)

Availability Dateを4/20にすると、日本のStoreには4/20、USのStoreにはUS時間の4/20ということです。日本だと時差がないので、全国同時ですが、USとかだとどうなるのかしら?ちょっとそこまではわかりませんでした。

posted by Png satoko on Mon 20 Apr 2009 at 10:09

以前、iPhone・iPod touch ラボ紹介して頂いたezPhotoMail, バージョン1.2をリリースしましたので、お知らせします。

@nakimoさん、その節はお世話になりました!
全然お礼も言わずに申し訳ありません... m(_ _)m 今後ともよろしくお願い致します。


Icon.png ezPhotoMail V1.2

AppStore
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=305784712&mt=8

今回のupdateは下記の内容が主です:

  • 画像リサイズ指定の変更:
    • 20%などのパーセンテージ
    • 240x320 with padding
      → スクリーンショット等の中途半端な画像サイズのリサイズ時、余白を入れることでキレイに(240x320)にリサイズしてくれる
  • サポートフォーマットにPNGを追加:JPEG・PING
    → 上のwith paddingモードの際、PINGだと透過な余白を入れてくれる

画像リサイズ指定の画面

メモ:1200x1600の場合、

  • 20%:240x320
  • 40%:480x640
  • 50%:600x800
  • 80%:960x1280

ezPhotoMail_UI3.jpg

P.S ちなみに今回は4/11に申請して、4/20リリース(申請時間、9日間)という感じでした。

posted by Png satoko on Mon 20 Apr 2009 at 08:05

紙のページがペラっとめくれているところを英語でdog earというのですが(page curlとも言うらしい)、作りたくなってちょっと調べてみました。

GIMPのPage Curlフィルター

GIMP_pagecurl_filter.png

Filters → Distorts → Page Curl で作成:

http://docs.gimp.org/en/plug-in-pagecurl.html

GIMPのツールで作成

GIMP_pagecurl_tool.png

上記のフィルターはあまりオプションがないのでちょっと不満。シンプルなものも探してみました。Path・Rotate・Drop Shadowを使って作成:

Creating a Page Curl & A Simple Website Template.
http://gimpology.com/submission/view/creating_a_page_curl_amp_a_simple_website_template_/

Photoshopでの作成の仕方のhowto

Photoshop_dogear.png

GIMPではないですが、参考になったので挙げておきます:

Dog Ear Tutorial
http://designoahu.com/dog-ear-tutorial

posted by Png satoko on Fri 17 Apr 2009 at 06:51

前の記事のsnippets以外にも参考になった記事を集めておきます。

Scenario, Features, Steps サンプル

Tutorials and Related Blog Posts

@variablesについての議論

http://www.ruby-forum.com/topic/181116

@userなどstep?scenario?にまたがる変数の使い方ですが、極力使わないのがスパゲッティ防止によさそうらしいです。900を超えるシナリオがある中で使ったけど、ポイント押さえて使えば大丈夫だったよというエピソードが出てきました。ただ、シーンに応じて使うのだったらありだろうというのが大方の見方かな。

script/generate feature Article

body:stringなどとfieldも渡すと、それに応じてテーブルデータ等も生成してくれます: http://d.hatena.ne.jp/amacou/20090127/1233058682

Cookieの値が保持されないworkaround

http://stackoverflow.com/questions/681183/how-to-handle-cookies-when-testing-with-webrat

The workaround is use Webrat with Selenium back end. It runs all tests in a separate Firefox window, so cookies or javascript is not a problem. The downside is extra time and resources required to run Firefox and do all the real clicks, rendering etc.

他にもhackishなworkaroundが紹介されていました。

posted by Png satoko on Fri 17 Apr 2009 at 05:09

[追記] 次に書いたScenario, stepのリンク集もどうぞ:
http://blog.s21g.com/articles/1441


Given, When and Thenの基本はわかったんだけど、なんとなくスマートに書けるようになるにはまだ足りない気がする。というので色々snippetとして集めてみました。
(文法的にはもう古い物もあるので注意)

Given, When and Then

基本はここで:
http://wiki.github.com/aslakhellesoy/cucumber/given-when-then

Given -> When -> Then の順にしかこないのかと思ったら、下記にシナリオの途中にあらわれるThenもあった:
http://www.benmabey.com/2008/02/04/rspec-plain-text-stories-webrat-chunky-bacon/

   1    Scenario: A visitor successfully submits a new animal
   2      Given no animal named 'Alligator' exists
   3      When visitor goes to /animals/new
   4      Then visitor should see the Animal submission form
   5      When visitor submits an animal with name: 'Alligator', phylum: 'Chordata', animal class: 'Sauropsida', order: 'Crocodilia', family: 'Alligatoridae', genus: 'Alligator', and lay eggs:  'true'
   6      Then an animal named 'Alligator' should exist

Thenの後にWhenがくるのもありなのかも。

Stepの入れ子

http://wiki.github.com/aslakhellesoy/cucumber/calling-steps-from-step-definitions

   1  Given /^(.*) is logged in$/ do |name|
   2    Given "the user #{name} exists" 
   3    Given "I log in as #{name}" 
   4  end

記事作成のfeature

http://railscasts.com/episodes/155-beginning-with-cucumber

   1    Scenario: Create Valid Article
   2      Given I have no articles
   3      And I am on the list of articles
   4      When I follow "New Article"
   5      And I fill in "Title" with "Spuds"
   6      And I fill in "Content" with "Delicious potato wedges!"
   7      And I press "Create"
   8      Then I should see "New article created."
   9      And I should see "Spuds"
  10      And I should see "Delicious potato wedges!"
  11      And I should have 1 article
  12  
  13  #article_steps
  14  Given /^I have no articles$/ do
  15    Article.delete_all
  16  end

Scenarioは完結に、Stepで細かく

Imperative vs Declarative Scenarios
http://www.benmabey.com/2008/05/19/imperative-vs-declarative-scenarios-in-user-stories/

Scenarioを短くnarrativeに書いて、stepで細かいフォーム入力などを扱う感じに書かれていて一番しっくりきました。

Imperative 命令法/形の
Declarative => narrative 叙述の

   1   Story: Animal Submission
   2    As a Zoologist
   3    I want to add a new animal to the site
   4    So that I can share my animal knowledge with the community
   5  
   6    Scenario: successful submission
   7    Given I'm on the animal creation page
   8    When I add a new animal
   9    Then I should see the page for my newly created animal
  10    And the notice 'Thank you for your animal submission!'

   1  # animal_steps.rb
   2  When "I add a new animal" do
   3    fills_in 'Name', :with => 'Alligator'
   4    selects 'Chordata', :from => 'Phylum'
   5    fills_in 'Animal Class', :with => 'Sauropsida'
   6    fills_in 'Order', :with => 'Crocodilia'
   7    fills_in 'Family', :with => 'Alligatoridae'
   8    fills_in 'Genus', :with => 'Alligator'
   9    checks 'Lay Eggs'
  10    clicks_button 'Create'
  11  end

posted by Png satoko on Fri 17 Apr 2009 at 04:59

最新にしたらpaths.rbとBackgroundが追加されていたのでメモ。

features/support/paths.rb

Cucumberを最新にしてfeatureをgenerateしようとしたらpaths.rbがないと怒られたので、script/generate cucumberでpaths.rbファイルを生成しました。

Scenarioで記述するページはここで定義:

   1  #features/support/paths.rb
   2  module NavigationHelpers
   3    def path_to(page_name)
   4      case page_name
   5      when /the homepage/
   6        root_path         

Background

1feature内のScenarioに共通な前提条件を記述する。
Backgroundで書かれた条件は、各Scenario実行前、かつBefore Hookの後に実行されるようです。

The background is run before each of your scenarios but after any of your Before Hooks.
http://wiki.github.com/aslakhellesoy/cucumber/background

   1    Background:
   2      Given a global administrator named “Greg   3      And a blog named “Greg’s anti-tax rants” 
   4      And a customer named “Dr. Bill   5      And a blog named “Expensive Therapy” owned by “Dr. Bill

posted by Png satoko on Fri 17 Apr 2009 at 04:04

Cucumberのfeatureを実行すると、上記のエラーが出て困ったので探したら

I resolved it by uninstalling the old "bryanary-webrat" gem and making sure that "webrat" was up to date (0.4.3)

When you have both installed, ruby tends to load the old one instead.
http://groups.google.com/group/webrat/browse_thread/thread/d8ea685a1b1931a5#

古いwebrat gemを消しなさいと。

   1  gem search webrat
   2  
   3  *** LOCAL GEMS ***
   4  
   5  aslakhellesoy-webrat (0.3.2.2)
   6  webrat (0.4.4, 0.4.3, 0.3.4)

案の定古いwebratがあったのでaslakhellesoy-webratをuninstallしたら動きました!

posted by Png satoko on Tue 14 Apr 2009 at 15:14

submoduleネタをゲットしたのでメモ。

@githubのtwt:

GitHub gem builder will now pull in submodules prior to the build.
4:05 AM Apr 9th from web
http://twitter.com/github/status/1478454260

てことは配布しているgemではsubmoduleをpullしてくれるってことでしょうか!!
いいですね!

しかしtarball builderはsubmodule未対応

@github is there any plan to have the tarball builder do the same thing?
http://twitter.com/larrywright/status/1478514289

@larrywright not at the moment. We use git-archive which, for some unknown reason, doesn't support submodules.
http://twitter.com/github/status/1478579621

posted by Png satoko on Fri 10 Apr 2009 at 13:51

その1でsubmoduleをaddし、git-submodule statusコマンドでステータスを確認するところまでの作業をしました。
今度はaddした以外の人がpullして、submoduleを確認するところを書いてみます。

submoduleを取得:init & update

   1  git pull --rebase #submoduleを追加したコミットを取得
   2  git submodule 
   3  -e110f2056783465b8d719bdb1ab5fd14e7650f56 vendor/plugins/rspec

(-がついているので)この時点ではrspec submoduleが初期化されていません。よって下記のコマンドで初期化します:

   1  git submodule init
   2  git submodule update

又は

   1  git submodule update --init

updateすることによりソースファイルを取得します。
これで、addした以外の人もsubmoduleを追加することができました。しかし、まだこれで終わりではなくて実はいくつか検討すべき点があります:

  • submoduleに修正を加えないかどうか
  • どのバージョンを使うか:commit hash
  • (railsの)deployはどうするか:Capistrano
  • submoduleの削除

外部のrepoをそのままか、forkしてからか

submoduleをaddする前に検討すべき事項です(!):
追加するremoteリポジトリを変更したくなる可能性があるかどうか検討する必要があります。例えばrailsやrspecなら変更を加えるというのはほとんどないように思われますが、完成度の低いpluginだと自分で修正したり、追加したりすることが考えられます。そのような場合、下記のようなシナリオが考えられます:

  1. remoteをsubmodule(変更しない)
  2. Githubであればforkして、それをsubmoduleにする
  3. 自分のローカルにcloneして、それをsubmoduleにする
  4. サーバにrepoを作ってremoteのファイルを追加、それをsubmoduleにする

1,2はなんとなく想像できますが、3,4は運用が面倒そうです...
また、railsまでsubmoduleにする記事もあったのですが、毎回deploy時にコピーすることになるのでdeployに時間がかかるだろうし、容量も食うので運用には向いていないかもしれません。

どのコミットをsubmoduleとして採用するか

submoduleを利用する際、外部のbleeding edgeブランチを積極的に採用したくはありません。なので、タグか特定のバージョン(コミット)を利用するのが適切です:

   1   cd vendor/plugins/rspec/rspec
   2   git tag 
   3  1.1.10
   4  (略)
   5  1.2.1
   6  1.2.2
   7   git checkout 1.2.2
   8   cd ../../..

rspecのタグ1.2.2を採用しました。このあとRAILS_ROOTに戻ってcommit, pushすればokです。
この後、他の人がこの変更を反映するには下記の作業を行います:

   1  git pull --rebase #submoduleを追加したコミットを取得
   2  git submodule update

Capistranoでsubmoduleを使えるようにする

一行追加するだけ!

   1  set :git_enable_submodules, 1

via http://github.com/guides/deploying-with-capistrano

submoduleの削除

rspecを例に:

  1. .gitmodulesファイルから該当する行を削除
       1  [submodule "vendor/plugins/rspec"]        
       2  path = vendor/plugins/rspec        
       3  url = git://github.com/dchelimsky/rspec.git
    
  2. .git/configファイルから該当する行を削除

       1  [submodule "vendor/plugins/rspec"]        
       2  url = git://github.com/dchelimsky/rspec.git
    

  3. git rm --cached path_to_submodule
    パスの最後に/(スラッシュ)がない状態で:

       1  git rm --cached vendor/plugins/rspec
    

  4. git commit、pushでおしまい

via http://git.or.cz/gitwiki/GitSubmoduleTutorial

.gitmodulesファイル

初めてsubmoduleを追加すると、下記のファイルが追加されます:

   1  .gitmodules

その他に.git/configも変更されます。

submoduleをもっとよく理解するRefs

posted by Png satoko on Tue 7 Apr 2009 at 21:24

[追記] その2を書きました:
http://blog.s21g.com/articles/1411


長くなりそうなので続きはその2で!

railsを使っているとpluginなどは外部repoをそのまま使いたくなります。そこで前から聞いていたsubmoduleを使ってみたくなりました。しかしこのsubmodule、わりと最近導入されたようなのでgitのバージョンによって動作に違いがあるようです。

というわけで、まず私の環境を書いておきます:

   1  % git --version
   2  git version 1.6.0.2

git submodule add

rspecを例に:

   1  % git submodule add  git://github.com/dchelimsky/rspec.git vendor/plugins/rspec

追加したらcommit and push

   1  % git commit -am "add submodule: plugins/rspec" 
   2  % git push origin master

これでサーバにsubmoduleが追加されました。他の人がpullなどすれば、submoduleを確認することができます(詳しくはその2を参照)
で、次にsubmoduleのstatusを確認してみます。

git submodule status

git statusと同じようなコマンドでsubmoduleの状態が確認できます:

   1  % git submodule status 
   2  9dc19a3a593f4ce1b4e221889091cebd773ea5c4 vendor/plugins/cache_fu (heads/master)
   3  -e110f2056783465b8d719bdb1ab5fd14e7650f56 vendor/plugins/rspec 651611999df3e57de6f36486b51abd3bf5d66cea vendor/rails (v2.2.0-1085-g6516119)

commit hashに-、+がついている時がある(上だとrspecに-がついてます)。
ざっくり説明:

  • -がついているとまだ初期化されていない状態
    => git submodule update --initでok
  • +がついているとサーバでindexしているcommit hasと異なるcommit hashだよというお知らせ
    => git submodule updateでok
posted by Png satoko on Fri 3 Apr 2009 at 17:26
Contents
[iPhone] iTunes ConnectのAvailability Dateについて
[iPhone 宣伝] ezPhotoMail 1.2リリースしました
[GIMP] ページめくり(dog ear, page curl)画像を作る
[Cucumber] Scenario, stepの書き方:リンク集
[Cucumber] Scenario, stepの書き方:snippets
[Cucumber] routes(paths.rb), Background
[webrat+Rails 2.3] エラー:uninitialized constant ActionController::AbstractRequest (NameError)
githubのgem builderはsubmoduleをサポート!not tarball
[git 1.6.0.2] submoduleを使おう!その2
[git 1.6.0.2] submoduleを使おう!その1:add, status
Comments
KingofSmack: Here also good reads for this mobile applicatio... '14-5
satoko: stackoverflowでも同じエラーを挙げている人がいたので、1.3でアップロードしたよっ... '10-12
ujihisa: :%s/blog/glob/g '10-7
satoko: しゅが〜様 返事が遅くなって申し訳ありません。また、投稿百景ご購入ありがとうございます。 ... '09-10
しゅが~: こんにちは。投稿百景を発売日翌日から利用しています。本当にいいAppを作っていただきました。罫... '09-10
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ