Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maker 80行あたりでfile[:path]などがnilになっていてエラーになっているみたいです #4

Closed
aburafia opened this issue Oct 23, 2010 · 2 comments

Comments

@aburafia
Copy link

始めまして。epubに興味があり、rubyにも興味があったので
このソースでrubyを勉強させてもらっています。

macのruby 1.8.7とbuilderを入れた環境でexample/simple_epub.rbを実行すると

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1407:in fu_each_src_dest0': undefined methodto_str' for nil:NilClass (NoMethodError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1393:in fu_each_src_dest' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:382:incp'
from ./../lib/eeepub/maker.rb:80:in save' from ./../lib/eeepub/maker.rb:78:ineach'
from ./../lib/eeepub/maker.rb:78:in save' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/tmpdir.rb:129:inmktmpdir'
from ./../lib/eeepub/maker.rb:77:in `save'
from simple_epub.rb:23

となりました。中のソースを見てみると、ただ単なる文字列である[file]という変数なのに、
file[:dir]やfile[:path]とアクセスしていて、その結果がnilになるのが原因のようでした。

これは僕の環境が悪く、パスのような文字列だと何もせずに連想配列のようにアクセスできるものなのでしょうか?

それともサンプルのバージョンが間違っていて、いまではfilesで配列を渡すようになっているのでしょうか?

@jugyo
Copy link
Owner

jugyo commented Oct 23, 2010

add spec. Closed by ffbd8ef

@jugyo
Copy link
Owner

jugyo commented Oct 23, 2010

バグ報告ありがとうございます!
ちょっとした経緯により files の指定の仕方を変えたんですよね。
その対応が中途半端だったために example が動かなくなっていました。
修正しましたのでご確認いただければと思います。

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants