128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
# File 'lib/openc3/utilities/target_file.rb', line 128
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
|