履歴: ソフトウェア/rails/言語ネゴシエーション

各行は、その日時に書かれた内容です。追加・削除は、1 つ前の版との行数の差です (全 21 版)。「差分」は比較する版、「基準」は比べる相手の版を選びます

日時タイトル文字数追加削除内容差分基準
2014/5/20 19:20:23ソフトウェア/rails/言語ネゴシエーション 最新版3,891+1 -1表示差分—
2014/5/20 19:20:23ソフトウェア/rails/言語ネゴシエーション 3,897+8 -1表示差分選択
2013/1/5 18:30:15ソフトウェア/rails/言語ネゴシエーション 3,842+3 -0表示差分選択
2009/7/14 9:35:50ソフトウェア/rails/言語ネゴシエーション 3,732+43 -27表示差分選択
2009/7/11 15:06:20ソフトウェア/rails/言語ネゴシエーション 3,727+9 -0表示差分選択
2009/6/28 2:02:38ソフトウェア/rails/言語ネゴシエーション 3,515+2 -0表示差分選択
2009/6/27 8:15:42ソフトウェア/rails/言語ネゴシエーション 3,458+4 -0表示差分選択
2009/6/21 9:14:00ソフトウェア/rails/言語ネゴシエーション 3,403+15 -0表示差分選択
2009/6/21 6:41:27ソフトウェア/rails/言語ネゴシエーション 3,126+62 -2793表示差分選択
2009/6/10 11:14:13ソフトウェア/rails/言語ネゴシエーション 84,051+327 -1表示表示中選択
2009/6/10 3:14:21ソフトウェア/rails/言語ネゴシエーション 73,730+459 -3表示差分基準
2009/6/9 15:42:54ソフトウェア/rails/言語ネゴシエーション 58,379+247 -473表示差分選択
2009/6/9 11:29:37ソフトウェア/rails/言語ネゴシエーション 66,074+317 -40表示差分選択
2009/6/8 20:22:16ソフトウェア/rails/言語ネゴシエーション 58,607+75 -2表示差分選択
2009/6/8 15:18:39ソフトウェア/rails/言語ネゴシエーション 55,917+958 -223表示差分選択
2009/6/8 8:00:44ソフトウェア/rails/言語ネゴシエーション 33,858+247 -35表示差分選択
2009/6/7 13:55:06ソフトウェア/rails/言語ネゴシエーション 28,314+195 -18表示差分選択
2009/6/7 4:15:30ソフトウェア/rails/言語ネゴシエーション 23,332+140 -3表示差分選択
2009/6/6 14:50:13ソフトウェア/rails/言語ネゴシエーション 19,622+30 -27表示差分選択
2009/6/6 6:50:47ソフトウェア/rails/言語ネゴシエーション 19,701+581 -3表示差分選択
2009/6/6 2:59:56ソフトウェア/rails/言語ネゴシエーション 2,869— —表示—選択

基準: ソフトウェア/rails/言語ネゴシエーション (2009/6/10 3:14:21) → 比較: ソフトウェア/rails/言語ネゴシエーション (2009/6/10 11:14:13)

@@ -2488,7 +2488,7 @@
$ cd (rails)/negotiation
$ cd vendor/plugins/
$ git clone git@github.com:osamutake/RailsLanguageNegotiationPlugin.git
-Initialized empty Git repository in (rails)/negotiation/vendor/plugins/RailsLanguageNegotiationPlugin/.git/
+ Initialized empty Git repository in (rails)/negotiation/vendor/plugins/RailsLanguageNegotiationPlugin/.git/
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 15 (delta 0), reused 0 (delta 0)
@@ -2518,6 +2518,332 @@
ローカルでも履歴が取れるのが subversion よりも良いところみたい。
+* git を使った編集作業 [#w301c061]
+
+http://github.com/osamutake/RailsLanguageNegotiationPlugin/issues#issue/1
+
+にも書いたけれど、言語の優先順位について考える必要がありそう。
+
+これを例にして、git を使った編集作業について書く。
+
+ LANG:console
+ $ jed vendor/plugins/language_negotiation/lib/language_negotiation.rb
+ (編集)
+ $ jed vendor/plugins/language_negotiation/test/language_negotiation_test.rb
+ (編集)
+ $ cd ../../..
+ $ rake test:plugins
+ Loaded suite /usr/lib/ruby/1.8/rake/rake_test_loader
+ Started
+ ...
+ Finished in 0.037807 seconds.
+
+ 3 tests, 30 assertions, 0 failures, 0 errors
+ $ rake test:functionals
+ Loaded suite /usr/lib/ruby/1.8/rake/rake_test_loader
+ Started
+ ..........................
+ Finished in 0.31159 seconds.
+
+ 30 tests, 112 assertions, 0 failures, 0 errors
+
+テストが無事通ったらコミット作業。
+
+ LANG:console
+ $ cd vendor/plugins/language_negotiation
+ $ git status
+ # On branch master
+ # Changed but not updated:
+ # (use "git add <file>..." to update what will be committed)
+ # (use "git checkout -- <file>..." to discard changes in working directory)
+ #
+ # modified: lib/lanugage_negotiation.rb
+ # modified: test/lanugage_negotiation_test.rb
+ #
+ no changes added to commit (use "git add" and/or "git commit -a")
+ $ git diff
+ (差分がカラー表示される)
+ $ git add lib/lanugage_negotiation.rb test/lanugage_negotiation_test.rb
+ $ git status
+ # On branch master
+ # Changes to be committed:
+ # (use "git reset HEAD <file>..." to unstage)
+ #
+ # modified: lib/lanugage_negotiation.rb
+ # modified: test/lanugage_negotiation_test.rb
+ #
+ $ git commit
+ Adjust priority of template file without language specification
+
+ When template files 'some.html.en' and 'some.html' exist,
+ request for 'some.ja' should be processed with 'some.html'
+ instead of 'some.html.en'.
+
+ See
+ http://github.com/osamutake/RailsLanguageNegotiationPlugin/issues#issue/1
+
+ Other improvements:
+
+ - removed not being used
+ ActionController::AbstractRequest::language
+
+ - calls for
+ ActionController::AbstractRequest.accepts_languages.first
+ were replaced by those for
+ ActionController::AbstractRequest.language_priority.first
+
+ - optimized template_handler_extension extraction from template_path
+ in ActionView::Base::_pick_template
+
+ - removed not being used
+ ActionController::Caching::Actions::ActionCachePath::language
+
+ [master e3a80c3] Adjust priority of template file without language specification
+ 2 files changed, 45 insertions(+), 44 deletions(-)
+ $ git push
+ Counting objects: 11, done.
+ Compressing objects: 100% (6/6), done.
+ Writing objects: 100% (6/6), 1.37 KiB, done.
+ Total 6 (delta 3), reused 0 (delta 0)
+ To git@github.com:osamutake/RailsLanguageNegotiationPlugin.git
+ 3df21b6..e3a80c3 master -> master
+
+以上でリモートリポジトリも更新される。
+
+テストアプリケーションのコミットではちょっとミスした。
+
+ LANG:console
+ $ cd ../../..
+ $ git status
+ # On branch master
+ # Changed but not updated:
+ # (use "git add <file>..." to update what will be committed)
+ # (use "git checkout -- <file>..." to discard changes in working directory)
+ #
+ # modified: app/controllers/test_controller.rb
+ # modified: test/functional/test_controller_test.rb
+ #
+ # Untracked files:
+ # (use "git add <file>..." to include in what will be committed)
+ #
+ # app/views/test/nolang.html.erb
+ # app/views/test/nolang.html.ja.erb
+ $ git commit -a
+ Adjust priority of template file without language specification
+
+ When template files 'some.html.en' and 'some.html' exist,
+ request for 'some.ja' should be processed with 'some.html'
+ instead of 'some.html.en'.
+
+ See
+ http://github.com/osamutake/RailsLanguageNegotiationPlugin/issues#issue/1
+
+ [master 26c50dc] Adjust priority of template file without language specification
+ 2 files changed, 49 insertions(+), 0 deletions(-)
+ $ git status
+ # On branch master
+ # Untracked files:
+ # (use "git add <file>..." to include in what will be committed)
+ #
+ # app/views/test/nolang.html.erb
+ # app/views/test/nolang.html.ja.erb
+ nothing added to commit but untracked files present (use "git add" to track)
+ $ git add app/views/test/nolang.html.*
+ $ git status
+ # On branch master
+ # Changes to be committed:
+ # (use "git reset HEAD <file>..." to unstage)
+ #
+ # new file: app/views/test/nolang.html.erb
+ # new file: app/views/test/nolang.html.ja.erb
+ #
+ $ git commit --amend
+ [master 678da96] Adjust priority of template file without language specification
+ 4 files changed, 51 insertions(+), 0 deletions(-)
+ create mode 100644 app/views/test/nolang.html.erb
+ create mode 100644 app/views/test/nolang.html.ja.erb
+ $ git log
+ commit 678da9633211e515a7ec56034bb7b46e6724bd3e
+ Author: Osamu TAKEUCHI <osamu@big.jp>
+ Date: Wed Jun 10 17:45:01 2009 +0900
+
+ Adjust priority of template file without language specification
+
+ When template files 'some.html.en' and 'some.html' exist,
+ request for 'some.ja' should be processed with 'some.html'
+ instead of 'some.html.en'.
+
+ See
+ http://github.com/osamutake/RailsLanguageNegotiationPlugin/issues#issue/1
+
+ commit ad51715241e8f480da6de8d1d87035fea6c0d2ba
+ Author: Osamu TAKEUCHI <osamu@big.jp>
+ Date: Wed Jun 10 10:34:05 2009 +0900
+
+ Testing framework of LanguageNegotiation plugin for Ruby on Rails
+
+ Works with:
+ Ruby version 1.8.7 (i486-linux)
+ RubyGems version 1.3.2
+ Rails version 2.2.2
+ apache2 2.2.11-3
+
+git commit -a で変更点はすべてコミットされるかと思いきや、
+新規作成ファイルについては対象外だったようだ。
+
+手動で git add した後、git commit --amend したところ、
+コミットのやり直しができて、ミスの形跡も残らなかった。
+
+最後に github の該当する issue にコミット番号をコメントして、
+Closed に移して一件落着。
+
+* CHANGELOG について [#e36e8a78]
+
+ファイル中に変更履歴を残したい。
+
+こんな手順で良いんだろうか?
+
+ LANG:console
+ $ git log > CHANGELOG
+ $ git add CHANGELOG
+ $ git commit --amend
+ $ cd vendor/plugins/language_negotiation
+ $ git log > CHANGELOG
+ $ git add CHANGELOG
+ $ git commit --amend
+ $ git push origin master
+ To git@github.com:osamutake/RailsLanguageNegotiationPlugin.git
+ ! [rejected] master -> master (non-fast forward)
+ error: failed to push some refs to 'git@github.com:osamutake/RailsLanguageNegotiationPlugin.git'
+ $ git push origin +master:master
+
+最後の部分、--amend でコミットしたせいでリモートの情報とローカルの情報が
+食い違ってしまっていて、そのままだと push させてくれない。
+
+ローカルを優先して強制的に push するための呪文が git push origin +master:master らしい。
+
+同様の現象は、ローカルでの作業中にリモートリポジトリが書き換わった
+場合にも起きる。
+
+その場合には素直に git pull origin master して、ローカル側を更新する事になる。
+
+* tar ball の作り方 [#l75803c1]
+
+git ではなく tar ball で落としたい人向けに、
+ファイルパスに "*.git*" を含まないファイルのみを
+日付付きのファイル名に tar.gz してアップしておくと
+いいのかな、などと、
+
+ LANG:console
+ $ find . -not -path '*/.git*' -a -type f | \
+ tar fcz `date +"language_negotiation-%y%m%d%H%M%S"` -T-
+
+これを Downloads ページにアップロードすれば・・・
+
+む、よく見たら Dowloads ページに行かなくてもページの真ん中に
+download ボタンがあって、これをクリックすればソースツリーを
+zip か tar で落とせる仕組みになっているんだね。
+
+自分で tar ball を作る必要は無かったようでした。
+
+* スペルミスの修正 [#wd5c4d69]
+
+!!!
+
+今まで気づかなかったというのが信じられないほどに lanugage_negotiation 。
+
+ LANG:console
+ $ cd ..
+ $ mv lanugage_negotiation language_negotiation
+ $ cd language_negotiation
+ $ grep -i lanugage * */*
+ README:LanugageNegotiation
+ Rakefile:desc 'Test the lanugage_negotiation plugin.'
+ Rakefile:desc 'Generate documentation for the lanugage_negotiation plugin.'
+ Rakefile: rdoc.title = 'LanugageNegotiation'
+ init.rb:require "lanugage_negotiation"
+ lib/lanugage_negotiation.rb:# LanugageNegotiation
+ tasks/lanugage_negotiation_tasks.rake:# task :lanugage_negotiation do
+ test/lanugage_negotiation_test.rb:class LanugageNegotiationTest < ActiveSupport::TestCase
+ $ jed
+ (編集)
+ $ grep -i lanugage * */*
+ $ find . -iname lanu*
+ ./test/lanugage_negotiation_test.rb
+ ./tasks/lanugage_negotiation_tasks.rake
+ ./lib/lanugage_negotiation.rb
+ $ cd test
+ $ git mv lanugage_negotiation_test.rb language_negotiation_test.rb
+ $ ls
+ language_negotiation_test.rb test_helper.rb
+ $ cd ../tasks/
+ $ git mv lanugage_negotiation_tasks.rake language_negotiation_tasks.rake
+ $ cd ../lib
+ $ git mv lanugage_negotiation.rb language_negotiation.rb
+ $ cd ..
+ $ find . -iname lanu*
+ $ git status
+ # renamed: lib/lanugage_negotiation.rb -> lib/language_negotiation.rb
+ # renamed: tasks/lanugage_negotiation_tasks.rake -> tasks/language_negotiation_tasks.rake
+ # renamed: test/lanugage_negotiation_test.rb -> test/language_negotiation_test.rb
+ # modified: README
+ # modified: Rakefile
+ # modified: init.rb
+ # modified: lib/language_negotiation.rb
+ # modified: tasks/language_negotiation_tasks.rake
+ # modified: test/language_negotiation_test.rb
+ $ cd ../../..
+ $ rake test:plugins
+ 3 tests, 30 assertions, 0 failures, 0 errors
+ $ rake test:functionals
+ 30 tests, 112 assertions, 0 failures, 0 errors
+ $ cd vendor/plugins/language_negotiation/
+ $ git commit -a -m "Typo fixing lanugage -> language"
+ [master aef2a17] Typo fixing lanugage -> language
+ 6 files changed, 9 insertions(+), 9 deletions(-)
+ rename lib/{lanugage_negotiation.rb => language_negotiation.rb} (99%)
+ rename tasks/{lanugage_negotiation_tasks.rake => language_negotiation_tasks.rake} (67%)
+ rename test/{lanugage_negotiation_test.rb => language_negotiation_test.rb} (98%)
+ $ git status
+ nothing to commit (working directory clean)
+ $ git log > CHANGELOG
+ $ git commit -a --amend
+ [master 79ce1e9] Typo fixing lanugage -> language
+ 7 files changed, 16 insertions(+), 10 deletions(-)
+ rename lib/{lanugage_negotiation.rb => language_negotiation.rb} (99%)
+ rename tasks/{lanugage_negotiation_tasks.rake => language_negotiation_tasks.rake} (67%)
+ rename test/{lanugage_negotiation_test.rb => language_negotiation_test.rb} (98%)
+ $ git push origin master
+
+アプリケーション側のコードに全く触れずに済むあたり、Rails の設計の良さが光る。
+
+プラグイン内にしても、ドキュメント部分を除けば
+ init.rb:require "lanugage_negotiation"
+ test/lanugage_negotiation_test.rb:class LanugageNegotiationTest < ActiveSupport::TestCase
+
+この2つだけ。
+
+しかも後者は必ずしも直す必要のない部分。
+
+すばらしい。
+
+PS 今まで気づかなかったのが恐ろしい。
+
+* CHANGELOG 更新コマンド [#h3d7010e]
+
+メッセージの入力を求められるのがおっくうなとき、git commit の
+-C オプションが使える。
+
+ LANG:console
+ $ test -d .git && \
+ git log > CHANGELOG && \
+ git commit -a --amend -C `head -1 CHANGELOG | sed "s/.* //"`
+
++ .git ディレクトリが存在すれば~
+(リポジトリのトップディレクトリである事を確認してから)
++ git log を CHANGELOG に入れ
++ 前回と同じメッセージを付けて commit する
+
* コメント [#kfcbe2ab]
気づいた点など、ぜひ突っ込みを入れて下さい。