fileinfo 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/README.md +5 -1
- data/fileinfo.gemspec +2 -2
- data/lib/file_info/version.rb +1 -1
- data/spec/file_info_spec.rb +4 -4
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c124025418981cc96ac44d4ac28578f467525090
|
4
|
+
data.tar.gz: 9b5f75376d8a00a164008d56509050890fcf1c2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0312736c47f08456871bc0388f8256357a0f0d02b8f51b8aa53d32ffef8f071668c6109e45d8ada4c074c0b99e6de91913fd25d87aa9d7d8591e6d9fba297836
|
7
|
+
data.tar.gz: 30af589caf9862fb79ddba612938fe10af64c13dfeec55d54af9b65b01cd7ffee9171ed85621ae1c11a1bddd57e2abd91380809d50a70a257055ec6216ca6029
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# FileInfo
|
2
2
|
|
3
|
-
FileInfo
|
3
|
+
FileInfo detects encoding from strings and files using the [wonderful Unix `file` command](http://en.wikipedia.org/wiki/File_\(command\)).
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -45,3 +45,7 @@ FileInfo.load(filename).encoding # => #<Encoding:ISO-8859-1>
|
|
45
45
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
46
46
|
4. Push to the branch (`git push origin my-new-feature`)
|
47
47
|
5. Create new Pull Request
|
48
|
+
|
49
|
+
---
|
50
|
+
|
51
|
+
© 2013 [Rafaël Blais Masson](http://heliom.ca). FileInfo is released under the MIT license.
|
data/fileinfo.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = FileInfo::VERSION
|
9
9
|
spec.authors = ['Rafaël Blais Masson']
|
10
10
|
spec.email = ['rafael@heliom.ca']
|
11
|
-
spec.description = "FileInfo
|
12
|
-
spec.summary = "FileInfo
|
11
|
+
spec.description = "FileInfo detects encoding from strings and files using the wonderful Unix `file` command."
|
12
|
+
spec.summary = "FileInfo detects encoding from strings and files using the wonderful Unix `file` command."
|
13
13
|
spec.homepage = 'http://github.com/rafBM/fileinfo'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
data/lib/file_info/version.rb
CHANGED
data/spec/file_info_spec.rb
CHANGED
@@ -7,14 +7,14 @@ describe FileInfo do
|
|
7
7
|
let(:utf8_file) { fixture('encoding_utf8.csv') }
|
8
8
|
|
9
9
|
describe '.load' do
|
10
|
-
it '
|
10
|
+
it 'detects encoding from file' do
|
11
11
|
expect(FileInfo.load(ascii_file.path).encoding).to eq Encoding::US_ASCII
|
12
12
|
expect(FileInfo.load(isolatin_file.path).encoding).to eq Encoding::ISO_8859_1
|
13
13
|
expect(FileInfo.load(isowindows_file.path).encoding).to eq Encoding::ISO_8859_1
|
14
14
|
expect(FileInfo.load(utf8_file.path).encoding).to eq Encoding::UTF_8
|
15
15
|
end
|
16
16
|
|
17
|
-
it '
|
17
|
+
it 'detects encoding from file with space in filename' do
|
18
18
|
old_filename = fixture('encoding_utf8.csv').path
|
19
19
|
new_filename = old_filename.sub('_', ' ')
|
20
20
|
FileUtils.cp(old_filename, new_filename)
|
@@ -24,7 +24,7 @@ describe FileInfo do
|
|
24
24
|
FileUtils.rm(new_filename)
|
25
25
|
end
|
26
26
|
|
27
|
-
it '
|
27
|
+
it 'detects encoding from file with space and quote in filename' do
|
28
28
|
old_filename = fixture('encoding_utf8.csv').path
|
29
29
|
new_filename = old_filename.sub('_', ' " ')
|
30
30
|
FileUtils.cp(old_filename, new_filename)
|
@@ -40,7 +40,7 @@ describe FileInfo do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
describe '.parse' do
|
43
|
-
it '
|
43
|
+
it 'detects encoding from string' do
|
44
44
|
expect(FileInfo.parse(ascii_file.read).encoding).to eq Encoding::US_ASCII
|
45
45
|
expect(FileInfo.parse(isolatin_file.read).encoding).to eq Encoding::ISO_8859_1
|
46
46
|
expect(FileInfo.parse(isowindows_file.read).encoding).to eq Encoding::ISO_8859_1
|
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.1.
|
4
|
+
version: 0.1.1
|
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: 2013-09-
|
11
|
+
date: 2013-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.14'
|
55
|
-
description: FileInfo
|
55
|
+
description: FileInfo detects encoding from strings and files using the wonderful
|
56
56
|
Unix `file` command.
|
57
57
|
email:
|
58
58
|
- rafael@heliom.ca
|
@@ -62,6 +62,7 @@ extra_rdoc_files: []
|
|
62
62
|
files:
|
63
63
|
- .gitignore
|
64
64
|
- .rspec
|
65
|
+
- .travis.yml
|
65
66
|
- Gemfile
|
66
67
|
- LICENSE.txt
|
67
68
|
- README.md
|
@@ -99,7 +100,7 @@ rubyforge_project:
|
|
99
100
|
rubygems_version: 2.0.3
|
100
101
|
signing_key:
|
101
102
|
specification_version: 4
|
102
|
-
summary: FileInfo
|
103
|
+
summary: FileInfo detects encoding from strings and files using the wonderful Unix
|
103
104
|
`file` command.
|
104
105
|
test_files:
|
105
106
|
- spec/file_info_spec.rb
|