neofiles 2.1.0 → 2.1.1

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: 608e65d64271a321dce00fe990fb86a05c118ec7
4
- data.tar.gz: 36c66a96f2bd63d7da9dc8698ee1284906092a3c
2
+ SHA256:
3
+ metadata.gz: c990b0639f2c8783d0c511266ecc7bc5df9eaff856f171c08b33648a372ba8c0
4
+ data.tar.gz: 77177e83d421a156bf2e62e67ee408df101d3db971ce41df8b5053fa6a91a2c5
5
5
  SHA512:
6
- metadata.gz: 5c55f27849fa99522b073b2b8c6f7573474a59f8183598498939a3da173ce3a09816f6d5ff3acbb39bbdcf7189f0d673ae3825fb7052dd72fb39fbbefb3ca0bc
7
- data.tar.gz: 384333a60af7019ec2a048feb27acafa38229b32af22b4c4c81f4723c4e7e0625b83013ba0bef299224c14591fab4fbb3dfd20ffd231c5d610a6b46c9c8e50ec
6
+ metadata.gz: c58b69ec97b11ef6957470b49e229c89af3c26c286bd9161daec5ee05e77d2067541de311dc09135be62b394f7772860868323f04e3b3d758bbbd81b18958d51
7
+ data.tar.gz: 3357f8319fa3db3df89ca947968c24a59cd74b1e4d03ea938b73369932617c6ab6881bb6c56ab90e68c3e1523bd73611ae4221dbde33084965fcecd4c8ec3604
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 = '2.1.0'
2
+ VERSION = '2.1.1'
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: 2.1.0
4
+ version: 2.1.1
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: 2019-05-08 00:00:00.000000000 Z
11
+ date: 2021-12-28 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: []