Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
d02844f2
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d02844f2
编写于
8月 12, 2017
作者:
K
Koichi ITO
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use frozen string literal in Active Storage
上级
98360a96
变更
75
隐藏空白更改
内联
并排
Showing
75 changed file
with
149 addition
and
4 deletion
+149
-4
.rubocop.yml
.rubocop.yml
+1
-0
activestorage/Rakefile
activestorage/Rakefile
+2
-0
activestorage/app/controllers/active_storage/blobs_controller.rb
...torage/app/controllers/active_storage/blobs_controller.rb
+2
-0
activestorage/app/controllers/active_storage/direct_uploads_controller.rb
...p/controllers/active_storage/direct_uploads_controller.rb
+2
-0
activestorage/app/controllers/active_storage/disk_controller.rb
...storage/app/controllers/active_storage/disk_controller.rb
+2
-0
activestorage/app/controllers/active_storage/variants_controller.rb
...age/app/controllers/active_storage/variants_controller.rb
+2
-0
activestorage/app/jobs/active_storage/purge_job.rb
activestorage/app/jobs/active_storage/purge_job.rb
+2
-0
activestorage/app/models/active_storage/attachment.rb
activestorage/app/models/active_storage/attachment.rb
+2
-0
activestorage/app/models/active_storage/blob.rb
activestorage/app/models/active_storage/blob.rb
+2
-0
activestorage/app/models/active_storage/filename.rb
activestorage/app/models/active_storage/filename.rb
+2
-0
activestorage/app/models/active_storage/variant.rb
activestorage/app/models/active_storage/variant.rb
+2
-0
activestorage/app/models/active_storage/variation.rb
activestorage/app/models/active_storage/variation.rb
+2
-0
activestorage/config/routes.rb
activestorage/config/routes.rb
+2
-0
activestorage/db/migrate/20170806125915_create_active_storage_tables.rb
...db/migrate/20170806125915_create_active_storage_tables.rb
+2
-0
activestorage/lib/active_storage.rb
activestorage/lib/active_storage.rb
+2
-0
activestorage/lib/active_storage/attached.rb
activestorage/lib/active_storage/attached.rb
+2
-0
activestorage/lib/active_storage/attached/macros.rb
activestorage/lib/active_storage/attached/macros.rb
+2
-0
activestorage/lib/active_storage/attached/many.rb
activestorage/lib/active_storage/attached/many.rb
+2
-0
activestorage/lib/active_storage/attached/one.rb
activestorage/lib/active_storage/attached/one.rb
+2
-0
activestorage/lib/active_storage/gem_version.rb
activestorage/lib/active_storage/gem_version.rb
+2
-0
activestorage/lib/active_storage/log_subscriber.rb
activestorage/lib/active_storage/log_subscriber.rb
+3
-1
activestorage/lib/active_storage/service.rb
activestorage/lib/active_storage/service.rb
+2
-0
activestorage/lib/active_storage/service/azure_storage_service.rb
...orage/lib/active_storage/service/azure_storage_service.rb
+2
-0
activestorage/lib/active_storage/service/configurator.rb
activestorage/lib/active_storage/service/configurator.rb
+2
-0
activestorage/lib/active_storage/service/disk_service.rb
activestorage/lib/active_storage/service/disk_service.rb
+2
-0
activestorage/lib/active_storage/service/gcs_service.rb
activestorage/lib/active_storage/service/gcs_service.rb
+2
-0
activestorage/lib/active_storage/service/mirror_service.rb
activestorage/lib/active_storage/service/mirror_service.rb
+2
-0
activestorage/lib/active_storage/service/s3_service.rb
activestorage/lib/active_storage/service/s3_service.rb
+2
-0
activestorage/lib/active_storage/version.rb
activestorage/lib/active_storage/version.rb
+2
-0
activestorage/lib/tasks/activestorage.rake
activestorage/lib/tasks/activestorage.rake
+2
-0
activestorage/test/controllers/blobs_controller_test.rb
activestorage/test/controllers/blobs_controller_test.rb
+2
-0
activestorage/test/controllers/direct_uploads_controller_test.rb
...torage/test/controllers/direct_uploads_controller_test.rb
+2
-0
activestorage/test/controllers/disk_controller_test.rb
activestorage/test/controllers/disk_controller_test.rb
+2
-0
activestorage/test/controllers/variants_controller_test.rb
activestorage/test/controllers/variants_controller_test.rb
+2
-0
activestorage/test/database/create_users_migration.rb
activestorage/test/database/create_users_migration.rb
+2
-0
activestorage/test/database/setup.rb
activestorage/test/database/setup.rb
+2
-0
activestorage/test/dummy/Rakefile
activestorage/test/dummy/Rakefile
+2
-0
activestorage/test/dummy/app/controllers/application_controller.rb
...rage/test/dummy/app/controllers/application_controller.rb
+2
-0
activestorage/test/dummy/app/helpers/application_helper.rb
activestorage/test/dummy/app/helpers/application_helper.rb
+2
-0
activestorage/test/dummy/app/jobs/application_job.rb
activestorage/test/dummy/app/jobs/application_job.rb
+2
-0
activestorage/test/dummy/app/models/application_record.rb
activestorage/test/dummy/app/models/application_record.rb
+2
-0
activestorage/test/dummy/bin/bundle
activestorage/test/dummy/bin/bundle
+2
-0
activestorage/test/dummy/bin/rails
activestorage/test/dummy/bin/rails
+2
-0
activestorage/test/dummy/bin/rake
activestorage/test/dummy/bin/rake
+2
-0
activestorage/test/dummy/bin/yarn
activestorage/test/dummy/bin/yarn
+2
-0
activestorage/test/dummy/config.ru
activestorage/test/dummy/config.ru
+2
-0
activestorage/test/dummy/config/application.rb
activestorage/test/dummy/config/application.rb
+2
-0
activestorage/test/dummy/config/boot.rb
activestorage/test/dummy/config/boot.rb
+2
-0
activestorage/test/dummy/config/environment.rb
activestorage/test/dummy/config/environment.rb
+2
-0
activestorage/test/dummy/config/environments/development.rb
activestorage/test/dummy/config/environments/development.rb
+2
-0
activestorage/test/dummy/config/environments/production.rb
activestorage/test/dummy/config/environments/production.rb
+2
-0
activestorage/test/dummy/config/environments/test.rb
activestorage/test/dummy/config/environments/test.rb
+2
-0
activestorage/test/dummy/config/initializers/application_controller_renderer.rb
...my/config/initializers/application_controller_renderer.rb
+1
-0
activestorage/test/dummy/config/initializers/assets.rb
activestorage/test/dummy/config/initializers/assets.rb
+2
-0
activestorage/test/dummy/config/initializers/backtrace_silencers.rb
...age/test/dummy/config/initializers/backtrace_silencers.rb
+1
-0
activestorage/test/dummy/config/initializers/cookies_serializer.rb
...rage/test/dummy/config/initializers/cookies_serializer.rb
+2
-0
activestorage/test/dummy/config/initializers/filter_parameter_logging.rb
...est/dummy/config/initializers/filter_parameter_logging.rb
+2
-0
activestorage/test/dummy/config/initializers/inflections.rb
activestorage/test/dummy/config/initializers/inflections.rb
+1
-0
activestorage/test/dummy/config/initializers/mime_types.rb
activestorage/test/dummy/config/initializers/mime_types.rb
+1
-0
activestorage/test/dummy/config/initializers/wrap_parameters.rb
...storage/test/dummy/config/initializers/wrap_parameters.rb
+2
-0
activestorage/test/dummy/config/routes.rb
activestorage/test/dummy/config/routes.rb
+2
-0
activestorage/test/dummy/config/spring.rb
activestorage/test/dummy/config/spring.rb
+2
-0
activestorage/test/filename_test.rb
activestorage/test/filename_test.rb
+4
-2
activestorage/test/models/attachments_test.rb
activestorage/test/models/attachments_test.rb
+2
-0
activestorage/test/models/blob_test.rb
activestorage/test/models/blob_test.rb
+2
-0
activestorage/test/models/variant_test.rb
activestorage/test/models/variant_test.rb
+2
-0
activestorage/test/service/azure_storage_service_test.rb
activestorage/test/service/azure_storage_service_test.rb
+2
-0
activestorage/test/service/configurator_test.rb
activestorage/test/service/configurator_test.rb
+2
-0
activestorage/test/service/disk_service_test.rb
activestorage/test/service/disk_service_test.rb
+2
-0
activestorage/test/service/gcs_service_test.rb
activestorage/test/service/gcs_service_test.rb
+2
-0
activestorage/test/service/mirror_service_test.rb
activestorage/test/service/mirror_service_test.rb
+2
-0
activestorage/test/service/s3_service_test.rb
activestorage/test/service/s3_service_test.rb
+2
-0
activestorage/test/service/shared_service_tests.rb
activestorage/test/service/shared_service_tests.rb
+3
-1
activestorage/test/template/image_tag_test.rb
activestorage/test/template/image_tag_test.rb
+2
-0
activestorage/test/test_helper.rb
activestorage/test/test_helper.rb
+2
-0
未找到文件。
.rubocop.yml
浏览文件 @
d02844f2
...
@@ -88,6 +88,7 @@ Style/FrozenStringLiteralComment:
...
@@ -88,6 +88,7 @@ Style/FrozenStringLiteralComment:
-
'
actioncable/**/*'
-
'
actioncable/**/*'
-
'
activejob/**/*'
-
'
activejob/**/*'
-
'
activerecord/**/*'
-
'
activerecord/**/*'
-
'
activestorage/**/*'
-
'
actionmailer/**/*'
-
'
actionmailer/**/*'
-
'
actionview/**/*'
-
'
actionview/**/*'
-
'
actionpack/**/*'
-
'
actionpack/**/*'
...
...
activestorage/Rakefile
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"bundler/setup"
require
"bundler/setup"
require
"bundler/gem_tasks"
require
"bundler/gem_tasks"
require
"rake/testtask"
require
"rake/testtask"
...
...
activestorage/app/controllers/active_storage/blobs_controller.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Take a signed permanent reference for a blob and turn it into an expiring service URL for download.
# Take a signed permanent reference for a blob and turn it into an expiring service URL for download.
# Note: These URLs are publicly accessible. If you need to enforce access protection beyond the
# Note: These URLs are publicly accessible. If you need to enforce access protection beyond the
# security-through-obscurity factor of the signed blob references, you'll need to implement your own
# security-through-obscurity factor of the signed blob references, you'll need to implement your own
...
...
activestorage/app/controllers/active_storage/direct_uploads_controller.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Creates a new blob on the server side in anticipation of a direct-to-service upload from the client side.
# Creates a new blob on the server side in anticipation of a direct-to-service upload from the client side.
# When the client-side upload is completed, the signed_blob_id can be submitted as part of the form to reference
# When the client-side upload is completed, the signed_blob_id can be submitted as part of the form to reference
# the blob that was created up front.
# the blob that was created up front.
...
...
activestorage/app/controllers/active_storage/disk_controller.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Serves files stored with the disk service in the same way that the cloud services do.
# Serves files stored with the disk service in the same way that the cloud services do.
# This means using expiring, signed URLs that are meant for immediate access, not permanent linking.
# This means using expiring, signed URLs that are meant for immediate access, not permanent linking.
# Always go through the BlobsController, or your own authenticated controller, rather than directly
# Always go through the BlobsController, or your own authenticated controller, rather than directly
...
...
activestorage/app/controllers/active_storage/variants_controller.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Take a signed permanent reference for a variant and turn it into an expiring service URL for download.
# Take a signed permanent reference for a variant and turn it into an expiring service URL for download.
# Note: These URLs are publicly accessible. If you need to enforce access protection beyond the
# Note: These URLs are publicly accessible. If you need to enforce access protection beyond the
# security-through-obscurity factor of the signed blob and variation reference, you'll need to implement your own
# security-through-obscurity factor of the signed blob and variation reference, you'll need to implement your own
...
...
activestorage/app/jobs/active_storage/purge_job.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Provides delayed purging of attachments or blobs using their +#purge_later+ method.
# Provides delayed purging of attachments or blobs using their +#purge_later+ method.
class
ActiveStorage::PurgeJob
<
ActiveJob
::
Base
class
ActiveStorage::PurgeJob
<
ActiveJob
::
Base
# FIXME: Limit this to a custom ActiveStorage error
# FIXME: Limit this to a custom ActiveStorage error
...
...
activestorage/app/models/active_storage/attachment.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"active_support/core_ext/module/delegation"
require
"active_support/core_ext/module/delegation"
# Attachments associate records with blobs. Usually that's a one record-many blobs relationship,
# Attachments associate records with blobs. Usually that's a one record-many blobs relationship,
...
...
activestorage/app/models/active_storage/blob.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# A blob is a record that contains the metadata about a file and a key for where that file resides on the service.
# A blob is a record that contains the metadata about a file and a key for where that file resides on the service.
# Blobs can be created in two ways:
# Blobs can be created in two ways:
#
#
...
...
activestorage/app/models/active_storage/filename.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Encapsulates a string representing a filename to provide convenience access to parts of it and a sanitized version.
# Encapsulates a string representing a filename to provide convenience access to parts of it and a sanitized version.
# This is what's returned by `ActiveStorage::Blob#filename`. A Filename instance is comparable so it can be used for sorting.
# This is what's returned by `ActiveStorage::Blob#filename`. A Filename instance is comparable so it can be used for sorting.
class
ActiveStorage::Filename
class
ActiveStorage::Filename
...
...
activestorage/app/models/active_storage/variant.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Image blobs can have variants that are the result of a set of transformations applied to the original.
# Image blobs can have variants that are the result of a set of transformations applied to the original.
# These variants are used to create thumbnails, fixed-size avatars, or any other derivative image from the
# These variants are used to create thumbnails, fixed-size avatars, or any other derivative image from the
# original.
# original.
...
...
activestorage/app/models/active_storage/variation.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"active_support/core_ext/object/inclusion"
require
"active_support/core_ext/object/inclusion"
# A set of transformations that can be applied to a blob to create a variant. This class is exposed via
# A set of transformations that can be applied to a blob to create a variant. This class is exposed via
...
...
activestorage/config/routes.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
Rails
.
application
.
routes
.
draw
do
Rails
.
application
.
routes
.
draw
do
get
"/rails/active_storage/blobs/:signed_id/*filename"
=>
"active_storage/blobs#show"
,
as: :rails_service_blob
get
"/rails/active_storage/blobs/:signed_id/*filename"
=>
"active_storage/blobs#show"
,
as: :rails_service_blob
...
...
activestorage/db/migrate/20170806125915_create_active_storage_tables.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
class
CreateActiveStorageTables
<
ActiveRecord
::
Migration
[
5.1
]
class
CreateActiveStorageTables
<
ActiveRecord
::
Migration
[
5.1
]
def
change
def
change
create_table
:active_storage_blobs
do
|
t
|
create_table
:active_storage_blobs
do
|
t
|
...
...
activestorage/lib/active_storage.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
#--
#--
# Copyright (c) 2017 David Heinemeier Hansson
# Copyright (c) 2017 David Heinemeier Hansson
#
#
...
...
activestorage/lib/active_storage/attached.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"action_dispatch"
require
"action_dispatch"
require
"action_dispatch/http/upload"
require
"action_dispatch/http/upload"
require
"active_support/core_ext/module/delegation"
require
"active_support/core_ext/module/delegation"
...
...
activestorage/lib/active_storage/attached/macros.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
module
ActiveStorage
module
ActiveStorage
# Provides the class-level DSL for declaring that an Active Record model has attached blobs.
# Provides the class-level DSL for declaring that an Active Record model has attached blobs.
module
Attached::Macros
module
Attached::Macros
...
...
activestorage/lib/active_storage/attached/many.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
module
ActiveStorage
module
ActiveStorage
# Decorated proxy object representing of multiple attachments to a model.
# Decorated proxy object representing of multiple attachments to a model.
class
Attached::Many
<
Attached
class
Attached::Many
<
Attached
...
...
activestorage/lib/active_storage/attached/one.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
module
ActiveStorage
module
ActiveStorage
# Representation of a single attachment to a model.
# Representation of a single attachment to a model.
class
Attached::One
<
Attached
class
Attached::One
<
Attached
...
...
activestorage/lib/active_storage/gem_version.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
module
ActiveStorage
module
ActiveStorage
# Returns the version of the currently loaded Active Storage as a <tt>Gem::Version</tt>
# Returns the version of the currently loaded Active Storage as a <tt>Gem::Version</tt>
def
self
.
gem_version
def
self
.
gem_version
...
...
activestorage/lib/active_storage/log_subscriber.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"active_support/log_subscriber"
require
"active_support/log_subscriber"
module
ActiveStorage
module
ActiveStorage
class
LogSubscriber
<
ActiveSupport
::
LogSubscriber
class
LogSubscriber
<
ActiveSupport
::
LogSubscriber
def
service_upload
(
event
)
def
service_upload
(
event
)
message
=
"Uploaded file to key:
#{
key_in
(
event
)
}
"
message
=
"Uploaded file to key:
#{
key_in
(
event
)
}
"
message
<<
" (checksum:
#{
event
.
payload
[
:checksum
]
}
)"
if
event
.
payload
[
:checksum
]
message
+=
" (checksum:
#{
event
.
payload
[
:checksum
]
}
)"
if
event
.
payload
[
:checksum
]
info
event
,
color
(
message
,
GREEN
)
info
event
,
color
(
message
,
GREEN
)
end
end
...
...
activestorage/lib/active_storage/service.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"active_storage/log_subscriber"
require
"active_storage/log_subscriber"
module
ActiveStorage
module
ActiveStorage
...
...
activestorage/lib/active_storage/service/azure_storage_service.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"active_support/core_ext/numeric/bytes"
require
"active_support/core_ext/numeric/bytes"
require
"azure/storage"
require
"azure/storage"
require
"azure/storage/core/auth/shared_access_signature"
require
"azure/storage/core/auth/shared_access_signature"
...
...
activestorage/lib/active_storage/service/configurator.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
module
ActiveStorage
module
ActiveStorage
class
Service::Configurator
#:nodoc:
class
Service::Configurator
#:nodoc:
attr_reader
:configurations
attr_reader
:configurations
...
...
activestorage/lib/active_storage/service/disk_service.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"fileutils"
require
"fileutils"
require
"pathname"
require
"pathname"
require
"digest/md5"
require
"digest/md5"
...
...
activestorage/lib/active_storage/service/gcs_service.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"google/cloud/storage"
require
"google/cloud/storage"
require
"active_support/core_ext/object/to_query"
require
"active_support/core_ext/object/to_query"
...
...
activestorage/lib/active_storage/service/mirror_service.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"active_support/core_ext/module/delegation"
require
"active_support/core_ext/module/delegation"
module
ActiveStorage
module
ActiveStorage
...
...
activestorage/lib/active_storage/service/s3_service.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"aws-sdk"
require
"aws-sdk"
require
"active_support/core_ext/numeric/bytes"
require
"active_support/core_ext/numeric/bytes"
...
...
activestorage/lib/active_storage/version.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require_relative
"gem_version"
require_relative
"gem_version"
module
ActiveStorage
module
ActiveStorage
...
...
activestorage/lib/tasks/activestorage.rake
浏览文件 @
d02844f2
# frozen_string_literal: true
namespace
:activestorage
do
namespace
:activestorage
do
desc
"Copy over the migration needed to the application"
desc
"Copy over the migration needed to the application"
task
install: :environment
do
task
install: :environment
do
...
...
activestorage/test/controllers/blobs_controller_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"test_helper"
require
"test_helper"
require
"database/setup"
require
"database/setup"
...
...
activestorage/test/controllers/direct_uploads_controller_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"test_helper"
require
"test_helper"
require
"database/setup"
require
"database/setup"
...
...
activestorage/test/controllers/disk_controller_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"test_helper"
require
"test_helper"
require
"database/setup"
require
"database/setup"
...
...
activestorage/test/controllers/variants_controller_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"test_helper"
require
"test_helper"
require
"database/setup"
require
"database/setup"
...
...
activestorage/test/database/create_users_migration.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
class
ActiveStorageCreateUsers
<
ActiveRecord
::
Migration
[
5.1
]
class
ActiveStorageCreateUsers
<
ActiveRecord
::
Migration
[
5.1
]
def
change
def
change
create_table
:users
do
|
t
|
create_table
:users
do
|
t
|
...
...
activestorage/test/database/setup.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require_relative
"create_users_migration"
require_relative
"create_users_migration"
ActiveRecord
::
Base
.
establish_connection
(
adapter:
"sqlite3"
,
database:
":memory:"
)
ActiveRecord
::
Base
.
establish_connection
(
adapter:
"sqlite3"
,
database:
":memory:"
)
...
...
activestorage/test/dummy/Rakefile
浏览文件 @
d02844f2
# frozen_string_literal: true
require_relative
"config/application"
require_relative
"config/application"
Rails
.
application
.
load_tasks
Rails
.
application
.
load_tasks
activestorage/test/dummy/app/controllers/application_controller.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
class
ApplicationController
<
ActionController
::
Base
class
ApplicationController
<
ActionController
::
Base
protect_from_forgery
with: :exception
protect_from_forgery
with: :exception
end
end
activestorage/test/dummy/app/helpers/application_helper.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
module
ApplicationHelper
module
ApplicationHelper
end
end
activestorage/test/dummy/app/jobs/application_job.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
class
ApplicationJob
<
ActiveJob
::
Base
class
ApplicationJob
<
ActiveJob
::
Base
end
end
activestorage/test/dummy/app/models/application_record.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
class
ApplicationRecord
<
ActiveRecord
::
Base
class
ApplicationRecord
<
ActiveRecord
::
Base
self
.
abstract_class
=
true
self
.
abstract_class
=
true
end
end
activestorage/test/dummy/bin/bundle
浏览文件 @
d02844f2
#!/usr/bin/env ruby
#!/usr/bin/env ruby
# frozen_string_literal: true
ENV
[
"BUNDLE_GEMFILE"
]
||=
File
.
expand_path
(
"../../Gemfile"
,
__FILE__
)
ENV
[
"BUNDLE_GEMFILE"
]
||=
File
.
expand_path
(
"../../Gemfile"
,
__FILE__
)
load
Gem
.
bin_path
(
"bundler"
,
"bundle"
)
load
Gem
.
bin_path
(
"bundler"
,
"bundle"
)
activestorage/test/dummy/bin/rails
浏览文件 @
d02844f2
#!/usr/bin/env ruby
#!/usr/bin/env ruby
# frozen_string_literal: true
APP_PATH
=
File
.
expand_path
(
"../config/application"
,
__dir__
)
APP_PATH
=
File
.
expand_path
(
"../config/application"
,
__dir__
)
require_relative
"../config/boot"
require_relative
"../config/boot"
require
"rails/commands"
require
"rails/commands"
activestorage/test/dummy/bin/rake
浏览文件 @
d02844f2
#!/usr/bin/env ruby
#!/usr/bin/env ruby
# frozen_string_literal: true
require_relative
"../config/boot"
require_relative
"../config/boot"
require
"rake"
require
"rake"
Rake
.
application
.
run
Rake
.
application
.
run
activestorage/test/dummy/bin/yarn
浏览文件 @
d02844f2
#!/usr/bin/env ruby
#!/usr/bin/env ruby
# frozen_string_literal: true
VENDOR_PATH
=
File
.
expand_path
(
".."
,
__dir__
)
VENDOR_PATH
=
File
.
expand_path
(
".."
,
__dir__
)
Dir
.
chdir
(
VENDOR_PATH
)
do
Dir
.
chdir
(
VENDOR_PATH
)
do
begin
begin
...
...
activestorage/test/dummy/config.ru
浏览文件 @
d02844f2
# frozen_string_literal: true
# This file is used by Rack-based servers to start the application.
# This file is used by Rack-based servers to start the application.
require_relative
"config/environment"
require_relative
"config/environment"
...
...
activestorage/test/dummy/config/application.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require_relative
"boot"
require_relative
"boot"
require
"rails"
require
"rails"
...
...
activestorage/test/dummy/config/boot.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Set up gems listed in the Gemfile.
# Set up gems listed in the Gemfile.
ENV
[
"BUNDLE_GEMFILE"
]
||=
File
.
expand_path
(
"../../../Gemfile"
,
__dir__
)
ENV
[
"BUNDLE_GEMFILE"
]
||=
File
.
expand_path
(
"../../../Gemfile"
,
__dir__
)
...
...
activestorage/test/dummy/config/environment.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Load the Rails application.
# Load the Rails application.
require_relative
"application"
require_relative
"application"
...
...
activestorage/test/dummy/config/environments/development.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
Rails
.
application
.
configure
do
Rails
.
application
.
configure
do
# Settings specified here will take precedence over those in config/application.rb.
# Settings specified here will take precedence over those in config/application.rb.
...
...
activestorage/test/dummy/config/environments/production.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
Rails
.
application
.
configure
do
Rails
.
application
.
configure
do
# Settings specified here will take precedence over those in config/application.rb.
# Settings specified here will take precedence over those in config/application.rb.
...
...
activestorage/test/dummy/config/environments/test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
Rails
.
application
.
configure
do
Rails
.
application
.
configure
do
# Settings specified here will take precedence over those in config/application.rb.
# Settings specified here will take precedence over those in config/application.rb.
...
...
activestorage/test/dummy/config/initializers/application_controller_renderer.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Be sure to restart your server when you modify this file.
# ApplicationController.renderer.defaults.merge!(
# ApplicationController.renderer.defaults.merge!(
...
...
activestorage/test/dummy/config/initializers/assets.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
# Version of your assets, change this if you want to expire all your assets.
...
...
activestorage/test/dummy/config/initializers/backtrace_silencers.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
...
...
activestorage/test/dummy/config/initializers/cookies_serializer.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars.
# Specify a serializer for the signed and encrypted cookie jars.
...
...
activestorage/test/dummy/config/initializers/filter_parameter_logging.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
# Configure sensitive parameters which will be filtered from the log file.
...
...
activestorage/test/dummy/config/initializers/inflections.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# Add new inflection rules using the following format. Inflections
...
...
activestorage/test/dummy/config/initializers/mime_types.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Add new mime types for use in respond_to blocks:
...
...
activestorage/test/dummy/config/initializers/wrap_parameters.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# This file contains settings for ActionController::ParamsWrapper which
...
...
activestorage/test/dummy/config/routes.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
Rails
.
application
.
routes
.
draw
do
Rails
.
application
.
routes
.
draw
do
end
end
activestorage/test/dummy/config/spring.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
%w(
%w(
.ruby-version
.ruby-version
.rbenv-vars
.rbenv-vars
...
...
activestorage/test/filename_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"test_helper"
require
"test_helper"
class
ActiveStorage::FilenameTest
<
ActiveSupport
::
TestCase
class
ActiveStorage::FilenameTest
<
ActiveSupport
::
TestCase
...
@@ -10,8 +12,8 @@ class ActiveStorage::FilenameTest < ActiveSupport::TestCase
...
@@ -10,8 +12,8 @@ class ActiveStorage::FilenameTest < ActiveSupport::TestCase
end
end
test
"sanitize transcodes to valid UTF-8"
do
test
"sanitize transcodes to valid UTF-8"
do
{
"
\xF6
"
.
force_encoding
(
Encoding
::
ISO8859_1
)
=>
"ö"
,
{
"
\xF6
"
.
dup
.
force_encoding
(
Encoding
::
ISO8859_1
)
=>
"ö"
,
"
\xC3
"
.
force_encoding
(
Encoding
::
ISO8859_1
)
=>
"Ã"
,
"
\xC3
"
.
dup
.
force_encoding
(
Encoding
::
ISO8859_1
)
=>
"Ã"
,
"
\xAD
"
=>
"�"
,
"
\xAD
"
=>
"�"
,
"
\xCF
"
=>
"�"
,
"
\xCF
"
=>
"�"
,
"
\x00
"
=>
""
,
"
\x00
"
=>
""
,
...
...
activestorage/test/models/attachments_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"test_helper"
require
"test_helper"
require
"database/setup"
require
"database/setup"
...
...
activestorage/test/models/blob_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"test_helper"
require
"test_helper"
require
"database/setup"
require
"database/setup"
...
...
activestorage/test/models/variant_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"test_helper"
require
"test_helper"
require
"database/setup"
require
"database/setup"
...
...
activestorage/test/service/azure_storage_service_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"service/shared_service_tests"
require
"service/shared_service_tests"
require
"uri"
require
"uri"
...
...
activestorage/test/service/configurator_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"service/shared_service_tests"
require
"service/shared_service_tests"
class
ActiveStorage::Service::ConfiguratorTest
<
ActiveSupport
::
TestCase
class
ActiveStorage::Service::ConfiguratorTest
<
ActiveSupport
::
TestCase
...
...
activestorage/test/service/disk_service_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"service/shared_service_tests"
require
"service/shared_service_tests"
class
ActiveStorage::Service::DiskServiceTest
<
ActiveSupport
::
TestCase
class
ActiveStorage::Service::DiskServiceTest
<
ActiveSupport
::
TestCase
...
...
activestorage/test/service/gcs_service_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"service/shared_service_tests"
require
"service/shared_service_tests"
require
"net/http"
require
"net/http"
...
...
activestorage/test/service/mirror_service_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"service/shared_service_tests"
require
"service/shared_service_tests"
class
ActiveStorage::Service::MirrorServiceTest
<
ActiveSupport
::
TestCase
class
ActiveStorage::Service::MirrorServiceTest
<
ActiveSupport
::
TestCase
...
...
activestorage/test/service/s3_service_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"service/shared_service_tests"
require
"service/shared_service_tests"
require
"net/http"
require
"net/http"
...
...
activestorage/test/service/shared_service_tests.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"test_helper"
require
"test_helper"
require
"active_support/core_ext/securerandom"
require
"active_support/core_ext/securerandom"
...
@@ -5,7 +7,7 @@ module ActiveStorage::Service::SharedServiceTests
...
@@ -5,7 +7,7 @@ module ActiveStorage::Service::SharedServiceTests
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
FIXTURE_KEY
=
SecureRandom
.
base58
(
24
)
FIXTURE_KEY
=
SecureRandom
.
base58
(
24
)
FIXTURE_DATA
=
"
\211
PNG
\r\n\032\n\000\000\000\r
IHDR
\000\000\000\020\000\000\000\020\001\003\000\000\000
%=m
\"\000\000\000\006
PLTE
\000\000\000\377\377\377\245\331\237\335\000\000\000
3IDATx
\234
c
\370\377\237\341\377
_
\206\377\237\031\016\260
3
\334
?
\314
p
\177
2
\303\315\315\f
7
\215\031\356\024\203\320\275\317\f\367\201
R
\314\f\017\300\350\377\177\000
Q
\206\027
(
\316
]
\233
P
\000\000\000\000
IEND
\256
B`
\202
"
.
force_encoding
(
Encoding
::
BINARY
)
FIXTURE_DATA
=
"
\211
PNG
\r\n\032\n\000\000\000\r
IHDR
\000\000\000\020\000\000\000\020\001\003\000\000\000
%=m
\"\000\000\000\006
PLTE
\000\000\000\377\377\377\245\331\237\335\000\000\000
3IDATx
\234
c
\370\377\237\341\377
_
\206\377\237\031\016\260
3
\334
?
\314
p
\177
2
\303\315\315\f
7
\215\031\356\024\203\320\275\317\f\367\201
R
\314\f\017\300\350\377\177\000
Q
\206\027
(
\316
]
\233
P
\000\000\000\000
IEND
\256
B`
\202
"
.
dup
.
force_encoding
(
Encoding
::
BINARY
)
included
do
included
do
setup
do
setup
do
...
...
activestorage/test/template/image_tag_test.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
"test_helper"
require
"test_helper"
require
"database/setup"
require
"database/setup"
...
...
activestorage/test/test_helper.rb
浏览文件 @
d02844f2
# frozen_string_literal: true
require
File
.
expand_path
(
"../../test/dummy/config/environment.rb"
,
__FILE__
)
require
File
.
expand_path
(
"../../test/dummy/config/environment.rb"
,
__FILE__
)
require
"bundler/setup"
require
"bundler/setup"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录