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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7782a89c54218e1d5d7ae05c185feff459645059
4
- data.tar.gz: 349a375293e71197ac9bcb104d10abbb1f739295
3
+ metadata.gz: 20fb94530636afaa9932090894f728f7e9e74ba8
4
+ data.tar.gz: 0e14f99be807def5f87525454dc7358233988df5
5
5
  SHA512:
6
- metadata.gz: 3ac04b9924e66a97e0079fbcf1b24aa86a5a8b56b6dab6250199268671b08de00741efbf9717cbdb617857a7e159695eda3915d3db1398a6e354c147e09b003b
7
- data.tar.gz: 07d91952250199a5b5cb730d4cfbf4878a308c04acd5c1375a67396b1cdcf2c0103f2e19ba986b144c22b3cbe80f3d4944571982cb1af43e6e0f30e6d1bb1051
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 :json => @inventory_file }
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 Setting.uploaded_file.storage == :s3
7
+ if ENV['ENJU_STORAGE'] == 's3'
8
8
  has_attached_file :inventory, storage: :s3,
9
- s3_credentials: Setting.amazon,
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,
@@ -1,3 +1,3 @@
1
1
  module EnjuInventory
2
- VERSION = "0.1.11.pre11"
2
+ VERSION = "0.1.11.pre12"
3
3
  end
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.pre11
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-02-12 00:00:00.000000000 Z
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.pre40
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.pre40
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.rc17
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.rc17
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