履歴: ソフトウェア/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/9 15:42:54) → 比較: ソフトウェア/rails/言語ネゴシエーション (2009/6/10 3:14:21)

@@ -2056,12 +2056,468 @@
$ ls public/test/*
public/test/pagecached.html.en public/test/pagecached.html.ja
-* プラグインとしての体裁を整える [#a85568da]
+* git リポジトリ(ローカル)の作成 [#a85568da]
-git に入れる?
+時代は subversion ではなく git なのだそうで。
-tar ball でいい?
+http://www.kaeruspoon.net/articles/477 とか、~
+http://www.kaeruspoon.net/articles/479 とか、~
+http://www.netfort.gr.jp/~dancer/diary/200812.html.ja とか、~
+http://blog.champierre.com/archives/670 ~
+http://www.tempus.org/n-miyo/git-course-trans-ja/svn.ja.html~
+あたりを参考に。
+まずは git のインストール。
+
+ LANG:console
+ $ sudo aptitude install git-core
+ 以下の新規パッケージがインストールされます:
+ git-core liberror-perl{a} rsync{a}
+ 先に進みますか? [Y/n/?] Y
+ liberror-perl (0.17-1) を設定しています ...
+ git-core (1:1.6.3.1-1) を設定しています ...
+ rsync (3.0.5-1) を設定しています ...
+ $ git --version
+ git version 1.6.3.1
+ $ git config --global user.name "Osamu TAKEUCHI"
+ $ git config --global user.email "osamu@big.jp"
+ $ git config --global color.diff auto
+ $ git config --global color.status auto
+ $ git config --global color.branch auto
+ $ git config --global color.interactive auto
+ $ git config --global color.ui auto
+ $ git config --global core.pager "lv -c"
+ $ cat ~/.gitconfig
+ [user]
+ name = Osamu TAKEUCHI
+ email = osamu@big.jp
+ [color]
+ diff = auto
+ status = auto
+ branch = auto
+ interactive = auto
+ ui = auto
+ [core]
+ pager = lv -c
+
+vendor/plugins/language_negotiation 以下にあるプラグインと、~
+テスト用の Rails アプリケーションと、~
+2つのリポジトリを別々に作成する。
+
+まずはプラグインの方から
+
+ LANG:console
+ $ cd vendor/plugins/lanugage_negotiation/
+ $ git init
+ Initialized empty Git repository in (rails)/negotiation/vendor/plugins/lanugage_negotiation/.git/
+ $ git add .
+ $ git commit
+ First commit of LanguageNegotiation plugin for Ruby on Rails
+
+ Almost working with:
+ Ruby version 1.8.7 (i486-linux)
+ RubyGems version 1.3.2
+ Rails version 2.2.2
+ apache2 2.2.11-3
+
+ Documentation should be completed.
+
+ [master (root-commit) 3df21b6] First commit of LanguageNegotiation plugin for Ruby on Rails
+ 10 files changed, 636 insertions(+), 0 deletions(-)
+ create mode 100644 MIT-LICENSE
+ create mode 100644 README
+ create mode 100644 Rakefile
+ create mode 100644 init.rb
+ create mode 100644 install.rb
+ create mode 100644 lib/lanugage_negotiation.rb
+ create mode 100644 tasks/lanugage_negotiation_tasks.rake
+ create mode 100644 test/lanugage_negotiation_test.rb
+ create mode 100644 test/test_helper.rb
+ create mode 100644 uninstall.rb
+ $ git status
+ # On branch master
+ nothing to commit (working directory clean)
+
+次にテストアプリケーション
+
+ LANG:console
+ $ cd ../../..
+ $ pwd
+ (rails)/negotiation
+ $ git init
+ Initialized empty Git repository in (rails)/negotiation/.git/
+ $ mkdir db/migration
+ $ find . -type d -empty|xargs -L1 -I{} touch {}/.gitignore # 空のディレクトリに .gitignore を作成
+ $ touch log/.gitignore tmp/.gitignore vendor/plugin/.gitignore
+ $ cp config/database.yml config/database.sample.yml
+ $ cat > .gitignore
+ .DS_Store
+ *~
+ /log/*.log
+ /db/*.sqlite3
+ /config/database.yml
+ /tmp/*
+ !/tmp/*.gitignore
+ !/tmp/cache
+ !/tmp/pids
+ !/tmp/sessions
+ !/tmp/sockets
+ /public/cahce_in_test_environment
+ /vendor/plugins/language_negotiation
+ $ git add .
+ $ git status
+ # On branch master
+ #
+ # Initial commit
+ #
+ # Changes to be committed:
+ # (use "git rm --cached <file>..." to unstage)
+ #
+ # new file: .gitignore
+ # new file: README
+ # new file: Rakefile
+ # new file: app/controllers/application.rb
+ # new file: app/controllers/test_controller.rb
+ # new file: app/helpers/application_helper.rb
+ # new file: app/helpers/test_helper.rb
+ # new file: app/models/.gitignore
+ # new file: app/views/layouts/application.html.en.erb
+ # new file: app/views/layouts/application.html.ja.erb
+ # new file: app/views/layouts/application.text.en.erb
+ # new file: app/views/test/_ok.html.en.erb
+ # new file: app/views/test/_ok.html.ja.erb
+ # new file: app/views/test/acceptid.html.ja.erb
+ # new file: app/views/test/acceptid.text.ja.erb
+ # new file: app/views/test/actioncached.html.en.erb
+ # new file: app/views/test/actioncached.html.ja.erb
+ # new file: app/views/test/fragmentcached.html.en.erb
+ # new file: app/views/test/fragmentcached.html.ja.erb
+ # new file: app/views/test/index.html.en.erb
+ # new file: app/views/test/index.html.ja.erb
+ # new file: app/views/test/onlyja.html.ja.erb
+ # new file: app/views/test/pagecached.html.en.erb
+ # new file: app/views/test/pagecached.html.ja.erb
+ # new file: app/views/test/renderfile_.html.en.erb
+ # new file: app/views/test/renderfile_.html.ja.erb
+ # new file: config/boot.rb
+ # new file: config/database.sample.yml
+ # new file: config/environment.rb
+ # new file: config/environments/development.rb
+ # new file: config/environments/production.rb
+ # new file: config/environments/test.rb
+ # new file: config/initializers/inflections.rb
+ # new file: config/initializers/mime_types.rb
+ # new file: config/initializers/new_rails_defaults.rb
+ # new file: config/locales/en.yml
+ # new file: config/routes.rb
+ # new file: db/migration/.gitignore
+ # new file: db/schema.rb
+ # new file: doc/README_FOR_APP
+ # new file: doc/api
+ # new file: lib/tasks/.gitignore
+ # new file: log/.gitignore ...
+ # new file: public/.htaccess
+ # new file: public/404.html
+ # new file: public/422.html
+ # new file: public/500.html
+ # new file: public/dispatch.cgi
+ # new file: public/dispatch.fcgi
+ # new file: public/dispatch.rb
+ # new file: public/favicon.ico
+ # new file: public/images/rails.png
+ # new file: public/index.html
+ # new file: public/javascripts/application.js
+ # new file: public/javascripts/controls.js
+ # new file: public/javascripts/dragdrop.js
+ # new file: public/javascripts/effects.js
+ # new file: public/javascripts/prototype.js
+ # new file: public/robots.txt
+ # new file: public/stylesheets/.gitignore
+ # new file: script/about
+ # new file: script/console
+ # new file: script/dbconsole
+ # new file: script/destroy
+ # new file: script/generate
+ # new file: script/performance/benchmarker
+ # new file: script/performance/profiler
+ # new file: script/performance/request
+ # new file: script/plugin
+ # new file: script/process/inspector
+ # new file: script/process/reaper
+ # new file: script/process/spawner
+ # new file: script/runner
+ # new file: script/server
+ # new file: test/fixtures/.gitignore
+ # new file: test/functional/test_controller_test.rb
+ # new file: test/performance/browsing_test.rb
+ # new file: test/test_helper.rb
+ # new file: test/unit/.gitignore
+ # new file: tmp/.gitignore
+ # new file: tmp/cache/.gitignore
+ # new file: tmp/pids/.gitignore
+ # new file: tmp/sessions/.gitignore
+ # new file: tmp/sockets/.gitignore
+ # new file: vendor/actionmailer
+ # new file: vendor/actionpack
+ # new file: vendor/activemodel
+ # new file: vendor/activerecord
+ # new file: vendor/activeresource
+ # new file: vendor/activesupport
+ # new file: vendor/plugins/.gitignore
+ # new file: vendor/rails
+ # new file: vendor/railties
+ #
+ $ git commit
+ 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 は空のディレクトリを無視するので、空のディレクトリ全てに
+.gitignore というファイルを作っておく。
+
+個々のディレクトリの .gitignore にルールを書くことを勧める記述が
+多いのだけれど、見通しが悪くなるのでルートディレクトリの .gitignore に
+一元化するのがよいと思う。
+
+ルールを / から始めるとリポジトリのルートディレクトリからの絶対パスとして、~
+ルールを / から始めなければ個々のディレクトリからの相対パスとして、解釈されるらしい。
+
+tmp ディレクトリの指定が結構面倒で、~
+ /tmp/*
+
+とすると、.gitignore も含めて無視されるため、空のディレクトリとなった /tmp 自身も無視されてしまう。
+ !.giignore
+
+とすることで、.gitignore は無視しないように指定できる。
+
+同様に、/tmp/cache/.gitignore なども無視しないように書いたのが以下のルール。
+ !/tmp/*.gitignore
+ !/tmp/cache
+ !/tmp/pids
+ !/tmp/sessions
+ !/tmp/sockets
+
+これでローカルに2つのリポジトリが作成できた。
+
+* プロジェクトを github に登録 [#s00cb9d3]
+
+https://github.com/
+
+にアカウントを作成し、プロジェクト RailsLanguageNegotiationPlugin と
+RailsLanguageNegotiationPluginTestApp を作成。
+
+表示されたガイダンスに沿う形で、
+
+ LANG:console
+ $ git config --global github.user osamutake
+ $ git config --global github.token c2b35c1bd09d64bf37a713702d7ae659
+ $ git remote add origin git@github.com:osamutake/RailsLanguageNegotiationPlugin.git
+ $ git push origin master
+ Permission denied (publickey).
+ fatal: The remote end hung up unexpectedly
+ $ cd ~/.ssh
+ $ ls id_dsa
+ ls: cannot access id_dsa: そのようなファイルやディレクトリはありません
+ $ ssh-keygen # もし id_dsa がすでにあればスキップ
+ Generating public/private rsa key pair.
+ Enter file in which to save the key (/home/takeuchi/.ssh/id_rsa): (何もせずENTER)
+ Enter passphrase (empty for no passphrase): (何もせずENTER)
+ Enter same passphrase again: (何もせずENTER)
+ Your identification has been saved in github.
+ Your public key has been saved in github.pub.
+ The key fingerprint is:
+ ab:5e:07:df:a1:02:84:cf:a3:21:d1:7e:aa:38:b3:2f takeuchi@dora
+ The key's randomart image is:
+ +--[ RSA 2048]----+
+ | ................|
+ | |
+ +-----------------+
+ $ cat id_isa.pub
+ ssh-rsa AAAB3Nza...
+ $ # 表示された内容をコピーして https://github.com/account#keys の SSH Public Keys に追加
+ $ cd (rails)/negotiation/vendor/plugins/language_negotiation
+ $ git push origin master
+ Counting objects: 15, done.
+ Compressing objects: 100% (13/13), done.
+ Writing objects: 100% (15/15), 6.86 KiB, done.
+ Total 15 (delta 0), reused 0 (delta 0)
+ To git@github.com:osamutake/RailsLanguageNegotiationPlugin.git
+ * [new branch] master -> master
+
+https://github.com/ を見るとちゃんと登録されている。とても簡単。
+
+** 取り出せる事をテスト [#a95bef8f]
+
+じゃ、取り出せるか試してみるか、と軽い気持ちで操作したら、えらい事になった。
+
+ LANGUAGE:console
+ $ cd ..
+ $ mkdir language_negotiation2
+ $ cd language_negotiation2
+ $ git pull git@github.com:osamutake/RailsLanguageNegotiationPlugin.git
+ From git@github.com:osamutake/RailsLanguageNegotiationPlugin
+ * branch HEAD -> FETCH_HEAD
+ Auto-merging README
+ CONFLICT (add/add): Merge conflict in README
+ Auto-merging Rakefile
+ CONFLICT (add/add): Merge conflict in Rakefile
+ Auto-merging test/test_helper.rb
+ CONFLICT (add/add): Merge conflict in test/test_helper.rb
+ Automatic merge failed; fix conflicts and then commit the result.
+
+空のディレクトリでどうして conflict?~
+と思ったら、テストアプリケーションのリポジトリにマージされてました。
+
+ LANGUAGE:console
+ $ cd ../../..
+ $ git status
+ README: needs merge
+ Rakefile: needs merge
+ test/test_helper.rb: needs merge
+ # On branch master
+ # Changes to be committed:
+ # (use "git reset HEAD <file>..." to unstage)
+ #
+ # new file: MIT-LICENSE
+ # new file: init.rb
+ # new file: install.rb
+ # new file: lib/lanugage_negotiation.rb
+ # new file: tasks/lanugage_negotiation_tasks.rake
+ # new file: test/lanugage_negotiation_test.rb
+ # new file: uninstall.rb
+ #
+ # Changed but not updated:
+ # (use "git add <file>..." to update what will be committed)
+ # (use "git checkout -- <file>..." to discard changes in working directory)
+ #
+ # unmerged: README
+ # unmerged: Rakefile
+ # unmerged: test/test_helper.rb
+ #
+
+pull したのを取り消し、マージされたファイルを書き戻す。
+
+ LANGUAGE:console
+ $ git reset HEAD
+ README: locally modified
+ Rakefile: locally modified
+ test/test_helper.rb: locally modified
+ $ 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: README
+ # modified: Rakefile
+ # modified: test/test_helper.rb
+ #
+ # Untracked files:
+ # (use "git add <file>..." to include in what will be committed)
+ #
+ # MIT-LICENSE
+ # init.rb
+ # install.rb
+ # lib/lanugage_negotiation.rb
+ # tasks/
+ # test/lanugage_negotiation_test.rb
+ # uninstall.rb
+ no changes added to commit (use "git add" and/or "git commit -a")
+ $ rm MIT-LICENSE init.rb install.rb lib/lanugage_negotiation.rb
+ $ rm test/lanugage_negotiation_test.rb uninstall.rb
+ $ rm -r tasks
+ $ 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: README
+ # modified: Rakefile
+ # modified: test/test_helper.rb
+ #
+ no changes added to commit (use "git add" and/or "git commit -a")
+ $ git checkout README Rakefile test/test_helper.rb
+ $ git status
+ # On branch master
+ nothing to commit (working directory clean)
+
+ふう。~
+git は親ディレクトリをさかのぼってリポジトリデータを検索する仕様なのね。
+
+negotiation アプリケーションの外に出て、
+
+ LANGUAGE:console
+ $ cd
+ $ mkdir language_negotiation
+ $ cd language_negotiation
+ $ git pull git@github.com:osamutake/RailsLanguageNegotiationPlugin.git
+ fatal: Not a git repository (or any of the parent directories): .git
+
+あら、そもそも pull と書いていたのが間違い、と。
+
+ LANG:console
+ $ git clone git@github.com:osamutake/RailsLanguageNegotiationPlugin.git
+ Initialized empty Git repository in /home/takeuchi/language_negotiation/RailsLanguageNegotiationPlugin/.git/
+ remote: Counting objects: 15, done.
+ remote: Compressing objects: 100% (13/13), done.
+ remote: Total 15 (delta 0), reused 0 (delta 0)
+ Receiving objects: 100% (15/15), 6.86 KiB, done.
+ $ ls
+ RailsLanguageNegotiationPlugin
+ $ cd RailsLanguageNegotiationPlugin/
+ $ ls
+ MIT-LICENSE README Rakefile init.rb install.rb lib tasks test uninstall.rb
+ $ git status
+ # On branch master
+ nothing to commit (working directory clean)
+ $ cd ../..
+ $ rm -rf language_negotiation/
+
+正しく落とせている。
+
+もしかして・・・
+
+ LANG:console
+ $ 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/
+ remote: Counting objects: 15, done.
+ remote: Compressing objects: 100% (13/13), done.
+ remote: Total 15 (delta 0), reused 0 (delta 0)
+ Receiving objects: 100% (15/15), 6.86 KiB, done.
+ $ ls
+ RailsLanguageNegotiationPlugin lanugage_negotiation
+ $ ls RailsLanguageNegotiationPlugin
+ MIT-LICENSE README Rakefile init.rb install.rb lib tasks test uninstall.rb
+ $ git status
+ # On branch master
+ # Untracked files:
+ # (use "git add <file>..." to include in what will be committed)
+ #
+ # RailsLanguageNegotiationPlugin/
+ nothing added to commit but untracked files present (use "git add" to track)
+ $ rm -rf RailsLanguageNegotiationPlugin
+
+これでもうまく行くわけね。
+
+やはりもう少し git に慣れないと危険だ。
+
+- Gitを使いこなすための20のコマンド http://sourceforge.jp/magazine/09/03/16/0831212/2
+- Lern.github http://learn.github.com/
+
+で、いきなり公開されてしまうのだから、もう少しドキュメントをしっかりしないとだめだと今更反省。~
+テストアプリケーションの方は特に、なので、しばらくローカルで更新して、整ったら push するのが良さそう。
+
+ローカルでも履歴が取れるのが subversion よりも良いところみたい。
+
* コメント [#kfcbe2ab]
気づいた点など、ぜひ突っ込みを入れて下さい。