blobsterix 0.0.10 → 0.0.11

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: 5377ce878e40d72b97327de2e0164016c87d09ae
4
- data.tar.gz: bb0e8f0e5beb71ab33092e119d8d579786ceda9c
3
+ metadata.gz: 5d6c5d8753eb7b819ab4fb8f8eda41051891141c
4
+ data.tar.gz: fafd4b138061ae869bc6c7f6fafd7efaf86a27f4
5
5
  SHA512:
6
- metadata.gz: 5399a5373e515cee0546bfd946f59ba2eaa3a2d4ef6da42e3c8d6f47307c9aa00af86d9ffc45f10076620d71f670dc0b73b0abe1de9436b772c7dff4fb62e3f7
7
- data.tar.gz: d72731cb475cb077adc0b45f8c36162c7b0ed0c9f8e04f6c91d0d9e81be8e5a610e4d4c1899c0d3f03c5b73c082c2dcff1c902d21196447fc48316f6df2ca60e
6
+ metadata.gz: bd9a45bf0dfbca62e2deccd780c5e24b919f46d4939669b2f0e5e9ac9ca7115d258a2934834cea4a608c356dea1156cf97792fc519f62a55c6657b31553cd870
7
+ data.tar.gz: c87a7318aef732db856b14381c95becae98181f217ddce68c1980abbfbf78f1a3f414996367eb7b46610bdcda3d5989c2d5674f8ca0e191d6b4b0e7bd3d3eb29
data/.travis.yml ADDED
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ script: "bundle exec rake spec"
3
+ rvm:
4
+ - 2.0.0
5
+ - 2.1.1
6
+ notifications:
7
+ recipients:
8
+ - peter.schrammel@experteer.com
9
+ branches:
10
+ only:
11
+ - master
12
+
data/CHANGELOG.txt CHANGED
@@ -1,3 +1,7 @@
1
+ = 0.0.11
2
+ * changed naming schemas of cached files and tmp files
3
+ * fixing x-send file
4
+ * fixing empty accept_type crashes
1
5
  = 0.0.10
2
6
  * Adding ruby dependency to gemfile
3
7
  = 0.0.9
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Blobsterix
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/blobsterix.png)](http://badge.fury.io/rb/blobsterix)
4
+ [![Build Status](https://travis-ci.org/experteer/blobsterix.svg?branch=master)](https://travis-ci.org/experteer/blobsterix)
5
+ [![Code Climate](https://codeclimate.com/github/experteer/blobsterix.png)](https://codeclimate.com/github/experteer/blobsterix)
3
6
 
4
7
  # What's this?
5
8
 
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env rake
2
2
  require "bundler/gem_tasks"
3
+ require 'rspec/core/rake_task'
3
4
 
4
5
 
5
6
  desc "Simple cov"
@@ -10,4 +11,10 @@ task :simplecov do
10
11
  end
11
12
  require "blobsterix"
12
13
  `rspec`
13
- end
14
+ end
15
+
16
+
17
+
18
+ RSpec::Core::RakeTask.new do |t|
19
+
20
+ end
data/blobsterix.gemspec CHANGED
@@ -2,11 +2,10 @@
2
2
  require File.expand_path('../lib/blobsterix/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
- gem.required_ruby_version = '>= 2.0.0.p451'
6
5
  gem.authors = ["Daniel Sudmann"]
7
6
  gem.email = ["suddani@googlemail.com"]
8
- gem.description = "BlobServer"
9
- gem.summary = "BlobServer"
7
+ gem.description = "Blobsterix is a transcoding, caching, storage server that can transform your blobs (images, pdf, ...) at request time."
8
+ gem.summary = "Blobsterix is a transcoding, caching, storage server."
10
9
  gem.homepage = "https://github.com/experteer/blobsterix"
11
10
  gem.license = "MIT License"
12
11
 
@@ -32,9 +31,11 @@ Gem::Specification.new do |gem|
32
31
  gem.add_dependency "ruby-webp", "~> 0.1.0"
33
32
  gem.add_dependency "mini_magick", "~> 3.5.0"
34
33
 
35
- gem.add_development_dependency "rspec"
34
+ gem.add_development_dependency "rake","~> 0.9.6"
35
+ gem.add_development_dependency "rspec", "~> 2.14.0"
36
36
  gem.add_development_dependency "rspec-core"
37
37
  gem.add_development_dependency "rspec-expectations"
38
38
  gem.add_development_dependency "rspec-mocks"
39
39
  gem.add_development_dependency "pry"
40
40
  end
41
+
@@ -45,10 +45,12 @@ module Blobsterix
45
45
  end
46
46
 
47
47
  def is? other_type
48
+ return false unless other_type
48
49
  mediatype === other_type.mediatype || mediatype === "*" || other_type.mediatype === "*"
49
50
  end
50
51
 
51
52
  def equal? other_type
53
+ return false unless other_type
52
54
  mediatype === other_type.mediatype and subtype === other_type.subtype# and factor == other_type.factor
53
55
  end
54
56
 
@@ -14,7 +14,7 @@ module Blobsterix
14
14
  if not meta.valid
15
15
  Http.NotFound()
16
16
  elsif xfile and etag != meta.etag
17
- [200, meta.header.merge({"X-Sendfile" => meta.path}), ""]
17
+ [200, meta.header.merge({"X-Sendfile" => meta.path.to_s}), ""]
18
18
  elsif etag != meta.etag
19
19
  if env != nil && meta.size > 30000 && allow_chunks
20
20
  chunkresponse
@@ -43,7 +43,8 @@ module Blobsterix
43
43
  else
44
44
  cache_path(blob_access).entries.each {|cache_file|
45
45
  unless cache_file.to_s.match(/\.meta$/) || cache_file.directory?
46
- FileSystemMetaData.new(cache_path(blob_access).join(cache_file)).delete if cache_file.to_s.match(blob_access.identifier)
46
+ base_name = cache_file.to_s.split("_")[0..1].join("_")
47
+ FileSystemMetaData.new(cache_path(blob_access).join(cache_file)).delete if base_name.match(cache_file_base(blob_access))
47
48
  end
48
49
  } if Dir.exist?(cache_path(blob_access))
49
50
  end
@@ -66,11 +67,19 @@ module Blobsterix
66
67
  end
67
68
 
68
69
  def cache_file_path(blob_access)
69
- cache_path(blob_access).join(blob_access.identifier)
70
+ cache_path(blob_access).join(cache_file_name(blob_access))
71
+ end
72
+
73
+ def cache_file_name(blob_access)
74
+ [cache_file_base(blob_access), Murmur.Hash64B(blob_access.identifier).to_s()].join("_")
75
+ end
76
+
77
+ def cache_file_base(blob_access)
78
+ "#{blob_access.bucket}_#{blob_access.id.gsub("/","_")}"
70
79
  end
71
80
 
72
81
  def cache_path(blob_access)
73
- @path.join(hash_filename("#{blob_access.bucket}_#{blob_access.id.gsub("/","_")}"))
82
+ @path.join(hash_filename(cache_file_base(blob_access)))
74
83
  end
75
84
 
76
85
  def hash_filename(filename)
@@ -63,7 +63,7 @@ module Blobsterix::Transformations
63
63
 
64
64
  def with_tempfiles
65
65
  tmpFiles = @transformations.size.times.map{|index|
66
- Tempfile.new("#{@blob_access.identifier}_#{index}")
66
+ Tempfile.new("blobsterix_#{Thread.current.object_id}_#{index}")
67
67
  }
68
68
  keys = tmpFiles.map{|f| f.path }
69
69
 
@@ -1,3 +1,3 @@
1
1
  module Blobsterix
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -2,9 +2,9 @@ module Blobsterix
2
2
 
3
3
  # # If this function is uncommented it should return an environment
4
4
  # # this env will override the one supplied from the command line
5
- # def self.env()
6
- # :development or :production or :test
7
- # end
5
+ def self.env()
6
+ :development # or :production or :test
7
+ end
8
8
 
9
9
  # # Use this method to set the port. (standard is 9000)
10
10
  # def self.port()
@@ -46,7 +46,7 @@ module Blobsterix
46
46
  # # For a different way check the environments files
47
47
  # # The return should be in format of: trafoName_value,trafoName_value,....
48
48
  # # Example: scale_2,rotate_20
49
- # def self.decrypt_trafo(trafo_string,logger)
49
+ # def self.decrypt_trafo(blobaccess, trafo_string, logger)
50
50
  # trafo_string
51
51
  # end
52
52
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blobsterix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Sudmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-10 00:00:00.000000000 Z
11
+ date: 2014-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -94,20 +94,34 @@ dependencies:
94
94
  - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: 3.5.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: 0.9.6
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: 0.9.6
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: rspec
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
- - - '>='
115
+ - - ~>
102
116
  - !ruby/object:Gem::Version
103
- version: '0'
117
+ version: 2.14.0
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
- - - '>='
122
+ - - ~>
109
123
  - !ruby/object:Gem::Version
110
- version: '0'
124
+ version: 2.14.0
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: rspec-core
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -164,7 +178,8 @@ dependencies:
164
178
  - - '>='
165
179
  - !ruby/object:Gem::Version
166
180
  version: '0'
167
- description: BlobServer
181
+ description: Blobsterix is a transcoding, caching, storage server that can transform
182
+ your blobs (images, pdf, ...) at request time.
168
183
  email:
169
184
  - suddani@googlemail.com
170
185
  executables:
@@ -173,6 +188,7 @@ extensions: []
173
188
  extra_rdoc_files: []
174
189
  files:
175
190
  - .gitignore
191
+ - .travis.yml
176
192
  - CHANGELOG.txt
177
193
  - Gemfile
178
194
  - LICENSE
@@ -277,7 +293,7 @@ rubyforge_project:
277
293
  rubygems_version: 2.0.14
278
294
  signing_key:
279
295
  specification_version: 4
280
- summary: BlobServer
296
+ summary: Blobsterix is a transcoding, caching, storage server.
281
297
  test_files:
282
298
  - spec/lib/blob/blob_api_spec.rb
283
299
  - spec/lib/helper/blob_access_spec.rb
@@ -287,3 +303,4 @@ test_files:
287
303
  - spec/lib/storage/cache_spec.rb
288
304
  - spec/lib/storage/file_system_spec.rb
289
305
  - spec/spec_helper.rb
306
+ has_rdoc: