wit 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b224113043d484906a84261fd22cca9abac165b1
4
- data.tar.gz: 8c697b188ff6fcca0c9f62371238a6ca4b0e5ab8
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MzY1NWI4ODFiMzhkMTNhMzA4NjEwYTQ3MDQwOGI4MjMwNWViYjE1Mw==
5
+ data.tar.gz: !binary |-
6
+ OTRjZTg4MGVhYWJkYzUzNTZkMTFhNDc0NzE3ZDA4ZGM1MjJlYmMyNw==
5
7
  SHA512:
6
- metadata.gz: dd77147261f79371e9258587f41e552d7064915222aee67cab07a740ac77e1779e5af0e3e816d9f53df2d1a3933fc1b2ec3e3019cbc4a3f5a5d765992c1af8c4
7
- data.tar.gz: ef6bc521dd4125843229557c791252378e16be510efd1d7b194bf81f21d0770d663016c7a67cbd41b38219514a20683c3feed0abf2671eeb056171ad0e52b53b
8
+ metadata.gz: !binary |-
9
+ NDQ3MjgwMjQ3YmViMGRlMTY4OGVlMTVmMmRkZTkwZTE1ODdjNDExYWIyMjkw
10
+ YTc5YzVjODc3NTk4MDNlMjkyM2IwN2QyNjk3ZDg3Y2M1ZWI0MjFhZDg3ZTUx
11
+ OWEyYTNiZmM0YzA0ODFiNTAzMDZlZDhmYmE4NjczYmE2MWJmYmM=
12
+ data.tar.gz: !binary |-
13
+ MWZkZGI0Y2Q4NjQ0OTZjOTZlZTNkMjg0YzYyYjgyYWU1Yzc2ODg1ZmIxMDVm
14
+ NGFlNDQxNzU1ZDI5OGY3MzkwMGYzNzVjYmQ0ZjExODA2ZWFlYmI0OTU3MTky
15
+ MzU5N2RlYTIwMDNhNGI2YjZiNGFjNDcyNjQzZjc3NzNiNGFiODY=
data/ext/wit/extconf.rb CHANGED
@@ -1,38 +1,68 @@
1
1
  require "mkmf"
2
+ require 'open-uri'
3
+ require 'fileutils'
2
4
 
3
5
  PATH = File.expand_path(File.dirname(__FILE__))
4
6
 
5
7
  LIBDIR = RbConfig::CONFIG['libdir']
6
8
  INCLUDEDIR = RbConfig::CONFIG['includedir']
7
9
  HEADER_DIRS = [
8
- PATH + '/libwit/include',
10
+ "#{PATH}/libwit/include",
9
11
  INCLUDEDIR
10
12
  ]
11
13
  LIB_DIRS = [
12
- PATH + '/libwit/lib',
14
+ "#{PATH}/libwit/lib",
13
15
  LIBDIR
14
16
  ]
15
17
 
16
- if RUBY_PLATFORM.include? "arm"
17
- LIBWIT_FILE = "libwit-armv6.a"
18
- elsif RUBY_PLATFORM.include? "64"
19
- if RUBY_PLATFORM.include? "darwin"
20
- LIBWIT_FILE = "libwit-64-darwin.a"
18
+ if RUBY_PLATFORM.include? 'arm'
19
+ LIBWIT_FILE = 'libwit-armv6.a'
20
+ elsif RUBY_PLATFORM.include? '64'
21
+ if RUBY_PLATFORM.include? 'darwin'
22
+ LIBWIT_FILE = 'libwit-64-darwin.a'
21
23
  else
22
- LIBWIT_FILE = "libwit-64-linux.a"
24
+ LIBWIT_FILE = 'libwit-64-linux.a'
23
25
  end
24
26
  else
25
- LIBWIT_FILE = "libwit-32-linux.a"
27
+ LIBWIT_FILE = 'libwit-32-linux.a'
26
28
  end
27
- abort "unable to retrieve libwit" unless system('curl -o libwit.a https://raw.githubusercontent.com/wit-ai/libwit/master/releases/' + LIBWIT_FILE, :chdir=> PATH + '/libwit/lib')
29
+ LIBWIT_PATH = "#{PATH}/libwit/lib/libwit.a"
28
30
 
29
- $LOCAL_LIBS = '-lwit -lsox -lcurl'
31
+ if !File.file?(LIBWIT_PATH)
32
+ puts "Fetching libwit..."
33
+ dir = File.dirname(LIBWIT_PATH)
34
+ unless File.directory?(dir)
35
+ FileUtils.mkdir_p(dir)
36
+ end
37
+ open(LIBWIT_PATH, 'wb') do |file|
38
+ total = nil
39
+ file << open("https://github.com/wit-ai/libwit/releases/download/1.1.2/#{LIBWIT_FILE}",
40
+ :content_length_proc => lambda {|t|
41
+ total = t
42
+ print "0/#{total} bytes downloaded"
43
+ STDOUT.flush
44
+ },
45
+ :progress_proc => lambda {|s|
46
+ print "\r#{s}/#{total} bytes downloaded"
47
+ STDOUT.flush
48
+ }).read
49
+ end
50
+ STDOUT.print(" done\n")
51
+ end
52
+
53
+ if RUBY_PLATFORM.include? 'darwin'
54
+ libs = ['wit', 'ssl', 'crypto', 'z', 'sox', 'System', 'pthread', 'c', 'm']
55
+ else
56
+ libs = ['wit', 'rt', 'sox', 'ssl', 'crypto', 'dl', 'pthread', 'rt', 'gcc_s', 'pthread', 'c', 'm']
57
+ end
58
+
59
+ $LOCAL_LIBS = '-l' + libs.join(' -l')
30
60
 
31
61
  dir_config 'wit', HEADER_DIRS, LIB_DIRS
32
62
 
33
- abort "missing sox" unless have_library "sox"
34
- abort "missing curl" unless have_library "curl"
35
- abort "missing wit.h" unless have_header "wit.h"
36
- abort "missing libwit" unless have_library "wit"
63
+ for lib in libs
64
+ abort "Error: missing #{lib}" unless have_library lib
65
+ end
66
+ abort 'Error: missing wit.h' unless have_header 'wit.h'
37
67
 
38
- create_makefile "wit"
68
+ create_makefile 'wit'
@@ -0,0 +1,39 @@
1
+ require "mkmf"
2
+
3
+ PATH = File.expand_path(File.dirname(__FILE__))
4
+
5
+ LIBDIR = RbConfig::CONFIG['libdir']
6
+ INCLUDEDIR = RbConfig::CONFIG['includedir']
7
+ HEADER_DIRS = [
8
+ PATH + '/libwit/include',
9
+ INCLUDEDIR
10
+ ]
11
+ LIB_DIRS = [
12
+ PATH + '/libwit/lib',
13
+ LIBDIR
14
+ ]
15
+
16
+ if RUBY_PLATFORM.include? "arm"
17
+ LIBWIT_FILE = "libwit-armv6.a"
18
+ elsif RUBY_PLATFORM.include? "64"
19
+ if RUBY_PLATFORM.include? "darwin"
20
+ LIBWIT_FILE = "libwit-64-darwin.a"
21
+ else
22
+ LIBWIT_FILE = "libwit-64-linux.a"
23
+ end
24
+ else
25
+ LIBWIT_FILE = "libwit-32-linux.a"
26
+ end
27
+
28
+ abort "unable to retrieve libwit" unless system('curl -Ss -L -o libwit.a https://github.com/wit-ai/libwit/releases/download/1.1.1/' + LIBWIT_FILE, :chdir=> PATH + '/libwit/lib')
29
+
30
+ $LOCAL_LIBS = '-lwit -lsox -lcurl'
31
+
32
+ dir_config 'wit', HEADER_DIRS, LIB_DIRS
33
+
34
+ abort "missing sox" unless have_library "sox"
35
+ abort "missing curl" unless have_library "curl"
36
+ abort "missing wit.h" unless have_header "wit.h"
37
+ abort "missing libwit" unless have_library "wit"
38
+
39
+ create_makefile "wit"
data/ext/wit/wit.c CHANGED
@@ -1,5 +1,4 @@
1
1
  #include <ruby.h>
2
- #include <ruby/thread.h>
3
2
  #include "wit.h"
4
3
 
5
4
  struct wit_context *context;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Odent
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-03 00:00:00.000000000 Z
11
+ date: 2014-12-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby SDK for Wit.AI
14
14
  email: julien@wit.ai
@@ -18,12 +18,12 @@ extensions:
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - ext/wit/extconf.rb
21
+ - ext/wit/extconf.rb_
21
22
  - ext/wit/libwit/include/wit.h
22
- - ext/wit/libwit/lib/libwit.a
23
23
  - ext/wit/wit.c
24
24
  homepage: http://wit.ai
25
25
  licenses:
26
- - EPL-1.0
26
+ - GPL-2.0
27
27
  metadata: {}
28
28
  post_install_message:
29
29
  rdoc_options: []
@@ -31,17 +31,17 @@ require_paths:
31
31
  - lib
32
32
  required_ruby_version: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - ">="
34
+ - - ! '>='
35
35
  - !ruby/object:Gem::Version
36
- version: 2.0.0
36
+ version: 1.9.3
37
37
  required_rubygems_version: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - ! '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  requirements: []
43
43
  rubyforge_project:
44
- rubygems_version: 2.4.2
44
+ rubygems_version: 2.2.2
45
45
  signing_key:
46
46
  specification_version: 4
47
47
  summary: Ruby SDK for Wit
File without changes