jackal-assets 0.1.2 → 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: 36e961c75794a2675f8614633df07b0a36296bb0
4
- data.tar.gz: 53b634197b5337c6d11e4804e26faeb066f36f40
3
+ metadata.gz: a4bc8c0c49326a4b8e56be79342274f4de88b84e
4
+ data.tar.gz: f78f2fe8b037cbddc97011537447a2e8a7c68b00
5
5
  SHA512:
6
- metadata.gz: 717a32e002651c49e00a96c04c44c1691697374392a845e5b26b6fc1abf8ca709a230c5b0554d79a45ce2ac1829aa6ca3f08a1bc9de29902e76143589266f30e
7
- data.tar.gz: 8d9816ce192fa881118c0a80d370ae71fb6ea4a359ab01b7f527ea68da9aa3a84737fff46014d0536e41ee144edb7b823154cec61e4a33dbfb89bbf39e8772e8
6
+ metadata.gz: 314035b18ea541805b5cba2f342ff7dfea4d40563dd56d45ff0fc78153d44f2ee93178f366a9abf7eb601d36098e82dda81640f37f2068831614646bb6af44dd
7
+ data.tar.gz: 2e97f9fdd7d9b7929610d369fa4393155df9719c52cdc9f2deb15621988f00dc0d047cbb249c4a7a7b03073949f97612365c4e1dbdd17be20d07cbefc4cf6652
@@ -1,3 +1,8 @@
1
+ # v0.1.4
2
+ * Fix remote asset to avoid streaming issues
3
+ * Prevent EOF errors when reading to end of file on java
4
+ * Always enable binmode on temp files
5
+
1
6
  # v0.1.2
2
7
  * Include support for packing and unpacking assets
3
8
  * Return proper IO-ish object from #get
@@ -10,9 +10,10 @@ Gem::Specification.new do |s|
10
10
  s.description = 'Jackal Assets'
11
11
  s.license = 'Apache 2.0'
12
12
  s.require_path = 'lib'
13
- s.add_dependency 'jackal'
14
- s.add_dependency 'miasma'
15
- s.add_dependency 'miasma-local'
16
- s.add_dependency 'rubyzip'
13
+ s.add_runtime_dependency 'jackal'
14
+ s.add_runtime_dependency 'miasma'
15
+ s.add_runtime_dependency 'miasma-local'
16
+ s.add_runtime_dependency 'rubyzip'
17
+ s.add_runtime_dependency 'bogo', '> 0.1.14'
17
18
  s.files = Dir['{lib}/**/**/*'] + %w(jackal-assets.gemspec README.md CHANGELOG.md)
18
19
  end
@@ -1,5 +1,6 @@
1
1
  require 'miasma'
2
2
  require 'miasma-local'
3
+ require 'bogo'
3
4
 
4
5
  module Jackal
5
6
  # Asset storage helper
@@ -1,4 +1,5 @@
1
1
  require 'jackal-assets'
2
+ require 'tempfile'
2
3
  require 'zip'
3
4
 
4
5
  module Jackal
@@ -61,7 +62,22 @@ module Jackal
61
62
  def get(key)
62
63
  remote_file = bucket.files.reload.get(key)
63
64
  if(remote_file)
64
- remote_file.body.io
65
+ io = remote_file.body.io
66
+ if(io.respond_to?(:path))
67
+ io
68
+ else
69
+ e_file = Bogo::EphemeralFile.new('jackal-asset')
70
+ e_file.binmode
71
+ begin
72
+ while(data = io.readpartial(2048))
73
+ e_file.write data
74
+ end
75
+ rescue EOFError
76
+ end
77
+ e_file.flush
78
+ e_file.rewind
79
+ e_file
80
+ end
65
81
  else
66
82
  raise Error::NotFound.new "Remote file does not exist! (<#{bucket}>:#{key})"
67
83
  end
@@ -1,6 +1,6 @@
1
1
  module Jackal
2
2
  module Assets
3
3
  # Current library version
4
- VERSION = Gem::Version.new('0.1.2')
4
+ VERSION = Gem::Version.new('0.1.4')
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jackal-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-04 00:00:00.000000000 Z
11
+ date: 2015-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jackal
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bogo
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.1.14
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.1.14
69
83
  description: Jackal Assets
70
84
  email: code@chrisroberts.org
71
85
  executables: []