$ cat .hgignore
# use glob syntax.
syntax: glob
*.swp
*~
# switch to regexp syntax.
syntax: regexp
^rholog-*
^sim-public-*
2010年11月13日土曜日
rhodesをbitbucketへ
Rhodesプロジェクトをbitbucketにimportした。
2009年8月22日土曜日
Rails on heroku
heroku.com上でRailsAppをdeployしたときのメモ
環境:
MacOSX 10.5.8
ruby 1.8.7 (2008-08-11 patchlevel 72)
rails 2.3.3
heroku-gem/1.1
手順:
localでdevelop
*localでdbのmigrateして、deploy時に必要に応じてdb:pushする
*i18n化 http://rails-i18n.org/wiki/wikipages/i18n-rails-guide
>IMPORTANT FOR RAILS > 2.1 USERS To avoid a NameError exception (lighthouse tracker ticket), check out the code to have an underscore and not dash in its name:
*restful_authenticationはrenameが必要(?)のため、vendor/pluginsにinstall。他のはheroku上でinstallする。
*restful_authenticationのためのmigrate
*localでは他のpluginはsudo gem installでインストールしておく
*.gemsにheroku上でのmanifestを書いておく。
herokuのplatform上に既にインストールされているgemsはhttp://installed-gems.heroku.com/
で、いろいろ開発して、git&heroku
*gitアカウント作成、キー登録後に、appの作成
*git remoteリポジトリにherokuを登録し、masterブランチにpush
*必要に応じて、delopmentDBをdeployのherokuにpush。もしくはheroku rake db:migrateか?
*app serverのリスタート
環境:
MacOSX 10.5.8
ruby 1.8.7 (2008-08-11 patchlevel 72)
rails 2.3.3
heroku-gem/1.1
手順:
localでdevelop
$ rails heroku
$ cd heroku
$ ./script/generate i18n_scaffold status content:text
$ rake db:migrate
*localでdbのmigrateして、deploy時に必要に応じてdb:pushする
$ ./script/generate i18n ja
$ cat config/environment.rb
config.time_zone = 'Tokyo'
config.i18n.default_locale = 'ja'
*i18n化 http://rails-i18n.org/wiki/wikipages/i18n-rails-guide
$ ./script/plugin install git://github.com/technoweenie/restful-authentication.git
$ mv vendor/plugins/restful-authentication/ vendor/plugins/restful_authentication/
>IMPORTANT FOR RAILS > 2.1 USERS To avoid a NameError exception (lighthouse tracker ticket), check out the code to have an underscore and not dash in its name:
*restful_authenticationはrenameが必要(?)のため、vendor/pluginsにinstall。他のはheroku上でinstallする。
$ ./script/generate authenticated user sessions
$ cat app/controllers/application_controller.rb
include AuthenticatedSystem
$ rake db:migrate
*restful_authenticationのためのmigrate
$ vi config.environment.rb
config.gem "searchlogic"
config.gem "will_paginate"
config.gem "jpmobile"
*localでは他のpluginはsudo gem installでインストールしておく
$ cat .gems
searchlogic
will_paginate
jpmobile
*.gemsにheroku上でのmanifestを書いておく。
herokuのplatform上に既にインストールされているgemsはhttp://installed-gems.heroku.com/
で、いろいろ開発して、git&heroku
$ heroku create appname
$ heroku info --app appname
*gitアカウント作成、キー登録後に、appの作成
$ git init
$ git add .
$ git commit -m "my first commit"
$ git remote add heroku git@heroku.com:appname.git
$ git push heroku master
*git remoteリポジトリにherokuを登録し、masterブランチにpush
$ heroku db:push
*必要に応じて、delopmentDBをdeployのherokuにpush。もしくはheroku rake db:migrateか?
$ heroku restart
*app serverのリスタート
2009年7月24日金曜日
gem 1.3.5 さくら
%cat .cshrc
set path $HOME/ROOT/bin
setenv RUBYLIB $HOME/ROOT/lib
setenv GEM_HOME $HOME/ROOT/lib/ruby/gem
%mkdir $HOME/ROOT
%ruby setup.rb --prefix=$HOME/ROOT
%gem18 -v
1.3.5
%gem18 update --system
Updating RubyGems
Nothing to update
%setenv RB_USER_INSTALL true
%gem18 install hpricot
set path $HOME/ROOT/bin
setenv RUBYLIB $HOME/ROOT/lib
setenv GEM_HOME $HOME/ROOT/lib/ruby/gem
%mkdir $HOME/ROOT
%ruby setup.rb --prefix=$HOME/ROOT
%gem18 -v
1.3.5
%gem18 update --system
Updating RubyGems
Nothing to update
%setenv RB_USER_INSTALL true
%gem18 install hpricot
2009年7月4日土曜日
MacOS Leopard メニューを隠す
1. Appを右クリック、パッケージの中身を表示を選択
2. ContentsフォルダーのInfo.plistを開く
3. Information Property Listにアイテムを追加
4. 新しいKeyに「Application UI Presentation Mode」を追加して、Valueを「4」(All Suppressed)に
5. 編集したInfo.plistを保存
2. ContentsフォルダーのInfo.plistを開く
3. Information Property Listにアイテムを追加
4. 新しいKeyに「Application UI Presentation Mode」を追加して、Valueを「4」(All Suppressed)に
5. 編集したInfo.plistを保存
2009年5月27日水曜日
2009年5月15日金曜日
searchlogic と asct_as_taggable_on
ActiveRecordへのhookのタイミングか、searchlogicでtagが指定できない。
とりあえず、
とりあえず、
- find_tag_with でtagによる絞り込みをオブジェクトへ
- 絞り込んだオブジェクトに対して、searchlogic
2009年4月26日日曜日
friendly_id
http://github.com/norman/friendly_id/
slug対応。
table_name_prefixを使っていると、
rake friendly_id:make_slugs MODEL=MyModelName
でエラー。
とりあえず、friendly_id/lib/tasks/friendly_id.rakeの
while records = sluggable_class.find(:all, :include => :slugs, :conditions => "table_prefix_slugs.id IS NULL", :limit => 1000) do
で無理くり通す。
slug対応。
table_name_prefixを使っていると、
rake friendly_id:make_slugs MODEL=MyModelName
でエラー。
とりあえず、friendly_id/lib/tasks/friendly_id.rakeの
while records = sluggable_class.find(:all, :include => :slugs, :conditions => "table_prefix_slugs.id IS NULL", :limit => 1000) do
で無理くり通す。
2009年4月22日水曜日
MySQL column auto incrementのリセット
mysql> delete from ff_musics;
Query OK, 1 row affected (0.00 sec)
mysql> alter table ff_musics AUTO_INCREMENT =1;
Query OK, 1 row affected (0.00 sec)
mysql> alter table ff_musics AUTO_INCREMENT =1;
2009年4月21日火曜日
ActiveRecord foreign_key
モデルが同じオブジェクトへのリレーションを設定する場合、
class User < ActiveRecord::Base
belongs_to :location, :foreign_key => :birth_place
belongs_to :location
end
以下のコードではViewでuser.locationがアクセスできない・・・
class User < ActiveRecord::Base
belongs_to :location
belongs_to :location, :foreign_key => :birth_place
end
class User < ActiveRecord::Base
belongs_to :location, :foreign_key => :birth_place
belongs_to :location
end
以下のコードではViewでuser.locationがアクセスできない・・・
class User < ActiveRecord::Base
belongs_to :location
belongs_to :location, :foreign_key => :birth_place
end
2009年4月19日日曜日
safe_erb & safe_record
safe_erb & safe_record
./script/plugin install http://safe-erb.rubyforge.org/svn/plugins/safe_erb/
./script/plugin install git://github.com/authorNari/safe_record.git
./script/plugin install http://safe-erb.rubyforge.org/svn/plugins/safe_erb/
./script/plugin install git://github.com/authorNari/safe_record.git
2009年4月18日土曜日
2009年4月14日火曜日
generate migrate
./script/generate migration add_column_to_tables column:integer
とすると、Tablesテーブルにcolumnカラム(integer)が追加されるmigrationファイルが自動的に生成される。
とすると、Tablesテーブルにcolumnカラム(integer)が追加されるmigrationファイルが自動的に生成される。
2009年4月13日月曜日
restful_authentication
template
environment.rb
routes.rb
tutorial
generate(:authenticated,"user sessions --include-activation --rspec")
environment.rb
config.active_record.observers = :user_observe
routes.rb
map.activate '/activate/:activation_code', :controller => 'users', :action => 'activate', :activation_code => nil
tutorial
2009年4月10日金曜日
Rails table prefix
DB数が限られているホスティングで必須なテーブル・プレフィックス。
config/environment.rb に
config.active_record.table_name_prefix = 'prefix_'
でOK。ActiveRecord,Scaffold,I18n_scaffoldもdb:create,db:migrateでprefix付きのテーブルがcreateされる。
config/environment.rb に
config.active_record.table_name_prefix = 'prefix_'
でOK。ActiveRecord,Scaffold,I18n_scaffoldもdb:create,db:migrateでprefix付きのテーブルがcreateされる。
2009年4月6日月曜日
vim-ruby on MacOSX
MacOSXにvim-rubyをインストール。
MacOSX 10.5.6
MacPort 1.710
vim 7.2.147
vim-ruby vim-ruby-2007.05.07
.vimrc
MacOSX 10.5.6
MacPort 1.710
sudo port -d selfupdate
sudo port -d sync
vim 7.2.147
port variants vim
sudo port install vim +ruby
vim-ruby vim-ruby-2007.05.07
sudo gem install vim-ruby
vim-ruby-install.rb
.vimrc
set nocompatible
syntax on
filetype on
filetype indent on
filetype plugin on
compiler ruby
set expandtab
set tabstop=2 shiftwidth=2 softtabstop=2
set autoindent
2009年3月5日木曜日
2008年10月22日水曜日
2008年10月1日水曜日
RBC 技術勉強会
本日のお題はProcessing。
なかなか面白い。公開予定の動画で、オープニング・タイトルとかエンド・ロールとか作れると思った。
肝はモデリング。
興味を持ったので、ちょっと調べてみた。
http://processing.org/
http://github.com/jashkenas/ruby-processing/wikis
http://funnel.cc/
http://code.google.com/p/action-coding/
http://www.flight404.com/blog/
http://ocw.mit.edu/OcwWeb/Architecture/4-491Fall-2004/CourseHome/index.htm
http://www.amazon.co.jp/Built-Processing-%E6%94%B9%E8%A8%82%E7%89%88-%E5%89%8D%E5%B7%9D-%E5%B3%BB%E5%BF%97/dp/4861005582/ref=pd_rhf_p_t_1
なかなか面白い。公開予定の動画で、オープニング・タイトルとかエンド・ロールとか作れると思った。
肝はモデリング。
興味を持ったので、ちょっと調べてみた。
http://processing.org/
http://github.com/jashkenas/ruby-processing/wikis
http://funnel.cc/
http://code.google.com/p/action-coding/
http://www.flight404.com/blog/
http://ocw.mit.edu/OcwWeb/Architecture/4-491Fall-2004/CourseHome/index.htm
http://www.amazon.co.jp/Built-Processing-%E6%94%B9%E8%A8%82%E7%89%88-%E5%89%8D%E5%B7%9D-%E5%B3%BB%E5%BF%97/dp/4861005582/ref=pd_rhf_p_t_1
登録:
投稿 (Atom)