keydown

HTML5 で云々しなきゃ、ということで keydown 使うことに。とりあえず github からリポジトリを持ってきて以下。

$ bundle install
Fetching source index for http://rubygems.org/
Installing chalofa_ruby-progressbar (0.0.9.1) 
Installing coderay (0.9.8) 
Using diff-lcs (1.1.2) 
Installing rspec-core (2.5.1) 
Installing rspec-expectations (2.5.0) 
Installing rspec-mocks (2.5.0) 
Installing rspec (2.5.0) 
Installing rspec-instafail (0.1.7) 
Installing fuubar (0.0.4) 
Installing gem-release (0.0.16) 
Installing rdiscount (1.6.8) with native extensions 
Using thor (0.14.6) 
Using keydown (0.7.0) from source at . 
Installing nokogiri (1.4.4) with native extensions 
Using bundler (1.0.15) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Rakefile があったので rake してみたり。

$ rake
  109/109:     100% |==================================================================================================================================| Time: 00:00:01

Finished in 1.31 seconds
109 examples, 0 failures
$

ええと、README.md なるファイルがあるみたいなのでフィルタしてみたのですが、正常動作してくれないなぁ。

その後

rvm の gemset をぶち壊してしまったことが判明。ぢーさん脳みそ弱くなってるんだから .rvmrc とかちゃんと設定しとけよな > 自分
ええと、gemset ステれば良いのかどうか。ヘルプが以下らしい。

$ rvm gemset --help

  Usage:

    rvm gemset [action]

  Action:

    {import,export,create,copy,rename,empty,delete,name,dir,list,list_all,gemdir,install,pristine,clear,use,update,unpack,globalcache}

  Description:

    Commands for working with and manipulating gemsets within RVM.

$

あるいは現存する gemset が以下か。

$ rvm gemset list

gemsets for ruby-1.9.2-p180 (found in /home/hoge/.rvm/gems/ruby-1.9.2-p180)
   global
=> rails3tutorial

$

とりあえず rails3tutorial ステて作り直せば良いのか。というか完全に gemset なるものの存在が忘却の彼方でした。

とりあえず

削除します。

$ rvm gemset delete rails3tutorial
WARN: Are you SURE you wish to remove the entire gemset directory 'rails3tutorial' (/home/rms/.rvm/gems/ruby-1.9.2-p180@rails3tutorial)?
(anything other than 'yes' will cancel) > yes
$ rvm gemset list

gemsets for ruby-1.9.2-p180 (found in /home/rms/.rvm/gems/ruby-1.9.2-p180)
   global

$

~/.rvm/gems 配下にも ruby-1.9.2-p180@rails3tutorial なるソレは消えてますね。で、もっかい作る。

$ rvm gemset create rails3tutorial
'rails3tutorial' gemset created (/home/rms/.rvm/gems/ruby-1.9.2-p180@rails3tutorial).
$ rvm gemset list

gemsets for ruby-1.9.2-p180 (found in /home/rms/.rvm/gems/ruby-1.9.2-p180)
   global
   rails3tutorial

$ rvm gemset use rails3tutorial
$ rvm gemset list

gemsets for ruby-1.9.2-p180 (found in /home/rms/.rvm/gems/ruby-1.9.2-p180)
   global
=> rails3tutorial

$

とりあえずこの状態で rails3tutorial なトコに行って bundle install か。いや、とりあえず、gem list しろとありますね。

$ gem list

*** LOCAL GEMS ***

rake (0.8.7)
$

むむ。gem update して gem install bundler とかすれば良い?

$ gem update
Updating installed gems
Updating rake
Fetching: rake-0.9.2.gem (100%)
Successfully installed rake-0.9.2
Gems updated: rake
Installing ri documentation for rake-0.9.2...
Installing RDoc documentation for rake-0.9.2...
$

う、なんか駄目っぽい。けど install は実行。

$ gem install bundler 
Fetching: bundler-1.0.18.gem (100%)
Successfully installed bundler-1.0.18
1 gem installed
Installing ri documentation for bundler-1.0.18...
Installing RDoc documentation for bundler-1.0.18...
$

ri とか RDoc とかorz
1.0.18 は大丈夫なのかな。で、以下で良いのかどうか。

$ bundle install --system
Fetching source index for http://rubygems.org/
Using rake (0.9.2) 
Installing abstract (1.0.0) WARNING: abstract-1.0.0 has an invalid nil value for @cert_chain

Installing activesupport (3.0.9) 
Installing builder (2.1.2) WARNING: builder-2.1.2 has an invalid nil value for @cert_chain

Installing i18n (0.5.0) 
Installing activemodel (3.0.9) 
Installing erubis (2.6.6) 
Installing rack (1.2.3) 
Installing rack-mount (0.6.14) 
Installing rack-test (0.5.7) 
Installing tzinfo (0.3.29) 
Installing actionpack (3.0.9) 
Installing mime-types (1.16) 
Installing polyglot (0.3.2) 
Installing treetop (1.4.10) 
Installing mail (2.2.19) 
Installing actionmailer (3.0.9) 
Installing arel (2.0.10) 
Installing activerecord (3.0.9) 
Installing activeresource (3.0.9) 
Using bundler (1.0.18) 
Installing rdoc (3.9.1) 
Installing thor (0.14.6) 
Installing railties (3.0.9) 
Installing rails (3.0.9) 
Installing sqlite3 (1.3.3) with native extensions 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
$

あ、カレントディレクトリ間違ってたし。移動して以下。

$ bundle install --system
Fetching source index for http://rubygems.org/
Using rake (0.9.2) 
Using abstract (1.0.0) 
Using activesupport (3.0.9) 
Using builder (2.1.2) 
Using i18n (0.5.0) 
Using activemodel (3.0.9) 
Using erubis (2.6.6) 
Using rack (1.2.3) 
Using rack-mount (0.6.14) 
Using rack-test (0.5.7) 
Using tzinfo (0.3.29) 
Using actionpack (3.0.9) 
Using mime-types (1.16) 
Using polyglot (0.3.2) 
Using treetop (1.4.10) 
Using mail (2.2.19) 
Using actionmailer (3.0.9) 
Using arel (2.0.10) 
Using activerecord (3.0.9) 
Using activeresource (3.0.9) 
Using bundler (1.0.18) 
Installing diff-lcs (1.1.2) 
Installing nokogiri (1.5.0) with native extensions 
Using rdoc (3.9.1) 
Using thor (0.14.6) 
Using railties (3.0.9) 
Using rails (3.0.9) 
Installing rspec-core (2.6.4) 
Installing rspec-expectations (2.6.0) 
Installing rspec-mocks (2.6.0) 
Installing rspec (2.6.0) 
Installing rspec-rails (2.6.1) 
Installing spork (0.9.0.rc8) 
Using sqlite3 (1.3.3) 
Installing webrat (0.7.1) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
$

rspec 入ってますな。試験実行してみます。

$ bundle exec rspec spec/
...............

Finished in 1.54 seconds
15 examples, 0 failures
$

やれやれ。後、.rvmrc というナニを作成して以下に。

rvm use ruby-1.8.7-p302@foo-app

ここ、絶対忘れるな。

keydown なソレを作成。

$ rvm gemset create keydown
'keydown' gemset created (/home/rms/.rvm/gems/ruby-1.9.2-p180@keydown).
$ rvm gemset list

gemsets for ruby-1.9.2-p180 (found in /home/rms/.rvm/gems/ruby-1.9.2-p180)
   global
   keydown
   rails3tutorial

$ rvm gemset use keydown
$ rvm gemset list

gemsets for ruby-1.9.2-p180 (found in /home/rms/.rvm/gems/ruby-1.9.2-p180)
   global
=> keydown
   rails3tutorial

$

で、これで gem update して gem install bundler すりゃ良いのか。

$ gem update
Updating installed gems
Updating rake
Fetching: rake-0.9.2.gem (100%)
Successfully installed rake-0.9.2
Gems updated: rake
Installing ri documentation for rake-0.9.2...
Installing RDoc documentation for rake-0.9.2...
$ gem install bundler
Fetching: bundler-1.0.18.gem (100%)
Successfully installed bundler-1.0.18
1 gem installed
Installing ri documentation for bundler-1.0.18...
Installing RDoc documentation for bundler-1.0.18...
$

で、bundle install --system するのか。

$ bundle install --system
Fetching source index for http://rubygems.org/
Installing chalofa_ruby-progressbar (0.0.9.1) 
Installing coderay (0.9.8) 
Installing diff-lcs (1.1.2) 
Installing rspec-core (2.5.1) 
Installing rspec-expectations (2.5.0) 
Installing rspec-mocks (2.5.0) 
Installing rspec (2.5.0) 
Installing rspec-instafail (0.1.7) 
Installing fuubar (0.0.4) 
Installing gem-release (0.0.16) 
Installing rdiscount (1.6.8) with native extensions 
Installing thor (0.14.6) 
Using keydown (0.7.0) from source at . 
Installing nokogiri (1.4.4) with native extensions 
Using bundler (1.0.18) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
$

あ、あと .rvmrc 作っとくか。

$ cat .rvmrc
rvm use ruby-1.9.2-p180@keydown
$

rake 実行。

$ rake
  109/109:     100% |==================================================================================================================================| Time: 00:00:01

Finished in 1.27 seconds
109 examples, 0 failures
$

で、keydown は動くのか、というとダメ。再度 rails 方面に去って試験実行してみましたが、一応正常動作を確認。試験は大丈夫なのだけれど、コマンド実行できない、ってどーゆー意味なんだろ。
そもそもエラーメセジが

no such file to load -- keydown (LoadError)

てなっててこれは一体どーゆーことかと。

結局

keydown はアキラメました。html5slides というデフォで Google なロゴが出ちゃう微妙なソリューションを選択。