encoda 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.rdoc +19 -18
  2. data/VERSION +1 -1
  3. data/encoda.gemspec +1 -1
  4. data/lib/encoda.rb +1 -1
  5. metadata +1 -1
@@ -4,48 +4,49 @@ This is a simple file encoding converter
4
4
 
5
5
  == Installation
6
6
 
7
- sudo gem install Encoda
7
+ sudo gem install encoda
8
8
 
9
9
  == Getting Started
10
10
 
11
+
11
12
  ==== Single file conversion
12
13
 
13
14
  Encoda.convert do
14
- to_path 'convert/to/path'
15
- from_file 'path/to/your/file'
16
- from_encoding 'GB2312'
17
- to_encoding 'UTF8'
15
+ to_path 'convert/to/path'
16
+ from_file 'path/to/your/file'
17
+ from_encoding 'GB2312'
18
+ to_encoding 'UTF8'
18
19
  end
19
20
 
20
21
  ==== Multiple files conversion
21
22
 
22
- You can batch convert multiple files from a specific directory by specifying from_path
23
+ You can batch convert multiple files from a specific directory by specifying the from_path option
23
24
 
24
25
  Encoda.convert do
25
- from_path /from/path
26
- to_path /to/path
27
- to_encoding 'UTF8'
26
+ from_path /from/path
27
+ to_path /to/path
28
+ to_encoding 'UTF8'
28
29
  end
29
30
 
30
- If you specify from_path, it will alway do the batch conversion and ignore the from_path option.
31
+ If you specify from_path, it will alway do the batch conversion and ignore the from_file option.
31
32
 
32
33
  As you can see, if you omit the from_encoding option, the Encoda will try to guess the file's original encoding.
33
34
  The guessing feature is based on chardet library.
34
35
 
35
36
  ==== Retrieve the conversion result
36
37
 
37
- encoda = Encoda.convert do
38
- from_path /from/path
39
- to_path /to/path
40
- to_encoding 'UTF8'
41
- end
38
+ encoda = Encoda.convert do
39
+ from_path /from/path
40
+ to_path /to/path
41
+ to_encoding 'UTF8'
42
+ end
42
43
 
43
- puts encoda.failed #=> ['failed_file1.txt', 'failed_file2.txt']
44
- puts encoda.success #=> ['success_file1.txt', 'success_file3.txt, file4.srt']
44
+ puts encoda.failed #=> ['failed_file1.txt', 'failed_file2.txt']
45
+ puts encoda.success #=> ['success_file1.txt', 'success_file3.txt, file4.srt']
45
46
 
46
47
  == TODOs
47
48
 
48
- Refactoring!!!
49
+ Add more test and Refactoring!!!
49
50
 
50
51
  == Note on Patches/Pull Requests
51
52
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{encoda}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Zipme"]
@@ -1,4 +1,4 @@
1
- require 'rubygems'
1
+ # require 'rubygems'
2
2
  require 'UniversalDetector'
3
3
  require 'iconv'
4
4
  require 'ftools'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: encoda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zipme