1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

17 commits

Author SHA1 Message Date
Simo Leone
c5b71c9bae
include the content type when uploading to S3 2019-01-24 17:05:49 +00:00
Ryuta Kamizono
892e38c78e Enable Style/RedundantBegin cop to avoid newly adding redundant begin block
Currently we sometimes find a redundant begin block in code review
(e.g. https://github.com/rails/rails/pull/33604#discussion_r209784205).

I'd like to enable `Style/RedundantBegin` cop to avoid that, since
rescue/else/ensure are allowed inside do/end blocks in Ruby 2.5
(https://bugs.ruby-lang.org/issues/12906), so we'd probably meets with
that situation than before.
2018-12-21 06:12:42 +09:00
Marcelo Perini Veloso
ce40e85194
add require 'database/setup' in activestorage/test/service/s3_service_test.rb 2018-12-01 15:47:54 -02:00
Marcelo Perini Veloso
0d4ba40688 Fix zero-byte files upload 2018-09-06 20:04:21 -03:00
George Claghorn
56b9d0fd3a Generate a new key for each service test
Sidestep Google Cloud Storage's restrictive per-object rate limit.
2018-06-25 18:49:26 -04:00
Brian Knight
c1600009b2 Allow full use of the AWS S3 SDK authentication options (#32270)
If an explicit AWS key pair and/or region is not provided in
config/storage.yml, attempt to use environment variables, shared
credentials, or IAM role credentials. Order of precedence is
determined by the AWS SDK[1].

[1]: https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/setup-config.html
2018-03-19 15:25:40 +00:00
Andrew White
7dce840dee Allow S3 tests against buckets in other regions
Only us-east-1 gives URLs like bucket.s3.amazonaws.com whereas other
regions have URLs like s3-eu-west-1.amazonaws.com/ubxd-rails
2018-02-21 12:06:25 +00:00
George Claghorn
d30586211b Preview PDFs and videos 2017-09-28 16:43:37 -04:00
George Claghorn
332049d116 Fix tests 2017-08-20 18:45:39 -04:00
Koichi ITO
d02844f249 Use frozen string literal in Active Storage 2017-08-12 21:43:42 +09:00
yuuji.yaginuma
46db463d06 Fix ruby warnings
This fixes following warnings:

```
test/models/variant_test.rb:11: warning: ambiguous first argument; put parentheses or a space even after `/' operator
lib/active_storage/attached/macros.rb:63: warning: instance variable @active_storage_attached_highlights not initialized
lib/active_storage/attached/macros.rb:25: warning: instance variable @active_storage_attached_avatar not initialized
```
2017-08-05 12:22:39 +09:00
Claudio B
b9f0eb24ed Fix tests for AWS buckets that include a . (#30059)
If an AWS bucket name includes a `.` (e.g. `bucket.name`), then the canonical
URL for an object will start with "https://s3.amazonaws.com/bucket.name/"
and not with "https://bucket.name.s3.amazonaws.com/".

The URL tests have now been separated into two separate asserts, to ensure
that both the "s3.amazonaws.com" and the "bucket.name" components are included,
but not specifically in that order.
2017-08-04 17:56:14 -05:00
claudiob
9d636c9e2f Make Rubocop happier about ActiveStorage
Running `rubocop activestorage` before this commit resulted in 20 offenses.
This commit only fixes:

- Trailing whitespace detected
- Space inside } missing
- Put one space between the method name and the first argument.

The other offenses are left since they are intentional according to
@georgeclaghorn (https://github.com/rails/rails/pull/30061#issuecomment-319999190)
2017-08-03 11:43:08 -07:00
Ryuta Kamizono
815d1abf39 Fix Style/StringLiterals violations for Active Storage
```
% be rubocop -a --only Style/StringLiterals activestorage
Inspecting 74 files
........................................CCCCCCCCCC.C........CC.......C.C..

(snip)

74 files inspected, 31 offenses detected, 31 offenses corrected
```
2017-08-03 03:13:11 +09:00
David Heinemeier Hansson
ff3dad07ba Skip if credentials aren't provided 2017-08-01 17:22:20 -05:00
claudiob
98bb99ef61 Don't depend on HTTParty
"httparty" is only added in #30020 to write two tests to make PUT requests
against S3 and GCS.

The same requests can be made with net/http, removing a dependency from the Gemfile.
2017-08-01 10:56:39 -07:00
Rafael Mendonça França
9330d01ada Add 'activestorage/' from commit '3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58'
git-subtree-dir: activestorage
git-subtree-mainline: 0d58e7e478
git-subtree-split: 3f4a7218a4
2017-07-31 15:21:22 -04:00