リソースにカスタムアクションを追加する方法のメモ
Merbでconfig/rou
1 resource :users, 2 :collection=> {:active => :get}, 3 :member => {:password => :get}
:collectio
:memberで指定したアクションは、resource(@user, :password) などのように参照できて、"/users/1/p
Merbでconfig/rou
1 resource :users, 2 :collection=> {:active => :get}, 3 :member => {:password => :get}
:collectio
:memberで指定したアクションは、resource(@user, :password) などのように参照できて、"/users/1/p
アプリをリリースするとき、日付はとても大事です。
(プレスリリースなどに関係するし)
Shopping Pinkをリリースしようとした際、iTunes ConnectにあるAvailabili
その国のローカル時間でStoreに出される(ようだ)
Availabili
以前、iPhone・iPod touch ラボで紹介して頂いたezPhotoMai
@nakimoさん、その節はお世話になりました!
全然お礼も言わずに申し訳ありません... m(_ _)m
今後ともよろしくお願い致します。
AppStore
http://itunes.apple. com/WebObj ects/MZSto re.woa/wa/ viewSoftwa re?id=3057847 12&mt=8
今回のupdateは下記の内容が主です:
メモ:1200x1600の場合、
P.S ちなみに今回は4/11に申請して、4/20リリース(申請時間、9日間)という感じでした。
GAEを使う上での大きな制限として、ファイル数1000までというのがあります。 これを乗り越えるために、unpackしたGemの中から不要なファイルを掃除したりする必要があったのですが、 関連するGem群をjarファイルにまとめる事でこの問題を乗り越えられます。
上記のファイルをlibの下に配置して、config/ini
実際に以下のサイトでmerb.jarを使って運用しています。
これによって、事実上ファイル数制限に左右されずにアプリケーションを開発する事が出来るようになります。 ただ、1ファイルのサイズ制限(10MB)が存在するので、jarファイルが大きくなりすぎた場合は分割する必要があります。
I shipped new dm-datasto
This update is a long jump from previous version. It includes following functions
1 Post.all(:id => [1,2])
1 Post.all(:id.not => 4)
So now we can use most of functions defined in DM by using this adapter.
Enjoy!
JRubyを使っていて、JavaのArrayListを作りたい場合には、以下のようにすると良いようです。
1 java.util.Arrays.as_list([1,2].to_java).getClass.to_s 2 # => "class java.util.Arrays$ArrayList"
紙のページがペラっとめくれているところを英語でdog earというのですが(page curlとも言うらしい)、作りたくなってちょっと調べてみました。
Filters → Distorts → Page Curl で作成:
上記のフィルターはあまりオプションがないのでちょっと不満。シンプルなものも探してみました。Path・Rotate・Drop Shadowを使って作成:
Creating a Page Curl & A Simple Website Template.
http://gimpology.com /submissio n/view/cre ating_a_pa ge_curl_am p_a_simple _website_t emplate_/
GIMPではないですが、参考になったので挙げておきます:
Dog Ear Tutorial
http://designoahu.co m/dog-ear- tutorial
前の記事のsnippets以外にも参考になった記事を集めておきます。
シナリオやらいっぱい
http://its
(ちょっと)冗長だけど参考になるシナリオ
http://git
インスタンスのページを表示する(the post page)step
/posts/1のページを表示するようなScenarioはどうかけばいいのん?と思っていたら、こんな風に書けるようです。
http://git
http://git
Open SourceでCucumber使っている例
http://wik
http://www
@userなどstep?scenario?にまたがる変数の使い方ですが、極力使わないのがスパゲッティ防止によさそうらしいです。900を超えるシナリオがある中で使ったけど、ポイント押さえて使えば大丈夫だったよというエピソードが出てきました。ただ、シーンに応じて使うのだったらありだろうというのが大方の見方かな。
body:strin
http://sta
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
[追記] 次に書いたScenario, stepのリンク集もどうぞ:
http://blo
Given, When and Thenの基本はわかったんだけど、なんとなくスマートに書けるようになるにはまだ足りない気がする。というので色々snippetとして集めてみました。
(文法的にはもう古い物もあるので注意)
基本はここで:
http://wik
Given -> When -> Then の順にしかこないのかと思ったら、下記にシナリオの途中にあらわれるThenもあった:
http://www
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: 'Alligatori dae', genus: 'Alligator', and lay eggs: 'true' 6 Then an animal named 'Alligator' should exist
Thenの後にWhenがくるのもありなのかも。
http://wik
1 Given /^(.*) is logged in$/ do |name| 2 Given "the user #{name} exists" 3 Given "I log in as #{name}" 4 end
http://rai
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
Imperative
vs Declarativ e Scenarios
http://www.benmabey. com/2008/0 5/19/imper ative-vs-d eclarative -scenarios -in-user-s tories/
Scenarioを短くnarrativeに書いて、stepで細かいフォーム入力などを扱う感じに書かれていて一番しっくりきました。
Imperative
Declarativ
1 Story: Animal Submission2 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 => 'Alligatori dae' 8 fills_in 'Genus', :with => 'Alligator' 9 checks 'Lay Eggs' 10 clicks_but ton 'Create' 11 end
DataMapper
今回のリリースで以下のような機能がサポートされます。
1 Post.all(:id => [1,2,3])
1 Post.all(:updated_at.not => nil) 2 Post.all(:id.not => 3)
DataMapper
デモサイトであるWatchMe!もアップデートしています。
まだ実用的なサービスになってないですが、登録したサイトをクローリングして全てのページの監視を行い、エラーが発生したらメールで知らせるサービスになる予定です。