native_ext_fetcher 0.1.1 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5900074441769b6286c0912b8b6ee114e7f38d55
4
- data.tar.gz: a4e9ac16a2158deb70a21c125b75c0d155d9665b
3
+ metadata.gz: b45a9c692ef2197ccea81a650abb56ccc69184cc
4
+ data.tar.gz: 3b99b8566a10af6f32bcb29c66d6cd6c1e112f3f
5
5
  SHA512:
6
- metadata.gz: 9ca720bcb2ae582ac942caf6b810c05d2cb61c44a48718f4591172dbb3a3030615095074c4bb8b67d9d257297b602ed1e7131dad7ecea0bd5edfcfbca228b91f
7
- data.tar.gz: eb2b6c72f45431cd120e942c2ce61bbbd2a2be2ef02d0126b8f5cbecaaddc3e6bcfcef45a42e4840ed1d5ee2d841052cfaa36a8c363d6c31aa75d3243b59d2be
6
+ metadata.gz: 848a2c36b96abc924e26310cdafeac5a9d8efade09e12545320a0f7a7b8e6493738ccb964948778d7b50e13f1494496e217a0a897f78b7261d742c2f8791dd96
7
+ data.tar.gz: e7e6f3078b8a8221dc95acc200c0ee3f5fe047f6fa242d11fdad89a25a9ba19c90cc1e5a3c68f7bfdefb27da1bbf9a7647b6dbb19adc16b7ec4f042569bd160b
@@ -1,6 +1,7 @@
1
1
  require 'fileutils'
2
2
 
3
3
  require 'native_ext_fetcher/version'
4
+ require 'native_ext_fetcher/error'
4
5
  require 'native_ext_fetcher/platform'
5
6
  require 'native_ext_fetcher/fetcher'
6
7
  require 'native_ext_fetcher/http'
@@ -0,0 +1,4 @@
1
+ module NativeExtFetcher
2
+ class Error < StandardError
3
+ end
4
+ end
@@ -1,11 +1,11 @@
1
1
  module NativeExtFetcher
2
2
  class Fetcher
3
- InvalidDigest = Class.new(StandardError)
3
+ InvalidDigest = Class.new(Error)
4
4
 
5
5
  attr_reader :download_path
6
6
 
7
- def config(host, path, checksums, options = {})
8
- @lib_path = File.expand_path(File.join(path, '..', '..', 'lib'))
7
+ def config(name, host, path, checksums, options = {})
8
+ @lib_path = File.expand_path(File.join(path, '..', '..', 'lib', name))
9
9
 
10
10
  raise ArgumentError, 'Checksums must be a hash' unless Hash === checksums
11
11
  raise ArgumentError, 'Library path not found ' unless Dir.exists?(@lib_path)
@@ -45,7 +45,7 @@ module NativeExtFetcher
45
45
  end
46
46
 
47
47
  def expand_download_path
48
- File.join(@lib_path, 'native', *Platform.native_extension_tuple).tap do |native_path|
48
+ File.join(@lib_path, 'native', Platform.native_extension_tuple.join('-')).tap do |native_path|
49
49
  FileUtils.mkdir_p native_path
50
50
  end
51
51
  end
@@ -8,8 +8,8 @@ module NativeExtFetcher
8
8
  MAX_REDIRECTS = 5
9
9
  MAX_RETRIES = 3
10
10
 
11
- MaxRedirect = Class.new(StandardError)
12
- MaxRetries = Class.new(StandardError)
11
+ MaxRedirect = Class.new(Error)
12
+ MaxRetries = Class.new(Error)
13
13
 
14
14
  def initialize(options = {})
15
15
  @max_redirects = options[:max_redirects] || MAX_REDIRECTS
@@ -81,7 +81,7 @@ module NativeExtFetcher
81
81
  end
82
82
 
83
83
  def self.native_extension_tuple
84
- [HOST_OS, HOST_ARCH]
84
+ [HOST_ARCH, HOST_OS]
85
85
  end
86
86
  end
87
87
  end
@@ -1,3 +1,3 @@
1
1
  module NativeExtFetcher
2
- VERSION = "0.1.1"
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: native_ext_fetcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - DefWare LLC
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-17 00:00:00.000000000 Z
11
+ date: 2016-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,6 +84,7 @@ files:
84
84
  - bin/console
85
85
  - bin/setup
86
86
  - lib/native_ext_fetcher.rb
87
+ - lib/native_ext_fetcher/error.rb
87
88
  - lib/native_ext_fetcher/fetcher.rb
88
89
  - lib/native_ext_fetcher/http.rb
89
90
  - lib/native_ext_fetcher/platform.rb