neofiles 1.3.1 → 1.3.2

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: 8a4b7d590e143a25e9eddd62c3270e9d3c681983
4
- data.tar.gz: 94e6870230c940801d91acff9d3f6e6b2447a018
2
+ SHA256:
3
+ metadata.gz: 6ba1967358a294458fc392576803ec6077f407fffddb810a62306a9b1f2210c8
4
+ data.tar.gz: deca6eecbca33cf4cba1a10e526e1ca6f5317bccde69c2b4f0f375cc6e0fe4d2
5
5
  SHA512:
6
- metadata.gz: 8a75dcbc6d032ca8955779c66de0f973bd2ac9b97a9ff04a05678dde09dd0cb6cf6fb3d2a7eea11b83df1ecc576056b2cbaf3c6b8ea009cd28ef7dda413269b1
7
- data.tar.gz: ec5be21a1b53ff6b435a8a1e5b51b4ea0115eb8fb053304e3264491f2a05f7324769ae957e0488bedd91b6ea9a9614ea572ce1b638fa62b60daea439d9bbf7e2
6
+ metadata.gz: 6563c6d3a5a9b1df3e8e83e6c8a6f6972592766b862422799fb32b08dca00408d2b268bf3958b0826fc5225272610eea894006e5fbd1b1fe54338b6e0cb4c1c2
7
+ data.tar.gz: a8d71310a664db68c229a295537cee6d1b9caed2178156831e5ddb20e94315ab907e815db482932c3925399e51974ed9571c28cf3812f4e5a6466140727faa17
data/README.md CHANGED
@@ -407,6 +407,13 @@ end
407
407
  # picture when added is displayed on the right or left
408
408
  # also affects the order of displaying pictures
409
409
  config.neofiles.album_append_create_side = :left
410
+
411
+ # Amazon S3 settings
412
+ config.neofiles.amazon_s3_region = 'us-east'
413
+ config.neofiles.amazon_s3_api = 'KEY_ID'
414
+ config.neofiles.amazon_s3_secret = 'KEY_SECRET'
415
+ config.neofiles.amazon_s3_bucket = 'neofiles_prod'
416
+ config.neofiles.amazon_s3_endpoint = 'https://some-s3-provider.com' # optional
410
417
  ```
411
418
 
412
419
  Roadmap, TODOs
@@ -2,6 +2,7 @@
2
2
  # If you want to work with amazon s3 you need set values for the following parameters in your config file
3
3
  # amazon_s3_region - the AWS region to connect to. The region is used to construct the client endpoint.
4
4
  # amazon_s3_api, amazon_s3_secret - used to set credentials statically
5
+ # amazon_s3_endpoint - change if using another S3-compatible provider
5
6
  # bucket_name - storage name in amazon_s3. Bucket must have a name that conforms to the naming requirements for non-US Standard regions.
6
7
  # http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-s3-bucket-naming-requirements.html
7
8
  # File will be named as id of the Neofiles::File object
@@ -81,15 +82,23 @@ class Neofiles::DataStore::AmazonS3
81
82
  end
82
83
 
83
84
  def client
84
- @client ||= Aws::S3::Client.new(
85
- region: Rails.application.config.neofiles.amazon_s3_region,
86
- credentials: Aws::Credentials.new(
87
- Rails.application.config.neofiles.amazon_s3_api,
88
- Rails.application.config.neofiles.amazon_s3_secret
89
- )
90
- )
85
+ @client ||= Aws::S3::Client.new(client_params)
91
86
  rescue Aws::S3::Errors::ServiceError
92
87
  nil
93
88
  end
94
89
 
90
+ def client_params
91
+ {
92
+ region: Rails.application.config.neofiles.amazon_s3_region,
93
+ credentials: Aws::Credentials.new(
94
+ Rails.application.config.neofiles.amazon_s3_api,
95
+ Rails.application.config.neofiles.amazon_s3_secret
96
+ )
97
+ }.tap do |result|
98
+ if Rails.application.config.neofiles.amazon_s3_endpoint
99
+ result[:endpoint] = Rails.application.config.neofiles.amazon_s3_endpoint
100
+ end
101
+ end
102
+ end
103
+
95
104
  end
@@ -1,3 +1,3 @@
1
1
  module Neofiles
2
- VERSION = '1.3.1'
2
+ VERSION = '1.3.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neofiles
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konanykhin Ilya
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-09 00:00:00.000000000 Z
11
+ date: 2023-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -155,7 +155,7 @@ homepage: http://neoweb.kz
155
155
  licenses:
156
156
  - MIT
157
157
  metadata: {}
158
- post_install_message:
158
+ post_install_message:
159
159
  rdoc_options: []
160
160
  require_paths:
161
161
  - lib
@@ -170,9 +170,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  requirements: []
173
- rubyforge_project:
174
- rubygems_version: 2.6.12
175
- signing_key:
173
+ rubygems_version: 3.0.9
174
+ signing_key:
176
175
  specification_version: 4
177
176
  summary: Serves and manages files & images.
178
177
  test_files: []