Skip to content

Commit

Permalink
feat(storage): use aws-sdk-s3 gem instead of aws-sdk
Browse files Browse the repository at this point in the history
Closes #190
  • Loading branch information
rjherrera committed Aug 3, 2019
1 parent f0ea208 commit c55c536
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
5 changes: 0 additions & 5 deletions lib/potassium/recipes/aws_sdk.rb

This file was deleted.

1 change: 1 addition & 0 deletions lib/potassium/recipes/file_storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def add_active_storage
end

def common_setup
gather_gem 'aws-sdk-s3', '~> 1.0'
add_readme_section :internal_dependencies, get(:storage)
append_to_file '.env.development', "S3_BUCKET=\n"
end
Expand Down
1 change: 0 additions & 1 deletion lib/potassium/templates/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
create :ruby
create :yarn
create :editorconfig
create :aws_sdk
create :mailer
create :background_processor
create :schedule
Expand Down
10 changes: 10 additions & 0 deletions spec/features/file_storage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
create_dummy_project(storage: :active_storage)
end

it "adds the aws-sdk-s3 gem to Gemfile" do
gemfile_content = IO.read("#{project_path}/Gemfile")
expect(gemfile_content).to include("gem 'aws-sdk-s3'")
end

it "customizes config file" do
content = IO.read("#{project_path}/config/storage.yml")
expect(content).to include("bucket: <%= ENV['S3_BUCKET'] %>")
Expand Down Expand Up @@ -41,6 +46,11 @@
expect(gemfile_content).to include("gem 'paperclip'")
end

it "adds the aws-sdk-s3 gem to Gemfile" do
gemfile_content = IO.read("#{project_path}/Gemfile")
expect(gemfile_content).to include("gem 'aws-sdk-s3'")
end

it "adds brief to README file" do
content = IO.read("#{project_path}/README.md")
expect(content).to include("Paperclip")
Expand Down
5 changes: 0 additions & 5 deletions spec/features/new_project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@
expect(gemfile).to include %{gem 'pg'}
end

it "configures aws" do
gemfile_content = IO.read("#{project_path}/Gemfile")
expect(gemfile_content).to include("'aws-sdk', '~> 3'")
end

it "configures the correct ruby version" do
ruby_version_file = IO.read("#{project_path}/.ruby-version")

Expand Down

0 comments on commit c55c536

Please sign in to comment.