fileinfo 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/lib/file_info.rb +1 -1
- data/lib/file_info/version.rb +1 -1
- data/spec/file_info_spec.rb +3 -0
- data/spec/fixtures/one_byte.txt +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef15eb6d6152498892fa78fa6d4361e6c3d14932
|
4
|
+
data.tar.gz: 2313c820cbafacdb9c707966c1a0786554464627
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e885d126ade6f5f077b181b24bed9d316e236105a6b15dc22977d297d7f1363388ef4f75cdf7329b6f32b3672b54407d9c4040edc40c543c4f588d676eb3c1ec
|
7
|
+
data.tar.gz: 3415d0dfcfd593df5177a6a660fbc0f6b605b5607cb934a4e44f100cbeacf582b1425611758097c5b9d2c33fd0fe4c2cd7dd2cb4ece170da54e75c6e9e14e410
|
data/.travis.yml
CHANGED
data/lib/file_info.rb
CHANGED
data/lib/file_info/version.rb
CHANGED
data/spec/file_info_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe FileInfo do
|
4
|
+
let(:binary_file) { fixture('one_byte.txt') }
|
4
5
|
let(:ascii_file) { fixture('encoding_ascii.csv') }
|
5
6
|
let(:isolatin_file) { fixture('encoding_isolatin.csv') }
|
6
7
|
let(:isowindows_file) { fixture('encoding_isowindows.csv') }
|
@@ -12,6 +13,7 @@ describe FileInfo do
|
|
12
13
|
|
13
14
|
describe '#charset' do
|
14
15
|
it 'returns encoding string' do
|
16
|
+
expect(FileInfo.parse('h').charset).to eq 'binary'
|
15
17
|
expect(FileInfo.load(ascii_file.path).charset).to eq 'us-ascii'
|
16
18
|
expect(FileInfo.load(isolatin_file.path).charset).to eq 'iso-8859-1'
|
17
19
|
expect(FileInfo.load(isowindows_file.path).charset).to eq 'iso-8859-1'
|
@@ -21,6 +23,7 @@ describe FileInfo do
|
|
21
23
|
|
22
24
|
describe '#encoding' do
|
23
25
|
it 'returns Encoding instance' do
|
26
|
+
expect(FileInfo.load(binary_file.path).encoding).to eq Encoding::BINARY
|
24
27
|
expect(FileInfo.load(ascii_file.path).encoding).to eq Encoding::US_ASCII
|
25
28
|
expect(FileInfo.load(isolatin_file.path).encoding).to eq Encoding::ISO_8859_1
|
26
29
|
expect(FileInfo.load(isowindows_file.path).encoding).to eq Encoding::ISO_8859_1
|
@@ -0,0 +1 @@
|
|
1
|
+
H
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fileinfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafaël Blais Masson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- spec/fixtures/encoding_macroman.csv
|
94
94
|
- spec/fixtures/encoding_utf8.csv
|
95
95
|
- spec/fixtures/mockup.psd
|
96
|
+
- spec/fixtures/one_byte.txt
|
96
97
|
- spec/spec_helper.rb
|
97
98
|
homepage: http://github.com/rafBM/fileinfo
|
98
99
|
licenses:
|
@@ -128,4 +129,5 @@ test_files:
|
|
128
129
|
- spec/fixtures/encoding_macroman.csv
|
129
130
|
- spec/fixtures/encoding_utf8.csv
|
130
131
|
- spec/fixtures/mockup.psd
|
132
|
+
- spec/fixtures/one_byte.txt
|
131
133
|
- spec/spec_helper.rb
|