enju_inventory 0.1.11.pre11 → 0.1.11.pre12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/inventory_files_controller.rb +15 -1
- data/app/models/inventory_file.rb +6 -2
- data/lib/enju_inventory/version.rb +1 -1
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20fb94530636afaa9932090894f728f7e9e74ba8
|
4
|
+
data.tar.gz: 0e14f99be807def5f87525454dc7358233988df5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdc92c92fec4346fcdeefb6e40d2ce48c933d9d3bd01a4f46992843a2c945bf94ac0d9b846d32e1dc37dc5a21567d078ce2b65674625b5c1d9554bc5febe8a25
|
7
|
+
data.tar.gz: 04db104bb5ec2257804d10f54de446a690769ef63553ece77326b4c4a09ae093ea24ccd4b3a83c54790c04f3c358caa6fc811da75a0cb5817da80c5410f7ff15
|
@@ -15,9 +15,23 @@ class InventoryFilesController < ApplicationController
|
|
15
15
|
# GET /inventory_files/1
|
16
16
|
# GET /inventory_files/1.json
|
17
17
|
def show
|
18
|
+
if @inventory_file.inventory.path
|
19
|
+
unless ENV['ENJU_STORAGE'] == 's3'
|
20
|
+
file = @inventory_file.inventory.path
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
18
24
|
respond_to do |format|
|
19
25
|
format.html # show.html.erb
|
20
|
-
format.json { render :
|
26
|
+
format.json { render json: @inventory_file }
|
27
|
+
format.download {
|
28
|
+
if ENV['ENJU_STORAGE'] == 's3'
|
29
|
+
send_data Faraday.get(@inventory_file.inventory.expiring_url).body.force_encoding('UTF-8'),
|
30
|
+
filename: File.basename(@inventory_file.inventory_file_name), type: 'application/octet-stream'
|
31
|
+
else
|
32
|
+
send_file file, filename: @inventory_file.inventory_file_name, type: 'application/octet-stream'
|
33
|
+
end
|
34
|
+
}
|
21
35
|
end
|
22
36
|
end
|
23
37
|
|
@@ -4,9 +4,13 @@ class InventoryFile < ActiveRecord::Base
|
|
4
4
|
belongs_to :user
|
5
5
|
validates_presence_of :user
|
6
6
|
|
7
|
-
if
|
7
|
+
if ENV['ENJU_STORAGE'] == 's3'
|
8
8
|
has_attached_file :inventory, storage: :s3,
|
9
|
-
s3_credentials:
|
9
|
+
s3_credentials: {
|
10
|
+
access_key: ENV['AWS_ACCESS_KEY_ID'],
|
11
|
+
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
|
12
|
+
bucket: ENV['S3_BUCKET_NAME']
|
13
|
+
},
|
10
14
|
s3_permissions: :private
|
11
15
|
else
|
12
16
|
has_attached_file :inventory,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_inventory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.11.
|
4
|
+
version: 0.1.11.pre12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kosuke Tanabe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: enju_library
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.0.
|
19
|
+
version: 0.1.0.pre41
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.0.
|
26
|
+
version: 0.1.0.pre41
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: paperclip
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.1.0.
|
117
|
+
version: 1.1.0.rc18
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.1.0.
|
124
|
+
version: 1.1.0.rc18
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: simplecov
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: appraisal
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
153
167
|
description: Inventory management for Next-L Enju
|
154
168
|
email:
|
155
169
|
- nabeta@fastmail.fm
|