charlotte 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/charlotte +1 -1
- data/test/other/chardet.sh +2 -0
- data/test/other/charlock.sh +2 -0
- data/test/other/charlotte.sh +2 -0
- data/test/samples/8-BIT-NON-ISO-EXTENDED +45 -0
- data/test/samples/BINARY +0 -0
- data/test/samples/EMPTY +0 -0
- data/test/samples/ISO-8859-1 +43 -0
- data/test/samples/MacRoman +47 -0
- data/test/samples/TEXT-WITH-BINARY +0 -0
- data/test/samples/UTF-16BE +0 -0
- data/test/samples/UTF-16LE +0 -0
- data/test/samples/UTF-32BE +0 -0
- data/test/samples/UTF-32LE +0 -0
- data/test/samples/UTF-8 +48 -0
- data/test/samples/UTF-8-WITH-BOM +47 -0
- data/test/samples/utf-16be-file +0 -0
- data/test/samples/utf-16le-file +0 -0
- data/test/samples/utf-8-with-bom-file +2 -0
- metadata +21 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff389cc8403185a02af43180f937a237ba067359
|
4
|
+
data.tar.gz: ab349762b023a4456b4b04f4794d218bd06f9621
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af29dbe4041a757db953f777c7abf1a9707b957e638ad6e59ebc92296ccdb9f55ba5715b5f6b1f2846e9d332b0e3b79a42d488d2c7783381273c8279db48a306
|
7
|
+
data.tar.gz: e681b2a4f956237a45dd13d5adbf0b302b301012bbc699d4d5ada118a09fc1278005f48e5542cfb20fc72a6e395fb177a796b1add128e570e1ba0bdedefb9364
|
data/bin/charlotte
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
#!/usr/bin/env bash -x
|
2
|
-
time ruby -r "charlotte" -e "ARGV.each{|arg| puts arg; puts File.binread(arg).detect_encoding; puts ''}" -- $(find "$@" -type f)
|
2
|
+
time ruby -r "charlotte" -e "ARGV.each{|arg| puts arg; puts File.binread(arg).detect_encoding.to_s.gsub('ASCII-8BIT','BINARY'; puts ''}" -- $(find "$@" -type f)
|
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
# �ܡ���������
|
4
|
+
|
5
|
+
#SET_PATH - This line is a placeholder to ease patching this script.
|
6
|
+
|
7
|
+
# Instead of unsetting XZ_OPT, just make sure that xz will use file format
|
8
|
+
# autodetection. This way memory usage limit and thread limit can be
|
9
|
+
# specified via XZ_OPT.
|
10
|
+
xz='xz --format=auto'
|
11
|
+
|
12
|
+
version='xzless (XZ Utils) 5.1.4beta'
|
13
|
+
|
14
|
+
usage="Usage: ${0##*/} [OPTION]... [FILE]...
|
15
|
+
Like 'less', but operate on the uncompressed contents of xz compressed FILEs.
|
16
|
+
|
17
|
+
Options are the same as for 'less'.
|
18
|
+
|
19
|
+
Report bugs to <lasse.collin@tukaani.org>."
|
20
|
+
|
21
|
+
case $1 in
|
22
|
+
--help) echo "$usage" || exit 2; exit;;
|
23
|
+
--version) echo "$version" || exit 2; exit;;
|
24
|
+
esac
|
25
|
+
|
26
|
+
if test "${LESSMETACHARS+set}" != set; then
|
27
|
+
# Work around a bug in less 394 and earlier;
|
28
|
+
# it mishandles the metacharacters '$%=~'.
|
29
|
+
space=' '
|
30
|
+
tab=' '
|
31
|
+
nl='
|
32
|
+
'
|
33
|
+
LESSMETACHARS="$space$tab$nl'"';*?"()<>[|&^`#\$%=~'
|
34
|
+
fi
|
35
|
+
|
36
|
+
if test "$(less -V | { read less ver re && echo ${ver}; })" -ge 429; then
|
37
|
+
# less 429 or later: LESSOPEN pipe will be used on
|
38
|
+
# standard input if $LESSOPEN begins with |-.
|
39
|
+
LESSOPEN="|-$xz -cdfq -- %s"
|
40
|
+
else
|
41
|
+
LESSOPEN="|$xz -cdfq -- %s"
|
42
|
+
fi
|
43
|
+
export LESSMETACHARS LESSOPEN
|
44
|
+
|
45
|
+
exec less "$@"
|
data/test/samples/BINARY
ADDED
Binary file
|
data/test/samples/EMPTY
ADDED
File without changes
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#!/bin/sh �ܡ���
|
2
|
+
|
3
|
+
#SET_PATH - This line is a placeholder to ease patching this script.
|
4
|
+
|
5
|
+
# Instead of unsetting XZ_OPT, just make sure that xz will use file format
|
6
|
+
# autodetection. This way memory usage limit and thread limit can be
|
7
|
+
# specified via XZ_OPT.
|
8
|
+
xz='xz --format=auto'
|
9
|
+
|
10
|
+
version='xzless (XZ Utils) 5.1.4beta'
|
11
|
+
|
12
|
+
usage="Usage: ${0##*/} [OPTION]... [FILE]...
|
13
|
+
Like 'less', but operate on the uncompressed contents of xz compressed FILEs.
|
14
|
+
|
15
|
+
Options are the same as for 'less'.
|
16
|
+
|
17
|
+
Report bugs to <lasse.collin@tukaani.org>."
|
18
|
+
|
19
|
+
case $1 in
|
20
|
+
--help) echo "$usage" || exit 2; exit;;
|
21
|
+
--version) echo "$version" || exit 2; exit;;
|
22
|
+
esac
|
23
|
+
|
24
|
+
if test "${LESSMETACHARS+set}" != set; then
|
25
|
+
# Work around a bug in less 394 and earlier;
|
26
|
+
# it mishandles the metacharacters '$%=~'.
|
27
|
+
space=' '
|
28
|
+
tab=' '
|
29
|
+
nl='
|
30
|
+
'
|
31
|
+
LESSMETACHARS="$space$tab$nl'"';*?"()<>[|&^`#\$%=~'
|
32
|
+
fi
|
33
|
+
|
34
|
+
if test "$(less -V | { read less ver re && echo ${ver}; })" -ge 429; then
|
35
|
+
# less 429 or later: LESSOPEN pipe will be used on
|
36
|
+
# standard input if $LESSOPEN begins with |-.
|
37
|
+
LESSOPEN="|-$xz -cdfq -- %s"
|
38
|
+
else
|
39
|
+
LESSOPEN="|$xz -cdfq -- %s"
|
40
|
+
fi
|
41
|
+
export LESSMETACHARS LESSOPEN
|
42
|
+
|
43
|
+
exec less "$@"
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
# The original version for gzip was written by Paul Eggert.
|
4
|
+
# Modified for XZ Utils by Andrew Dudman and Lasse Collin.
|
5
|
+
# �ܡ���
|
6
|
+
|
7
|
+
#SET_PATH - This line is a placeholder to ease patching this script.
|
8
|
+
|
9
|
+
# Instead of unsetting XZ_OPT, just make sure that xz will use file format
|
10
|
+
# autodetection. This way memory usage limit and thread limit can be
|
11
|
+
# specified via XZ_OPT.
|
12
|
+
xz='xz --format=auto'
|
13
|
+
|
14
|
+
version='xzless (XZ Utils) 5.1.4beta'
|
15
|
+
|
16
|
+
usage="Usage: ${0##*/} [OPTION]... [FILE]...
|
17
|
+
Like 'less', but operate on the uncompressed contents of xz compressed FILEs.
|
18
|
+
|
19
|
+
Options are the same as for 'less'.
|
20
|
+
|
21
|
+
Report bugs to <lasse.collin@tukaani.org>."
|
22
|
+
|
23
|
+
case $1 in
|
24
|
+
--help) echo "$usage" || exit 2; exit;;
|
25
|
+
--version) echo "$version" || exit 2; exit;;
|
26
|
+
esac
|
27
|
+
|
28
|
+
if test "${LESSMETACHARS+set}" != set; then
|
29
|
+
# Work around a bug in less 394 and earlier;
|
30
|
+
# it mishandles the metacharacters '$%=~'.
|
31
|
+
space=' '
|
32
|
+
tab=' '
|
33
|
+
nl='
|
34
|
+
'
|
35
|
+
LESSMETACHARS="$space$tab$nl'"';*?"()<>[|&^`#\$%=~'
|
36
|
+
fi
|
37
|
+
|
38
|
+
if test "$(less -V | { read less ver re && echo ${ver}; })" -ge 429; then
|
39
|
+
# less 429 or later: LESSOPEN pipe will be used on
|
40
|
+
# standard input if $LESSOPEN begins with |-.
|
41
|
+
LESSOPEN="|-$xz -cdfq -- %s"
|
42
|
+
else
|
43
|
+
LESSOPEN="|$xz -cdfq -- %s"
|
44
|
+
fi
|
45
|
+
export LESSMETACHARS LESSOPEN
|
46
|
+
|
47
|
+
exec less "$@"
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/test/samples/UTF-8
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
# Copyright (C) 1998, 2002, 2006, 2007 Free Software Foundation
|
4
|
+
|
5
|
+
# ‚‹°›€‡ß
|
6
|
+
|
7
|
+
|
8
|
+
#SET_PATH - This line is a placeholder to ease patching this script.
|
9
|
+
|
10
|
+
# Instead of unsetting XZ_OPT, just make sure that xz will use file format
|
11
|
+
# autodetection. This way memory usage limit and thread limit can be
|
12
|
+
# specified via XZ_OPT.
|
13
|
+
xz='xz --format=auto'
|
14
|
+
|
15
|
+
version='xzless (XZ Utils) 5.1.4beta'
|
16
|
+
|
17
|
+
usage="Usage: ${0##*/} [OPTION]... [FILE]...
|
18
|
+
Like 'less', but operate on the uncompressed contents of xz compressed FILEs.
|
19
|
+
|
20
|
+
Options are the same as for 'less'.
|
21
|
+
|
22
|
+
Report bugs to <lasse.collin@tukaani.org>."
|
23
|
+
|
24
|
+
case $1 in
|
25
|
+
--help) echo "$usage" || exit 2; exit;;
|
26
|
+
--version) echo "$version" || exit 2; exit;;
|
27
|
+
esac
|
28
|
+
|
29
|
+
if test "${LESSMETACHARS+set}" != set; then
|
30
|
+
# Work around a bug in less 394 and earlier;
|
31
|
+
# it mishandles the metacharacters '$%=~'.
|
32
|
+
space=' '
|
33
|
+
tab=' '
|
34
|
+
nl='
|
35
|
+
'
|
36
|
+
LESSMETACHARS="$space$tab$nl'"';*?"()<>[|&^`#\$%=~'
|
37
|
+
fi
|
38
|
+
|
39
|
+
if test "$(less -V | { read less ver re && echo ${ver}; })" -ge 429; then
|
40
|
+
# less 429 or later: LESSOPEN pipe will be used on
|
41
|
+
# standard input if $LESSOPEN begins with |-.
|
42
|
+
LESSOPEN="|-$xz -cdfq -- %s"
|
43
|
+
else
|
44
|
+
LESSOPEN="|$xz -cdfq -- %s"
|
45
|
+
fi
|
46
|
+
export LESSMETACHARS LESSOPEN
|
47
|
+
|
48
|
+
exec less "$@"
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
# The original version for gzip was written by Paul Eggert.
|
4
|
+
# Modified for XZ Utils by Andrew Dudman and Lasse Collin.
|
5
|
+
# ‚‹°›€‡ß
|
6
|
+
|
7
|
+
#SET_PATH - This line is a placeholder to ease patching this script.
|
8
|
+
|
9
|
+
# Instead of unsetting XZ_OPT, just make sure that xz will use file format
|
10
|
+
# autodetection. This way memory usage limit and thread limit can be
|
11
|
+
# specified via XZ_OPT.
|
12
|
+
xz='xz --format=auto'
|
13
|
+
|
14
|
+
version='xzless (XZ Utils) 5.1.4beta'
|
15
|
+
|
16
|
+
usage="Usage: ${0##*/} [OPTION]... [FILE]...
|
17
|
+
Like 'less', but operate on the uncompressed contents of xz compressed FILEs.
|
18
|
+
|
19
|
+
Options are the same as for 'less'.
|
20
|
+
|
21
|
+
Report bugs to <lasse.collin@tukaani.org>."
|
22
|
+
|
23
|
+
case $1 in
|
24
|
+
--help) echo "$usage" || exit 2; exit;;
|
25
|
+
--version) echo "$version" || exit 2; exit;;
|
26
|
+
esac
|
27
|
+
|
28
|
+
if test "${LESSMETACHARS+set}" != set; then
|
29
|
+
# Work around a bug in less 394 and earlier;
|
30
|
+
# it mishandles the metacharacters '$%=~'.
|
31
|
+
space=' '
|
32
|
+
tab=' '
|
33
|
+
nl='
|
34
|
+
'
|
35
|
+
LESSMETACHARS="$space$tab$nl'"';*?"()<>[|&^`#\$%=~'
|
36
|
+
fi
|
37
|
+
|
38
|
+
if test "$(less -V | { read less ver re && echo ${ver}; })" -ge 429; then
|
39
|
+
# less 429 or later: LESSOPEN pipe will be used on
|
40
|
+
# standard input if $LESSOPEN begins with |-.
|
41
|
+
LESSOPEN="|-$xz -cdfq -- %s"
|
42
|
+
else
|
43
|
+
LESSOPEN="|$xz -cdfq -- %s"
|
44
|
+
fi
|
45
|
+
export LESSMETACHARS LESSOPEN
|
46
|
+
|
47
|
+
exec less "$@"
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: charlotte
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoff Nixon
|
@@ -14,12 +14,31 @@ description: A simple (but fast!) character set encoding/binary detector and aut
|
|
14
14
|
for common encodings (UTF-8/16/32, ISO-8859-1, MacRoman, etc.). Extends String with
|
15
15
|
String.detect_encoding, String.autoencode.
|
16
16
|
email: geoff@geoff.codes
|
17
|
-
executables:
|
17
|
+
executables:
|
18
|
+
- charlotte
|
18
19
|
extensions: []
|
19
20
|
extra_rdoc_files: []
|
20
21
|
files:
|
21
22
|
- bin/charlotte
|
22
23
|
- lib/charlotte.rb
|
24
|
+
- test/other/chardet.sh
|
25
|
+
- test/other/charlock.sh
|
26
|
+
- test/other/charlotte.sh
|
27
|
+
- test/samples/8-BIT-NON-ISO-EXTENDED
|
28
|
+
- test/samples/BINARY
|
29
|
+
- test/samples/EMPTY
|
30
|
+
- test/samples/ISO-8859-1
|
31
|
+
- test/samples/MacRoman
|
32
|
+
- test/samples/TEXT-WITH-BINARY
|
33
|
+
- test/samples/UTF-16BE
|
34
|
+
- test/samples/UTF-16LE
|
35
|
+
- test/samples/UTF-32BE
|
36
|
+
- test/samples/UTF-32LE
|
37
|
+
- test/samples/UTF-8
|
38
|
+
- test/samples/UTF-8-WITH-BOM
|
39
|
+
- test/samples/utf-16be-file
|
40
|
+
- test/samples/utf-16le-file
|
41
|
+
- test/samples/utf-8-with-bom-file
|
23
42
|
homepage: https://github.com/geoff-codes/charlotte
|
24
43
|
licenses:
|
25
44
|
- MIT
|