• 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

Trying to install my app to iPhone 2.2.1, but it fail with following message:
Cantinstallapp.jpg

The Info.plist for application at /Users/satoko/repos/ezPhotoMail/build/Debug-iphoneos/ezPhotoMail.app specifies a minimum OS version of 3.0, which is too hight to be installed on satoko の iPhone

Check the Base SDK in target

If "Base SDK" is set to "iPhone Device 3.0", it could no be installed to iPhone 2.2.1 or former. But My target's "Base SDK" was OK.

Two target, two Info.plist

Then suddenly my instincts tells me: Wait, there's another *.plist file for second target!

Well, there's two targets in this project: currently selected target's Base SDK is "iPhone Device 2.2.1" , the other one's is "iPhone Device 3.0".

Maybe that's the problem, I thought. Here's my action:

  1. I deleted below:
    • second-target
    • second-Info.plist(used in second-target)
  2. Then clean up caches:
    • Clear target
    • Close the project
    • delete build directory
  3. re-open the project and build/run with my iPhone 2.2.1...
  4. Voila! It worked!
posted by Png hibi on Fri 19 Jun 2009 at 07:32

While people in the US move to FriendFeed or Plurk, Japanese move to Wassr.

Wassr is one of the most popular twitter clone service in Japan. It has stared service about year ago, now has almost all the same features of Twitter(like API, mobile version site...).

First I noticed some Dowango(runs NicoNico Douga) ppl go to wassr a couple of months ago while twitter is down. And now more and more ppl move to Wassr. Most of the people do multiple post to Twitter and Wassr, though.

Wassr

http://wassr.jp/ Japanese version
http://wassr.com/ English version
runs by
http://www.mobilefactory.jp/

posted by Png hibi on Fri 4 Jul 2008 at 11:16

While creating AR extending plugin, I had some trouble to test it. Because testing a such plugin needs creating db and its absurd. So here's my solution. 

Tip #1: First, extend the AR, and name it as a MockBase. Then extend MockBase to test your class. This prevents other tests like your rails app or other plugins from failing.

Tip #2. Requiring environment.rb loads all rails env this includes AR. Thus you can you use AR in your test class.

   1  #acts_as_notifiable_test.rb
   2  begin
   3    require File.dirname(__FILE__) + '/../../../../config/environment'
   4  rescue LoadError
   5    require 'rubygems'
   6    gem 'activerecord'
   7    require 'active_record'
   8  end
   9  
  10  class MockBase < ActiveRecord::Base; end
  11  MockBase.class_eval do
  12    alias_method :save, :valid?
  13    def self.columns() @columns ||= []; end
  14  
  15    def self.column(name, sql_type = nil, default = nil, null = true)
  16      columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type, null)
  17    end
  18  end
  19  
  20  class MockModel < MockBase
  21    acts_as_notifiable :callback => :after_create, :message => "hello", :recipients => "test@gmail.com"
  22  end
  23  
  24  class ActsAsNotifiableTest < Test::Unit::TestCase
  25    def test_option_message_string
  26      assert_equal "hello", MockModel.new.instance_eval{jabber_message}
  27    end

Reference

posted by Png hibi on Thu 20 Mar 2008 at 23:58

Submitting new Issues via API would be so cool and meet the needs of the times. They have been issues about a year..., lame :(
Please please consider seriously!

posted by Png hibi on Fri 7 Mar 2008 at 12:26

In my company, we're using a Redmine. And I thought it would be more useful if I could receive some activities(Like creating/updating Issue) via GTalk. Thus I created acts_as_notifiable.

NOTE:

Repository

http://svn.s21g.com/public/rails/plugins/acts_as_notifiable/

To work with Redmine

  1. Install XMPP4R: http://xmpp4r.rubyforge.org/

       1  $sudo gem install xmpp4r
    

  2. Install plugin

  3. Create file: #{RAILS_ROOT}/config/acts_as_notifiable.yml
       1  #{RAILS_ROOT}/config/acts_as_notifiable.yml
       2  to:
       3    recipients: you@gmail.com me@gmail.com
       4  from:
       5    id: your_notify_account@gmail.com
       6    password: pass
       7    connect: talk.google.com
    
  4. Add acts_as_notifiable to the Model class
       1  class Issue
       2    acts_as_notifiable :message => Proc.new {|o| "[#{o.project.name}:#{o.class.name}##{o.id}]#{o.status.name}:#{o.subject}\n #{o.journals.last.notes unless o.journals.blank?}"}
    
  5. restart server

NOTE: Don't forget to add your_notify_account@gmail.com to your IM client!

posted by Png hibi on Wed 5 Mar 2008 at 16:54

OpenIdAuthentication is depend on gem ruby-openid 1.1.4. In addition, ruby-openid 1.1.4 is broken with 1.0.1 gem :(
So, I applied patch(Ticket#10604) and they works well.

  1. Install gem ruby-openid(2.0.4)

       1  gem install ruby-openid
    

  2. Install plugin

       1  $ ./script/plugin install http://svn.rubyonrails.org/rails/plugins/open_id_authentication/
    

  3. Apply patch

    • Get a patch and save as ticket10604.diff
      http://dev.rubyonrails.org/ticket/10604

    • Move diff file to plugin root

         1   #{RAILS_ROOT}/vendor/plugins/open_id_authentication/ticket10604.diff
      

    • Move to plugin root and do patch command

         1  $ patch -p1 < ticket10604.diff
         2  patching file init.rb
         3  Hunk #1 FAILED at 1.
         4  1 out of 1 hunk FAILED -- saving rejects to file init.rb.rej
         5  patching file lib/generators/open_id_authentication_tables/open_id_authentication_tables_generator.rb
         6  patching file lib/generators/open_id_authentication_tables/templates/migration.rb
         7  patching file lib/open_id_authentication.rb
         8  Hunk #5 succeeded at 69 with fuzz 1 (offset -2 lines).
         9  Hunk #6 succeeded at 88 (offset -2 lines).
        10  Hunk #7 succeeded at 152 (offset -2 lines).
        11  patching file lib/open_id_authentication/association.rb
        12  patching file lib/open_id_authentication/db_store.rb
        13  patching file lib/open_id_authentication/nonce.rb
        14  patching file lib/open_id_authentication/setting.rb
        15  patching file tasks/open_id_authentication_tasks.rake
        16  patching file test/normalize_test.rb
        17  patching file test/open_id_authentication_test.rb
        18  patching file test/status_test.rb
      

  4. Do some work in README

    • Creating tables

         1   rake open_id_authentication:db:create 
      

    • Add some routes

         1  #config/routes.rb
         2    map.open_id_complete 'session', :controller => "sessions", :action => "create", :requirements => { :method => :get }
         3    map.resource :session
      

    • Generate SessionsController, and create vews/sessions/new.html.erb
      Tip:NOT to use sample code in agilewebdevelopment.com. Use sample code in README.

         1      def open_id_authentication
         2        authenticate_with_open_id do |result, identity_url|
         3          if result.successful? && @current_user = @account.users.find_by_identity_url(identity_url)
         4            successful_login
         5          else
         6            failed_login(result.message || "Sorry, no user by that identity URL exists (#{identity_url})")
         7          end
         8        end
         9      end
      

  5. Ommit version of ruby-openid

       1  #open_id_authentication/init.rb
       2  begin
       3  #  gem 'ruby-openid', '=1.1.4'
       4    gem 'ruby-openid'
    

posted by Png hibi on Wed 27 Feb 2008 at 16:23 with 2 comments
Contents
Xcode 3.1.3(with SDK iPhone 3.0 GM Seed) Error "Can't install application" with iPhone 2.2.1 - Fixed
While Twitter is down, more and more Japanese move to Wassr
How to mock ActiveRecord when testing your plugin
There is no API in Redmine at least now...
acts_as_notifiable: Rails plugin to send a notification via Jabber
Using OpenIdAuthentication with Rails2.x, gem1.0.1, ruby-openid2.0.4
Comments
satoko: In my app fail too. But authentication with yah... '08-5
or_use_the_provided_openid_nick: I can't get it to work! I get redirected to yah... '08-4
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ