<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>begin rails end - Home</title>
  <id>tag:khurramvirani.com,2008:mephisto/</id>
  <generator uri="http://mephistoblog.com" version="0.8.0">Mephisto Drax</generator>
  <link href="http://khurramvirani.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://khurramvirani.com/" rel="alternate" type="text/html"/>
  <updated>2008-12-02T21:19:35Z</updated>
  <entry xml:base="http://khurramvirani.com/">
    <author>
      <name>kvirani</name>
    </author>
    <id>tag:khurramvirani.com,2008-11-28:10</id>
    <published>2008-11-28T21:25:00Z</published>
    <updated>2008-12-02T21:19:35Z</updated>
    <category term="Javascript"/>
    <category term="Quicktime"/>
    <category term="apple"/>
    <category term="css3"/>
    <category term="javascript"/>
    <category term="mdialog"/>
    <category term="object"/>
    <category term="overlay"/>
    <category term="quicktime"/>
    <category term="video"/>
    <link href="http://khurramvirani.com/2008/11/28/mdialog-new-quicktime-based-embedded-player" rel="alternate" type="text/html"/>
    <title>mDialog's New QT-based Embedded Video Player</title>
<content type="html">
            &lt;p&gt;&lt;a href=&quot;http://www.mdialog.com&quot;&gt;mDialog&lt;/a&gt; (a Hi-Def Video Content Delivery Platform that I do development for) just introduced their brand spanking new embedded video player that I was fortunate enough to have the opportunity of helping them build. Although you may be deceived, this player is NOT FLASH based. It uses fancy technologies including (but not limited to) Javascript, transparent overlays, Browser-specific CSS, &lt;a href=&quot;http://www.css3.info/&quot;&gt;CSS3&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/HTML_5&quot;&gt;HTML5&lt;/a&gt; and last but not least, &lt;a href=&quot;http://www.apple.com/quicktime&quot;&gt;Apple's Quicktime&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt; Go ahead, try it out :) ... &lt;/strong&gt;
&lt;/p&gt;
&lt;br /&gt;
&amp;lt;iframe src=&quot;http://www.mdialog.com/embed/video/13356-how-to-video-podcast?width=630&amp;amp;channelmode=1&quot; height=&quot;382px&quot; width=&quot;630px&quot;&gt; &amp;lt;/iframe&gt;

&lt;p&gt;One huge benefit to using this embed over other flash based ones is the exposure to iPhone users. Flash based embeds have a big problem on the iPhone but Quicktime obviously doesn't so mDialog's embed works really well on the iPhone.&lt;/p&gt;

&lt;p&gt;Since Safari is the only major browser at this point in time to support CSS3 (somewhat), this player is best viewed in Safari.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://khurramvirani.com/">
    <author>
      <name>kvirani</name>
    </author>
    <id>tag:khurramvirani.com,2008-03-31:9</id>
    <published>2008-03-31T15:34:00Z</published>
    <updated>2008-03-31T17:23:42Z</updated>
    <category term="Rails"/>
    <category term="aws"/>
    <category term="library"/>
    <category term="patch"/>
    <category term="rails"/>
    <category term="s3"/>
    <link href="http://khurramvirani.com/2008/3/31/aws-s3-missing-path-method-for-logs" rel="alternate" type="text/html"/>
    <title>AWS S3 missing path method for logs</title>
<content type="html">
            &lt;p&gt;One small issue with the current version (0.4.0) of the AWS/S3 ruby library is that there is no way to determine the name or path for an instance of an s3 log file (&lt;a href=&quot;http://amazon.rubyforge.org/doc/classes/AWS/S3/Logging/Log.html&quot;&gt;AWS::S3::Logging:Log&lt;/a&gt;) &#8230;&lt;/p&gt;

&lt;pre class=&quot;textmate-source vibrant_ink&quot;&gt;&lt;span class=&quot;linenum&quot;&gt;    1&lt;/span&gt; &lt;span class=&quot;source source_ruby&quot;&gt;&lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;aws/s3&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    2&lt;/span&gt; s3_logs &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;AWS&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;S3&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Bucket&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;logs_for &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;AWS_S3_BUCKET&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    3&lt;/span&gt; s3_logs&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;each &lt;span class=&quot;keyword keyword_control keyword_control_start-block keyword_control_start-block_ruby&quot;&gt;do &lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_block variable_other_block_ruby&quot;&gt;s3_log&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby&quot;&gt;|&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    4&lt;/span&gt; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;  &lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; This will raise an exception b/c AWS::S3::Logging:Log class has no path attribute!
&lt;/span&gt;&lt;span class=&quot;linenum&quot;&gt;    5&lt;/span&gt;   puts &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;Loading log file: &lt;span class=&quot;source source_ruby source_ruby_embedded source_ruby_embedded_source&quot;&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;#{&lt;/span&gt;s3_log&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;path&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    6&lt;/span&gt; &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Line 5 above will result in an exception b/c that attribute does not exist &#8230;
In fact the only thing you can get from an instance of this object is a collection of the lines within the log file.
In my use of this library, one of the things I needed was the relative path of the log file, so that after processing it, I could record it in the application database.&lt;/p&gt;

&lt;p&gt;If you look in the logging.rb file, you will see something like (note I&#8217;ve removed some lines of code) &#8230; &lt;/p&gt;

&lt;pre class=&quot;textmate-source vibrant_ink&quot;&gt;&lt;span class=&quot;linenum&quot;&gt;    1&lt;/span&gt; &lt;span class=&quot;source source_ruby&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;Log&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    2&lt;/span&gt;   &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;initialize&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable variable_parameter variable_parameter_function variable_parameter_function_ruby&quot;&gt;log_object&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt;:nodoc:
&lt;/span&gt;&lt;span class=&quot;linenum&quot;&gt;    3&lt;/span&gt;     &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;@&lt;/span&gt;log&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; log_object
&lt;span class=&quot;linenum&quot;&gt;    4&lt;/span&gt;   &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    5&lt;/span&gt; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;  &lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; ...
&lt;/span&gt;&lt;span class=&quot;linenum&quot;&gt;    6&lt;/span&gt; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;  &lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; some other stuff here that I've removed b/c it's not important 
&lt;/span&gt;&lt;span class=&quot;linenum&quot;&gt;    7&lt;/span&gt; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;  &lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; ...
&lt;/span&gt;&lt;span class=&quot;linenum&quot;&gt;    8&lt;/span&gt;   &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;inspect&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt;:nodoc:
&lt;/span&gt;&lt;span class=&quot;linenum&quot;&gt;    9&lt;/span&gt;     &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;#&amp;lt;%s:0x%s '%s'&amp;gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;class&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;name&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby&quot;&gt;,&lt;/span&gt; object_id&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby&quot;&gt;,&lt;/span&gt; log&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;path&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   10&lt;/span&gt;   &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   11&lt;/span&gt;   
&lt;span class=&quot;linenum&quot;&gt;   12&lt;/span&gt;   &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;private&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   13&lt;/span&gt;     &lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;attr_reader&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby&quot;&gt;:&lt;/span&gt;log&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   14&lt;/span&gt; 
&lt;span class=&quot;linenum&quot;&gt;   15&lt;/span&gt; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;  &lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; ... some other stuff ...
&lt;/span&gt;&lt;span class=&quot;linenum&quot;&gt;   16&lt;/span&gt; &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;So the log instance variable is made private but it has a .path attribute being used by the inspect method.
That makes life easy&#8230; all we have to do to expose the .path attribute is create the following monkey patch:&lt;/p&gt;

&lt;pre class=&quot;textmate-source vibrant_ink&quot;&gt;&lt;span class=&quot;linenum&quot;&gt;    1&lt;/span&gt; &lt;span class=&quot;source source_ruby&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;AWS::S3::Logging::Log&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    2&lt;/span&gt;   &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;path&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    3&lt;/span&gt;     &lt;span class=&quot;keyword keyword_control keyword_control_pseudo-method keyword_control_pseudo-method_ruby&quot;&gt;return&lt;/span&gt; log&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;path
&lt;span class=&quot;linenum&quot;&gt;    4&lt;/span&gt;   &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    5&lt;/span&gt; &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Save it as a .rb file in your application&#8217;s lib directory (eg: aws_patch.rb) and require it before you make the call: &lt;/p&gt;

&lt;pre class=&quot;textmate-source vibrant_ink&quot;&gt;&lt;span class=&quot;linenum&quot;&gt;    1&lt;/span&gt; &lt;span class=&quot;source source_ruby&quot;&gt;&lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;aws/s3&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    2&lt;/span&gt; &lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;aws_patch&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    3&lt;/span&gt; s3_logs &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;AWS&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;S3&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Bucket&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;logs_for &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;AWS_S3_BUCKET&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    4&lt;/span&gt; s3_logs&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;each &lt;span class=&quot;keyword keyword_control keyword_control_start-block keyword_control_start-block_ruby&quot;&gt;do &lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_block variable_other_block_ruby&quot;&gt;s3_log&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_variable punctuation_separator_variable_ruby&quot;&gt;|&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    5&lt;/span&gt; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;  &lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; This will no longer raise an exception
&lt;/span&gt;&lt;span class=&quot;linenum&quot;&gt;    6&lt;/span&gt;   puts &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;&quot;&lt;/span&gt;Loading log file: &lt;span class=&quot;source source_ruby source_ruby_embedded source_ruby_embedded_source&quot;&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;#{&lt;/span&gt;s3_log&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;path&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    7&lt;/span&gt; &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Remember that (for obvious reasons) you cannot apply this fix before requiring &#8216;aws/s3&#8217; , only after (see example above).&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://khurramvirani.com/">
    <author>
      <name>kvirani</name>
    </author>
    <id>tag:khurramvirani.com,2008-03-27:7</id>
    <published>2008-03-27T03:59:00Z</published>
    <updated>2008-03-28T21:49:21Z</updated>
    <category term="Rails"/>
    <category term="Ruby"/>
    <category term="aws/s3"/>
    <category term="date"/>
    <category term="rails"/>
    <category term="ruby"/>
    <link href="http://khurramvirani.com/2008/3/27/date-abbr_months-issue-in-aws-s3-ruby-library-2" rel="alternate" type="text/html"/>
    <title>Date::ABBR_MONTHS issue in AWS S3 Ruby Library</title>
<content type="html">
            &lt;p&gt;In the &lt;a href=&quot;http://amazon.rubyforge.org/&quot; title=&quot;AWS S3 Ruby Library&quot;&gt;aws/s3 ruby library&lt;/a&gt; you will find the following piece of code under logging.rb:&lt;/p&gt;

&lt;pre class=&quot;textmate-source vibrant_ink&quot;&gt;&lt;span class=&quot;source source_ruby&quot;&gt;datetime&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;sub!&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;month&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;ABBR_MONTHS&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;[&lt;/span&gt;month&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;downcase&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;to_s&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;It will result in the following exception for &lt;em&gt;some&lt;/em&gt; versions of Ruby, but apparently &lt;a href=&quot;http://www.cgiphp.com/about11567.html&quot;&gt;not all versions&lt;/a&gt;&lt;/p&gt;

&lt;pre class=&quot;textmate-source&quot;&gt;&lt;span class=&quot;source source_ruby&quot;&gt;&lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;NameError&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;:&lt;/span&gt; uninitialized constant &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;ABBR_MONTHS&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Oddly enough, according to the Standard Ruby Documentation, this constant &lt;em&gt;should&lt;/em&gt; exist right in the &lt;a href=&quot;http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/classes/Date.html&quot;&gt;Date class&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But, If you do some digging you will find that the actual place for the constant is:  &lt;/p&gt;

&lt;pre class=&quot;textmate-source&quot;&gt;&lt;span class=&quot;source source_ruby&quot;&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Format&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;ABBR_MONTHS&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;I came across this error when trying to call the &lt;em&gt;attributes&lt;/em&gt; method on &lt;a href=&quot;http://amazon.rubyforge.org/doc/classes/AWS/S3/Logging/Log/Line.html#M000018&quot;&gt;AWS::S3::Logging::Log::Line&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So that leaves me with a few questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How did the aws/s3 code work for the developers that wrote it ? The most plausible explanation, especially given the rDocs, is that perhaps they were using a different version of Ruby &#8230;&lt;/li&gt;
&lt;li&gt;If so, how come the constant has been moved around?&lt;/li&gt;
&lt;li&gt;How do I get around this issue without monkey patching the AWS/S3 Gem ?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Resolution&lt;/h3&gt;

&lt;p&gt;Instead of overwriting the faulty function in the AWS/S3 Ruby library, I decided instead to add the constant to the Date class.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a file under lib folder called date_fix.rb&lt;/li&gt;
&lt;li&gt;Place the following code within it: &lt;/li&gt;
&lt;/ul&gt;

&lt;pre class=&quot;textmate-source vibrant_ink&quot;&gt;&lt;span class=&quot;linenum&quot;&gt;    1&lt;/span&gt; &lt;span class=&quot;source source_ruby&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;Date&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    2&lt;/span&gt;   &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;ABBR_MONTHS&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Format&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;ABBR_MONTHS&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    3&lt;/span&gt; &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;Require the file in your environment.rb or if you want the change to be less global, require the file where ever you are using code that needs the patch:  &lt;pre class=&quot;textmate-source vibrant_ink&quot;&gt;&lt;span class=&quot;source source_ruby&quot;&gt;&lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;date_fix&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I think this approach is better than the other alternatives (upgrading Ruby from &lt;em&gt;patchlevel 111&lt;/em&gt; to &lt;em&gt;patchlevel 114&lt;/em&gt; in hopes of fixing the issue (it probably won&#8217;t) or monkey patching the aws/s3 library) because it is non-intrusive. We&#8217;re simply adding a constant to a class so no code dependencies can be broken by the change.&lt;/p&gt;

&lt;p&gt;However, in case you want you change fix the AWS/S3 function instead, do this instead:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a file under lib folder called &lt;em&gt;s3_aws_fix.rb&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Please the following code within it: &lt;/li&gt;
&lt;/ul&gt;

&lt;pre class=&quot;textmate-source vibrant_ink&quot;&gt;&lt;span class=&quot;linenum&quot;&gt;    1&lt;/span&gt; &lt;span class=&quot;source source_ruby&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;AWS::S3::Logging::Log&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    2&lt;/span&gt; &lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;  &lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;Line&lt;/span&gt;&lt;/span&gt; 
&lt;span class=&quot;linenum&quot;&gt;    3&lt;/span&gt; &lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;    &lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;&lt;span class=&quot;variable variable_other variable_other_object variable_other_object_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; self&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    4&lt;/span&gt; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;      &lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt; Time.parse doesn't like %d/%B/%Y:%H:%M:%S %z so we have to transform it unfortunately
&lt;/span&gt;&lt;span class=&quot;linenum&quot;&gt;    5&lt;/span&gt;       &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_with-arguments meta_function_method_with-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;typecast_time&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;variable variable_parameter variable_parameter_function variable_parameter_function_ruby&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_ruby&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby&quot;&gt;#&lt;/span&gt;:nodoc:
&lt;/span&gt;&lt;span class=&quot;linenum&quot;&gt;    6&lt;/span&gt;         month &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; datetime&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;string string_regexp string_regexp_classic string_regexp_classic_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;string string_regexp string_regexp_character-class string_regexp_character-class_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby&quot;&gt;[&lt;/span&gt;a-z&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_character-class punctuation_definition_character-class_ruby&quot;&gt;]&lt;/span&gt;&lt;/span&gt;+&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_ruby&quot;&gt;/i&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    7&lt;/span&gt;         datetime&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;sub!&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string string_regexp string_regexp_mod-r string_regexp_mod-r_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;%r|&lt;/span&gt;^&lt;span class=&quot;string string_regexp string_regexp_group string_regexp_group_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_group punctuation_definition_group_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;constant constant_character constant_character_escape constant_character_escape_ruby&quot;&gt;\w&lt;/span&gt;&lt;span class=&quot;string string_regexp string_regexp_arbitrary-repitition string_regexp_arbitrary-repitition_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_arbitrary-repitition punctuation_definition_arbitrary-repitition_ruby&quot;&gt;{&lt;/span&gt;2&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_arbitrary-repitition punctuation_definition_arbitrary-repitition_ruby&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_group punctuation_definition_group_ruby&quot;&gt;)&lt;/span&gt;&lt;/span&gt;/&lt;span class=&quot;string string_regexp string_regexp_group string_regexp_group_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_group punctuation_definition_group_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;constant constant_character constant_character_escape constant_character_escape_ruby&quot;&gt;\w&lt;/span&gt;&lt;span class=&quot;string string_regexp string_regexp_arbitrary-repitition string_regexp_arbitrary-repitition_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_arbitrary-repitition punctuation_definition_arbitrary-repitition_ruby&quot;&gt;{&lt;/span&gt;3&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_arbitrary-repitition punctuation_definition_arbitrary-repitition_ruby&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_group punctuation_definition_group_ruby&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;|&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;\2/\1&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    8&lt;/span&gt;         datetime&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;sub!&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;month&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;constants&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;member?&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;ABBR_MONTHS&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;ABBR_MONTHS&lt;/span&gt; &lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Format&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;ABBR_MONTHS&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;[&lt;/span&gt;month&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;downcase&lt;span class=&quot;punctuation punctuation_section punctuation_section_array punctuation_section_array_ruby&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;to_s&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;    9&lt;/span&gt;         datetime&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;sub!&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt;:&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_object punctuation_separator_object_ruby&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby&quot;&gt;'&lt;/span&gt; &lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   10&lt;/span&gt;         &lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Time&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby&quot;&gt;.&lt;/span&gt;parse&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;(&lt;/span&gt;datetime&lt;span class=&quot;punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   11&lt;/span&gt;       &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt; 
&lt;span class=&quot;linenum&quot;&gt;   12&lt;/span&gt;     &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   13&lt;/span&gt;   &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;linenum&quot;&gt;   14&lt;/span&gt; &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;Require the file in your &lt;em&gt;environment.rb&lt;/em&gt; &lt;strong&gt;after&lt;/strong&gt; the require &#8216;aws/s3&#8217; call or any where else. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;I was using:&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;AWS / S3 Ruby Gem Version: 0.4.0&lt;/li&gt;
&lt;li&gt;Ruby version 1.8.6 patch level 111 (the one that comes with Mac OSX I believe)&lt;/li&gt;
&lt;/ul&gt;
          </content>  </entry>
</feed>
