solidus_product_attachments 0.0.5 → 0.0.7

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
- SHA1:
3
- metadata.gz: 80cc02a5360a349128560bfc8a7fb742e3f18051
4
- data.tar.gz: 36ba3e7e2e45ff76dad104f33f9152896b27637c
2
+ SHA256:
3
+ metadata.gz: a0932818f16b360d1e236aee75e547c0729902feb224057dbaed9d942606607a
4
+ data.tar.gz: 20d2eb504ea123cd5dd2282961a6e69a4519bef5bf6b51655fb67e59200ff2ce
5
5
  SHA512:
6
- metadata.gz: 13dc6e736815335271c75da5513cf1d8a061ff7b72d77ece199f15c18b0225fb3dbe311c29cffee6c11e52d4ff70532bf964f4b6ff645fb8d06c6e4ad01f6fd8
7
- data.tar.gz: 6f40d2cb9a434aeb58d1aa5cbfd408e002b1d4ae0e9336940370fe0bf06d3b3093e1a1ced4c514852e736b1abba587ee64fbfda07d60ff899e7f0f096eedb6e5
6
+ metadata.gz: 5e3b7a1a208419ed487dd176852d022a3e5f25455af98ec10382b9f69047fb07c85bfce5a5d611cc225a723a3c3c88493022d83bc11e52e10c70952348d264b8
7
+ data.tar.gz: fcc9cb99f3f9dabf5537209268fe7156301cd7a2e426194dacf1b473844e02b8781ece63da5466d98390264e4de4720cdc0fcb3544f7935423822039a7241a99
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2019 [name of plugin creator]
1
+ Copyright (c) 2024 Renuo AG
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Solidus Product Attachments
2
2
 
3
- This Solidus extension allows the administrator to upload PDF files to a product or to a variant.
3
+ This Solidus extension allows the administrator to upload files to a product or to a variant.
4
4
 
5
5
  [![Build Status](https://semaphoreci.com/api/v1/projects/c5f055f7-da80-440c-9f7b-c9c6c4a87bfa/2535219/shields_badge.svg)](https://semaphoreci.com/renuo/solidus_product_attachments)
6
6
  [![Gem Version](https://badge.fury.io/rb/solidus_product_attachments.svg)](https://badge.fury.io/rb/solidus_product_attachments)
@@ -66,9 +66,9 @@ bundle exec rake
66
66
  When testing your application's integration with this extension, you may use its factories. In order to do this, simply add this require statement to your spec_helper:
67
67
 
68
68
  ```ruby
69
- require 'solidus_product_attachments/factories'
69
+ require 'solidus_product_attachments/testing_support/factories'
70
70
  ```
71
71
 
72
72
  ## Copyright
73
73
 
74
- Copyright (c) 2019 [Renuo AG](https://www.renuo.ch/en), released under the New BSD License.
74
+ Copyright (c) 2024 [Renuo AG](https://www.renuo.ch/en), released under the New BSD License.
data/Rakefile CHANGED
@@ -28,5 +28,6 @@ end
28
28
  desc 'Generates a dummy app for testing'
29
29
  task :test_app do
30
30
  ENV['LIB_NAME'] = 'solidus_product_attachments'
31
+ ENV['DB'] = 'postgres'
31
32
  Rake::Task['extension:test_app'].invoke
32
33
  end
@@ -3,13 +3,14 @@ module Spree
3
3
  ATTACHMENT_ATTRIBUTES = %i[alt attachment_content_type attachment_file_name
4
4
  attachment_updated_at id position type].freeze
5
5
  PERMITTED_ATTACHMENT_ATTRIBUTES = %i[alt attachment position viewable_id viewable_type].freeze
6
+ ALLOWED_CONTENT_TYPES = %w[application/pdf text/plain].freeze
6
7
 
7
8
  has_attached_file :attachment,
8
9
  url: '/spree/attachments/:id/:basename.:extension',
9
- path: ':rails_root/public/spree/attachments/:id/:basename.:extension'
10
+ path: 'spree/attachments/:id/:basename.:extension'
10
11
 
11
12
  validate :no_attachment_errors
12
- validates_attachment :attachment, content_type: { content_type: 'application/pdf' }
13
+ validates_attachment :attachment, content_type: { content_type: ALLOWED_CONTENT_TYPES }
13
14
 
14
15
  def no_attachment_errors
15
16
  errors.add :attachment, "Paperclip returned errors for file #{attachment_file_name}" if attachment.errors.any?
@@ -3,5 +3,9 @@ require_relative '../support/assets'
3
3
  FactoryBot.define do
4
4
  factory :attachment, class: Spree::Attachment do
5
5
  attachment { fake_attachment }
6
+
7
+ trait :txt do
8
+ attachment { Rack::Test::UploadedFile.new(File.open('spec/fixtures/sample.txt')) }
9
+ end
6
10
  end
7
11
  end
@@ -1,3 +1,3 @@
1
1
  module SolidusProductAttachments
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_product_attachments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renuo AG
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-06 00:00:00.000000000 Z
11
+ date: 2024-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -193,19 +193,19 @@ dependencies:
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  - !ruby/object:Gem::Dependency
196
- name: sqlite3
196
+ name: pg
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - '='
199
+ - - ">="
200
200
  - !ruby/object:Gem::Version
201
- version: 1.3.9
201
+ version: '0'
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - '='
206
+ - - ">="
207
207
  - !ruby/object:Gem::Version
208
- version: 1.3.9
208
+ version: '0'
209
209
  description: A gem to attach files to a product / variant
210
210
  email: info@renuo.ch
211
211
  executables: []
@@ -256,7 +256,7 @@ homepage: https://www.renuo.ch
256
256
  licenses:
257
257
  - BSD-3-Clause
258
258
  metadata: {}
259
- post_install_message:
259
+ post_install_message:
260
260
  rdoc_options: []
261
261
  require_paths:
262
262
  - lib
@@ -271,9 +271,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
271
  - !ruby/object:Gem::Version
272
272
  version: '0'
273
273
  requirements: []
274
- rubyforge_project:
275
- rubygems_version: 2.6.13
276
- signing_key:
274
+ rubygems_version: 3.2.22
275
+ signing_key:
277
276
  specification_version: 4
278
277
  summary: A gem to attach files to a product
279
278
  test_files: []