Class: Rna::S3
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#s3 ⇒ Object
readonly
Returns the value of attribute s3.
Attributes inherited from Outputer
Instance Method Summary collapse
Methods inherited from Outputer
Constructor Details
This class inherits a constructor from Rna::Outputer
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
22 23 24 |
# File 'lib/rna/outputers.rb', line 22 def config @config end |
#s3 ⇒ Object (readonly)
Returns the value of attribute s3.
22 23 24 |
# File 'lib/rna/outputers.rb', line 22 def s3 @s3 end |
Instance Method Details
#run(jsons) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rna/outputers.rb', line 23 def run(jsons) # options[:config] only used for specs s3_config_path = [:s3_config_path] || 'config/s3.yml' @config ||= YAML.load(File.read(s3_config_path)) AWS.config(@config) @s3 = AWS::S3.new bucket = @s3.buckets[@config['bucket']] jsons.each do |role,json| puts " #{role}.json" if [:verbose] bucket.objects.create("#{@config['folder']}/#{role}.json", json) end self # return outputer object for specs end |