gitlabhq / grit

Grit gives you object oriented read/write access to Git repositories via Ruby. Patched for GitLab
gitlab.org
MIT License
59 stars 55 forks source link

Update mime-types to 2.4.3 #49

Closed nirnanaaa closed 9 years ago

nirnanaaa commented 9 years ago

Hello,

for Rails support (>=4.2.0) it would be nice if mime-types could be upgraded to version 2.4.3. It works like a charm except one minor issue with binary encoding?!

Bundler could not find compatible versions for gem "mime-types":
  In Gemfile:
    gollum_rails (~> 1.6.5) ruby depends on
      gollum-lib (~> 4.0.1) ruby depends on
        gollum-grit_adapter (>= 0.1.1, ~> 0.1) ruby depends on
          gitlab-grit (>= 2.7.1, ~> 2.7) ruby depends on
            mime-types (~> 1.15) ruby

    rails (= 4.2.0) ruby depends on
      actionmailer (= 4.2.0) ruby depends on
        mail (>= 2.5.4, ~> 2.5) ruby depends on
          mime-types (2.4.3)

Test fails at:

[ 49/215] TestEncoding#test_binary_message = 0.00 s
  1) Failure:
TestEncoding#test_binary_message [/home/fkasper/files/grit/test/test_encoding.rb:15]:
<"ASCII-8BIT"> expected but was
<"UTF-8">.
katafrakt commented 9 years ago

+1

katafrakt commented 9 years ago

Ok, I did some more testing. Here is output of tests with master version:

# Running tests:

[ 49/215] TestEncoding#test_binary_message = 0.00 s                                          
  1) Failure:
TestEncoding#test_binary_message [/home/katafrakt/dev/github/grit/test/test_encoding.rb:14]:
<[45,
 45,
 98,
 114,
 111,
 107,
 101,
 110,
 32,
 101,
 110,
 99,
 111,
 100,
 105,
 110,
 103,
 58,
 32,
 85,
 84,
 70,
 45,
 49,
 54,
 66,
 69]> expected but was
<[255, 216, 255, 224]>.

[ 50/215] TestEncoding#test_encode_string = 0.00 s         
  2) Failure:
TestEncoding#test_encode_string [/home/katafrakt/dev/github/grit/test/test_encoding.rb:33]:
<"\uCED2\uB0AE\uC4E3"> expected but was
<"我爱你">.

[ 51/215] TestEncoding#test_invalid_encoding = 0.00 s     
  3) Failure:
TestEncoding#test_invalid_encoding [/home/katafrakt/dev/github/grit/test/test_encoding.rb:20]:
<"--broken encoding: UTF-16BE"> expected but was
<"yummy 🍔 ">.

Finished tests in 0.979023s, 219.6068 tests/s, 562.8063 assertions/s.                     
215 tests, 551 assertions, 3 failures, 0 errors, 0 skips

And here it is after upgrading mime-types to 2.4.3:

# Running tests:

[ 49/215] TestEncoding#test_binary_message = 0.00 s                                          
  1) Failure:
TestEncoding#test_binary_message [/home/katafrakt/dev/github/grit/test/test_encoding.rb:15]:
<"ASCII-8BIT"> expected but was
<"UTF-8">.

[ 50/215] TestEncoding#test_encode_string = 0.04 s         
  2) Failure:
TestEncoding#test_encode_string [/home/katafrakt/dev/github/grit/test/test_encoding.rb:33]:
<"\uCED2\uB0AE\uC4E3"> expected but was
<"我爱你">.

[ 51/215] TestEncoding#test_invalid_encoding = 0.00 s     
  3) Failure:
TestEncoding#test_invalid_encoding [/home/katafrakt/dev/github/grit/test/test_encoding.rb:20]:
<"--broken encoding: UTF-16BE"> expected but was
<"yummy 🍔 ">.

Finished tests in 1.105781s, 194.4326 tests/s, 499.1945 assertions/s.                     
215 tests, 552 assertions, 3 failures, 0 errors, 0 skips

So I figure those failures are totally unrelated to mime-types gem, as after update there is actually a progress with a first test (it fails one assertion later). I'm using ruby 2.1.5, anyway.

rgroux commented 9 years ago

@nirnanaaa @katafrakt

i think you can close this issue, because the PR #53 update the gem spec file and use at least mime-types 2.6.0

axilleas commented 9 years ago

thanks for reporting @rgroux