charlock_holmes 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- charlock_holmes (0.6.6)
4
+ charlock_holmes (0.6.7)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/README.md CHANGED
@@ -70,7 +70,7 @@ Being able to detect the encoding of some arbitrary content is nice, but what yo
70
70
  ``` ruby
71
71
  content = File.read('test2.txt')
72
72
  detection = CharlockHolmes::EncodingDetector.detect(content)
73
- utf8_encoded_content CharlockHolmes::Converter.convert content, detection[:encoding], 'UTF-8'
73
+ utf8_encoded_content = CharlockHolmes::Converter.convert content, detection[:encoding], 'UTF-8'
74
74
  ```
75
75
 
76
76
  The first parameter is the content to transcode, the second is the source encoding (the encoding the content is assumed to be in), and the third parameter is the destination encoding.
@@ -17,6 +17,38 @@ if `which make`.strip.empty?
17
17
  exit(1)
18
18
  end
19
19
 
20
+ ##
21
+ # ICU dependency
22
+ #
23
+
24
+ dir_config 'icu'
25
+
26
+ # detect homebrew installs
27
+ if !have_library 'icui18n'
28
+ base = if !`which brew`.empty?
29
+ `brew --prefix`.strip
30
+ elsif File.exists?("/usr/local/Cellar/icu4c")
31
+ '/usr/local/Cellar'
32
+ end
33
+
34
+ if base and icu4c = Dir[File.join(base, 'Cellar/icu4c/*')].sort.last
35
+ $INCFLAGS << " -I#{icu4c}/include "
36
+ $LDFLAGS << " -L#{icu4c}/lib "
37
+ end
38
+ end
39
+
40
+ unless have_library 'icui18n' and have_header 'unicode/ucnv.h'
41
+ STDERR.puts "\n\n"
42
+ STDERR.puts "***************************************************************************************"
43
+ STDERR.puts "*********** icu required (brew install icu4c or apt-get install libicu-dev) ***********"
44
+ STDERR.puts "***************************************************************************************"
45
+ exit(1)
46
+ end
47
+
48
+ ##
49
+ # libmagic dependency
50
+ #
51
+
20
52
  src = File.basename('file-5.08.tar.gz')
21
53
  dir = File.basename(src, '.tar.gz')
22
54
 
@@ -33,18 +65,19 @@ end
33
65
 
34
66
  FileUtils.cp "#{CWD}/dst/lib/libmagic.a", "#{CWD}/libmagic_ext.a"
35
67
 
36
- $INCFLAGS[0,0] = "-I#{CWD}/dst/include "
37
- $LDFLAGS << " -L#{CWD}"
68
+ $INCFLAGS[0,0] = " -I#{CWD}/dst/include "
69
+ $LDFLAGS << " -L#{CWD} "
70
+
71
+ dir_config 'magic'
72
+ unless have_library 'magic_ext' and have_header 'magic.h'
73
+ STDERR.puts "\n\n"
74
+ STDERR.puts "***************************************************************************************"
75
+ STDERR.puts "********* error compiling and linking libmagic. please report issue on github *********"
76
+ STDERR.puts "***************************************************************************************"
77
+ exit(1)
78
+ end
38
79
 
39
80
  $CFLAGS << ' -Wall -funroll-loops'
40
81
  $CFLAGS << ' -Wextra -O0 -ggdb3' if ENV['DEBUG']
41
82
 
42
- dir_config 'icu'
43
- $CFLAGS << ' -I/usr/local/Cellar/icu4c/4.4.1/include'
44
- $LDFLAGS << ' -L/usr/local/Cellar/icu4c/4.4.1/lib'
45
- have_library 'icui18n'
46
-
47
- dir_config 'magic'
48
- have_library 'magic_ext'
49
-
50
83
  create_makefile 'charlock_holmes'
@@ -1,3 +1,3 @@
1
1
  module CharlockHolmes
2
- VERSION = "0.6.6"
2
+ VERSION = "0.6.7"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: charlock_holmes
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 6
10
- version: 0.6.6
9
+ - 7
10
+ version: 0.6.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Lopez
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-09-01 00:00:00 -07:00
19
+ date: 2011-09-07 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency