116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
# File 'lib/openc3/utilities/target_file.rb', line 116
def self.create(scope, name, text, content_type: 'text/plain')
return false unless text
if ENV['OPENC3_LOCAL_MODE']
OpenC3::LocalMode.put_target_file("#{scope}/targets_modified/#{name}", text, scope: scope)
end
client = Bucket.getClient()
client.put_object(
bucket: ENV['OPENC3_CONFIG_BUCKET'],
key: "#{scope}/targets_modified/#{name}",
body: text,
content_type: content_type,
)
if client.check_object(
bucket: ENV['OPENC3_CONFIG_BUCKET'],
key: "#{scope}/targets_modified/#{name}",
)
true
else
false
end
end
|