All the updates!

main
Dan Buch 1 year ago
parent 156ca54906
commit 5aadce63fd
Signed by: meatballhat
GPG Key ID: A12F782281063434

@ -1,14 +0,0 @@
name: Do Things
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-ruby@v1
with:
ruby-version: '2.6.x'
- run: |
gem install bundler
bundle install --jobs 4 --retry 3
bundle exec rake

1
.gitignore vendored

@ -1,3 +1,4 @@
.*env .*env
*.csv *.csv
.ruby-version .ruby-version
.envrc

@ -1,7 +1,9 @@
inherit_from: .rubocop_todo.yml inherit_from: .rubocop_todo.yml
AllCops: AllCops:
TargetRubyVersion: 2.6 NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 3.2
Style/Documentation: Style/Documentation:
Enabled: false Enabled: false

@ -1,6 +1,6 @@
# This configuration was generated by # This configuration was generated by
# `rubocop --auto-gen-config` # `rubocop --auto-gen-config`
# on 2020-01-11 15:25:31 -0500 using RuboCop version 0.78.0. # on 2023-01-01 17:49:35 UTC using RuboCop version 1.42.0.
# The point is for the user to remove these configuration records # The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base. # one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new

@ -2,9 +2,9 @@
source 'https://rubygems.org' source 'https://rubygems.org'
ruby '2.7.2' if ENV.key?('DYNO') ruby '3.2.0' if ENV.key?('DYNO')
gem 'aws-sdk', '~> 2' gem 'aws-sdk-s3', '~> 1'
gem 'pry', group: %i[development test] gem 'pry', group: %i[development test]
gem 'rack' gem 'rack'
gem 'rake' gem 'rake'

@ -1,45 +1,58 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
ast (2.4.0) ast (2.4.2)
aws-eventstream (1.0.3) aws-eventstream (1.2.0)
aws-sdk (2.11.421) aws-partitions (1.686.0)
aws-sdk-resources (= 2.11.421) aws-sdk-core (3.168.4)
aws-sdk-core (2.11.421) aws-eventstream (~> 1, >= 1.0.2)
aws-sigv4 (~> 1.0) aws-partitions (~> 1, >= 1.651.0)
jmespath (~> 1.0) aws-sigv4 (~> 1.5)
aws-sdk-resources (2.11.421) jmespath (~> 1, >= 1.6.1)
aws-sdk-core (= 2.11.421) aws-sdk-kms (1.61.0)
aws-sigv4 (1.1.0) aws-sdk-core (~> 3, >= 3.165.0)
aws-eventstream (~> 1.0, >= 1.0.2) aws-sigv4 (~> 1.1)
coderay (1.1.2) aws-sdk-s3 (1.117.2)
jaro_winkler (1.5.4) aws-sdk-core (~> 3, >= 3.165.0)
jmespath (1.4.0) aws-sdk-kms (~> 1)
method_source (0.9.2) aws-sigv4 (~> 1.4)
parallel (1.19.1) aws-sigv4 (1.5.2)
parser (2.7.0.1) aws-eventstream (~> 1, >= 1.0.2)
ast (~> 2.4.0) coderay (1.1.3)
pry (0.12.2) jmespath (1.6.2)
coderay (~> 1.1.0) json (2.6.3)
method_source (~> 0.9.0) method_source (1.0.0)
rack (2.0.8) parallel (1.22.1)
rainbow (3.0.0) parser (3.1.3.0)
rake (13.0.1) ast (~> 2.4.1)
rubocop (0.78.0) pry (0.14.1)
jaro_winkler (~> 1.5.1) coderay (~> 1.1)
method_source (~> 1.0)
rack (3.0.3)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.6.1)
rexml (3.2.5)
rubocop (1.42.0)
json (~> 2.3)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 2.6) parser (>= 3.1.2.1)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.24.1, < 2.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7) unicode-display_width (>= 1.4.0, < 3.0)
ruby-progressbar (1.10.1) rubocop-ast (1.24.1)
unicode-display_width (1.6.0) parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
unicode-display_width (2.3.0)
PLATFORMS PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
aws-sdk (~> 2) aws-sdk-s3 (~> 1)
pry pry
rack rack
rake rake

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright © 2020 Dan Buch Copyright © 2023 Dan Buch
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

@ -1,3 +1,3 @@
# frozen_string_literal: true # frozen_string_literal: true
run ->(*) { [301, { 'Location' => ENV['CPI_FEED_URL'] }, []] } run ->(*) { [301, { 'Location' => ENV.fetch('CPI_FEED_URL', nil) }, []] }

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'aws-sdk' require 'aws-sdk-s3'
class MiniS3put class MiniS3put
def initialize(key: nil, instream: $stdin) def initialize(key: nil, instream: $stdin)
@ -13,19 +13,14 @@ class MiniS3put
private :bucket, :key, :instream private :bucket, :key, :instream
def put def put
Aws::S3::Resource.new.bucket(bucket).object(key).put( body = instream.read
body: instream.read puts Aws::S3::Resource.new.bucket(bucket).object(key).put(body:)
).on_success(&method(:on_put_success))
end
private def on_put_success(response) puts body
puts response.data
Aws::S3::Client.new.put_object_acl( puts Aws::S3::Client.new.put_object_acl(
bucket: bucket, key: key, acl: 'public-read' bucket:, key:, acl: 'public-read'
).on_success do |acl_response| )
puts acl_response.data
end
end end
end end

Loading…
Cancel
Save