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
*.csv
.ruby-version
.envrc

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

@ -1,6 +1,6 @@
# This configuration was generated by
# `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
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new

@ -2,9 +2,9 @@
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 'rack'
gem 'rake'

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

@ -1,6 +1,6 @@
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
of this software and associated documentation files (the "Software"), to deal

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

Loading…
Cancel
Save