First wave of 2.7.0 deprecation fixes

bust_cache
Rick Carlino 2020-01-03 09:31:48 -06:00
parent 2226d3b34b
commit 721fea39b2
14 changed files with 16 additions and 16 deletions

View File

@ -1 +1 @@
2.6.5
2.7.0

View File

@ -1,5 +1,5 @@
source "https://rubygems.org"
ruby "~> 2.6.5"
ruby "~> 2.7.0"
gem "rails"
gem "active_model_serializers"

View File

@ -341,7 +341,7 @@ DEPENDENCIES
valid_url
RUBY VERSION
ruby 2.6.5p114
ruby 2.7.0p0
BUNDLED WITH
1.17.2

View File

@ -78,7 +78,7 @@ class Fragment < ApplicationRecord
def self.from_celery(device:, kind:, args:, body:, owner:)
p = { device: device, kind: kind, args: args, body: body }
flat_ast = Fragments::Preprocessor.run!(p)
flat_ast = Fragments::Preprocessor.run!(**p)
Fragments::Create.run!(device: device,
flat_ast: flat_ast,
owner: owner)

View File

@ -43,7 +43,7 @@ class Image < ApplicationRecord
has_one_attached :attachment
def set_attachment_by_url(url)
attachment.attach(io: open(url), filename: "image_#{self.id}")
attachment.attach(io: URI.open(url), filename: "image_#{self.id}")
self.attachment_processed_at = Time.now
self
end

View File

@ -16,7 +16,7 @@ module FarmEvents
kind: "internal_#{kind}",
args: {},
body: body }
flat_ast = Fragments::Preprocessor.run!(params)
flat_ast = Fragments::Preprocessor.run!(**params)
Fragments::Create.run!(device: device,
flat_ast: flat_ast,
owner: owner)

View File

@ -5,7 +5,7 @@ module Fragments
def self.run!(kind:, args:, body:, device:)
canonical = {kind: kind, args: args, body: body}
slicer = CeleryScript::Slicer.new
tree = CeleryScript::AstNode.new(canonical.deep_symbolize_keys)
tree = CeleryScript::AstNode.new(**canonical.deep_symbolize_keys)
checker = CeleryScript::Checker.new(tree, Corpus, device)
checker.run!
slicer.run!(canonical)

View File

@ -1,4 +1,4 @@
FROM ruby:2.6.5
FROM ruby:2.7.0
RUN wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - && \
sh -c 'VERSION_CODENAME=stretch; . /etc/os-release; echo "deb http://apt.postgresql.org/pub/repos/apt/ $VERSION_CODENAME-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' && \
apt-get update -qq && apt-get install -y build-essential libpq-dev postgresql postgresql-contrib && \

View File

@ -51,7 +51,7 @@ describe Api::PasswordResetsController do
it "handles token expiration" do
token = PasswordResetToken
.issue_to(user, { exp: Time.now.yesterday.to_i })
.issue_to(user, **{ exp: Time.now.yesterday.to_i })
.encoded
params = { password: "xpassword123",

View File

@ -9,7 +9,7 @@ describe "Body nodes" do
let(:device) { FactoryBot.create(:device) }
it "always always empty bodies" do
tree = CeleryScript::AstNode.new({
tree = CeleryScript::AstNode.new(**{
"kind": "baz",
"args": {},
"body": []

View File

@ -5,7 +5,7 @@ describe CeleryScript::Corpus do
let(:corpus) { Sequence::Corpus }
it "handles valid move_absolute blocks" do
ok1 = CeleryScript::AstNode.new({
ok1 = CeleryScript::AstNode.new(**{
kind: "move_absolute",
args: {
location: {
@ -75,7 +75,7 @@ describe CeleryScript::Corpus do
end
it "finds problems with nested nodes" do
bad = CeleryScript::AstNode.new({
bad = CeleryScript::AstNode.new(**{
kind: "move_absolute",
args: {
location: {

View File

@ -22,7 +22,7 @@ describe "Celery Script `point` node" do
}.deep_symbolize_keys
end
let(:tree) { CeleryScript::AstNode.new(hash) }
let(:tree) { CeleryScript::AstNode.new(**hash) }
let(:corpus) { Sequence::Corpus }
let(:device) { plant.device }
let(:checker) { CeleryScript::Checker.new(tree, corpus, device) }

View File

@ -5,7 +5,7 @@ describe CeleryScript::TreeClimber do
let(:node) do
hash = JSON.parse(file_path).deep_symbolize_keys
CeleryScript::AstNode.new(hash)
CeleryScript::AstNode.new(**hash)
end
it "travels to each node with a callable object" do

View File

@ -47,7 +47,7 @@ describe Fragments::Create do
},
],
}
flat_ast = Fragments::Preprocessor.run!(origin)
flat_ast = Fragments::Preprocessor.run!(**origin)
fragment = Fragments::Create.run!(flat_ast: flat_ast, owner: farm_event)
result = Fragments::Show.run!(owner: farm_event)
diff = Hashdiff.diff(origin.without(:device), result.deep_symbolize_keys)
@ -83,7 +83,7 @@ describe Fragments::Create do
config.logger = spy_logger
fragment = Fragments::Create.run!(device: device,
owner: farm_event,
flat_ast: Fragments::Preprocessor.run!(origin))
flat_ast: Fragments::Preprocessor.run!(**origin))
# Warm the cache up with two dry-runs:
Fragments::Show.run!(owner: farm_event)
Fragments::Show.run!(owner: farm_event)