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

Windows環境で動作しない #10

Closed
kskktk opened this issue Nov 7, 2015 · 10 comments
Closed

Windows環境で動作しない #10

kskktk opened this issue Nov 7, 2015 · 10 comments
Assignees
Labels

Comments

@kskktk
Copy link

kskktk commented Nov 7, 2015

起きたこと

コマンドプロンプト上で実行すると

エラー(1行目):改行コードを、「CR+LF」にあらためてください.
処理を停止します

と表示され、変換されない。
秀丸を用いて改行コードを調べるとCRLFになっている。

検証環境

OS : Windows7 Professional SP1
ruby : 2.2.3(http://rubyinstaller.org/downloads/ のインストーラを用いた)
青空注記ファイル:http://www.aozora.gr.jp/cards/000050/card48385.html
aozora2htmlはgemからインストールした

@kskktk kskktk added the bug label Nov 7, 2015
@takahashim takahashim self-assigned this Nov 7, 2015
@takahashim
Copy link
Contributor

うーん、そこで止まるんですね…ちょっと調べてみます

@takahashim
Copy link
Contributor

これってrake testの結果はわかりますか?

bundle install
bundle exec rake test

する必要があるかもです。

@kskktk
Copy link
Author

kskktk commented Nov 7, 2015

検証端末から離れてしまったのでちょっと今日のお返事は難しそうです。
週明けにはかならず!

@gennei
Copy link

gennei commented Nov 7, 2015

テスト実行してみました。
以下実行結果です。

Loaded suite C:/Ruby22-x64/lib/ruby/2.2.0/rake/rake_test_loader
Started
===============================================================================
Error: test_aozora2html_new(Aozora2HtmlTest): Errno::ENOTEMPTY: Directory not empty @ dir_s_rmdir - C:/Users/gennei/AppData/Local/Temp/d20151107-5044-jnfh39
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1444:in `rmdir'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1444:in `block in remove_dir1'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1458:in `platform_support'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1443:in `remove_dir1'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1436:in `remove'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:778:in `block in remove_entry'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1493:in `ensure in postorder_traverse'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1493:in `postorder_traverse'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:776:in `remove_entry'
C:/Ruby22-x64/lib/ruby/2.2.0/tmpdir.rb:94:in `mktmpdir'
C:/aozora2html/test/test_aozora2html.rb:12:in `test_aozora2html_new'
      9:   end
     10: 
     11:   def test_aozora2html_new
  => 12:     Dir.mktmpdir do |dir|
     13:       input = File.join(dir,'dummy.txt')
     14:       output = File.join(dir,'dummy2.txt')
     15:       File.write(input, "テスト\r\n")
===============================================================================
E
===============================================================================
Error: test_char_type(Aozora2HtmlTest): Errno::ENOTEMPTY: Directory not empty @ dir_s_rmdir - C:/Users/gennei/AppData/Local/Temp/d20151107-5044-1n5w7cs
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1444:in `rmdir'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1444:in `block in remove_dir1'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1458:in `platform_support'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1443:in `remove_dir1'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1436:in `remove'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:778:in `block in remove_entry'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1493:in `ensure in postorder_traverse'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1493:in `postorder_traverse'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:776:in `remove_entry'
C:/Ruby22-x64/lib/ruby/2.2.0/tmpdir.rb:94:in `mktmpdir'
C:/aozora2html/test/test_aozora2html.rb:61:in `test_char_type'
     58:   end
     59: 
     60:   def test_char_type
  => 61:     Dir.mktmpdir do |dir|
     62:       input = File.join(dir,'dummy.txt')
     63:       output = File.join(dir,'dummy2.txt')
     64:       File.write(input, "ab\r\nc\r\n")
===============================================================================
.E
===============================================================================
Error: test_read_line(Aozora2HtmlTest): Errno::ENOTEMPTY: Directory not empty @ dir_s_rmdir - C:/Users/gennei/AppData/Local/Temp/d20151107-5044-1m35uq4
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1444:in `rmdir'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1444:in `block in remove_dir1'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1458:in `platform_support'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1443:in `remove_dir1'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1436:in `remove'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:778:in `block in remove_entry'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1493:in `ensure in postorder_traverse'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1493:in `postorder_traverse'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:776:in `remove_entry'
C:/Ruby22-x64/lib/ruby/2.2.0/tmpdir.rb:94:in `mktmpdir'
C:/aozora2html/test/test_aozora2html.rb:49:in `test_read_line'
     46:   end
     47: 
     48:   def test_read_line
  => 49:     Dir.mktmpdir do |dir|
     50:       input = File.join(dir,'dummy.txt')
     51:       output = File.join(dir,'dummy2.txt')
     52:       File.write(input, "ab\r\nc\r\n")
===============================================================================
E
===============================================================================
Error: test_scount(Aozora2HtmlTest): Errno::ENOTEMPTY: Directory not empty @ dir_s_rmdir - C:/Users/gennei/AppData/Local/Temp/d20151107-5044-j2eaah
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1444:in `rmdir'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1444:in `block in remove_dir1'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1458:in `platform_support'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1443:in `remove_dir1'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1436:in `remove'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:778:in `block in remove_entry'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1493:in `ensure in postorder_traverse'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1493:in `postorder_traverse'
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:776:in `remove_entry'
C:/Ruby22-x64/lib/ruby/2.2.0/tmpdir.rb:94:in `mktmpdir'
C:/aozora2html/test/test_aozora2html.rb:23:in `test_scount'
     20:   end
     21: 
     22:   def test_scount
  => 23:     Dir.mktmpdir do |dir|
     24:       input = File.join(dir,'dummy.txt')
     25:       output = File.join(dir,'dummy2.txt')
     26:       File.write(input, "a\r\nb\r\nc\r\n")
===============================================================================
...............................................................

Finished in 0.074005 seconds.
------
68 tests, 153 assertions, 0 failures, 4 errors, 0 pendings, 0 omissions, 0 notifications
94.1176% passed
------
918.86 tests/s, 2067.43 assertions/s

テストで作成されているファイルは削除できていませんでした。
テストのファイルは改行コードがCR、文字コードがUTF-8でした。

@takahashim
Copy link
Contributor

@kskktk @gennei おお、どうもです!(ちょっと結果を見やすく書き換えました)

@takahashim
Copy link
Contributor

@gennei ちょっと修正してmasterにpushしてみたのですが、これでどうでしょうか?

@gennei
Copy link

gennei commented Nov 7, 2015

@takahashim テスト通りました。

@takahashim
Copy link
Contributor

👏 👏 👏

ではこれでリリースしますね。

@kskktk
Copy link
Author

kskktk commented Nov 7, 2015

👍

@takahashim
Copy link
Contributor

こちら閉じておきます

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

No branches or pull requests

3 participants