Class: JsFixtures::HTMLS3
- Includes:
- S3Upload
- Defined in:
- lib/js_fixtures/html_s3.rb
Constant Summary
Constants included from S3Upload
S3Upload::AWS_KEY, S3Upload::AWS_SECRET_KEY, S3Upload::HTML_HEADERS
Class Attribute Summary collapse
-
.s3_access_url ⇒ Object
readonly
Returns the value of attribute s3_access_url.
-
.s3_upload_url ⇒ Object
readonly
Returns the value of attribute s3_upload_url.
Attributes inherited from HTML
#post_scripts, #pre_scripts, #scripts
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(name, config) ⇒ HTMLS3
constructor
A new instance of HTMLS3.
Methods included from S3Upload
Methods inherited from HTML
Methods inherited from Base
config, create, generate_all, get
Constructor Details
#initialize(name, config) ⇒ HTMLS3
Returns a new instance of HTMLS3.
18 19 20 21 22 23 24 25 26 |
# File 'lib/js_fixtures/html_s3.rb', line 18 def initialize(name, config) super # Number of seconds since 1970-01-01 00:00:00 UTC # to avoid test collisions from multiple machines suffix = Time.now.strftime("%s") @filename = "#{@name}-#{suffix}.html" @location = "#{self.class.s3_access_url}/#{@filename}" end |
Class Attribute Details
.s3_access_url ⇒ Object (readonly)
Returns the value of attribute s3_access_url.
9 10 11 |
# File 'lib/js_fixtures/html_s3.rb', line 9 def s3_access_url @s3_access_url end |
.s3_upload_url ⇒ Object (readonly)
Returns the value of attribute s3_upload_url.
9 10 11 |
# File 'lib/js_fixtures/html_s3.rb', line 9 def s3_upload_url @s3_upload_url end |
Class Method Details
.s3_path=(s3_path) ⇒ Object
11 12 13 14 |
# File 'lib/js_fixtures/html_s3.rb', line 11 def s3_path=(s3_path) @s3_upload_url = s3_path @s3_access_url = "http://#{s3_path.gsub(':', '/')}" end |
Instance Method Details
#generate ⇒ Object
28 29 30 31 32 |
# File 'lib/js_fixtures/html_s3.rb', line 28 def generate puts "Generating Fixture: #{@name}" super upload_html_file(@local_file, "#{self.class.s3_upload_url}/#{@filename}") end |