Skip to content
Browse files

added rake uploader deploy rake task

  • Loading branch information...
1 parent 8478327 commit 0160963cdba9064ba45600668ee6a3f10bdf1075 Nico committed Feb 22, 2012
View
257 .idea/workspace.xml
@@ -22,93 +22,97 @@
</component>
<component name="FileEditorManager">
<leaf>
- <file leaf-file-name="uploads_controller.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/app/controllers/uploads_controller.rb">
+ <file leaf-file-name="s3_uploader.js" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/app/assets/javascripts/s3_uploader/s3_uploader.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="21" column="19" selection-start="490" selection-end="490" vertical-scroll-proportion="-16.961538">
+ <state line="37" column="16" selection-start="1189" selection-end="1189" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="uploads_helper.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/app/helpers/uploads_helper.rb">
+ <file leaf-file-name="jquery.iframe-transport.js" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/app/assets/javascripts/s3_uploader/jquery.iframe-transport.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="11" column="44" selection-start="477" selection-end="477" vertical-scroll-proportion="-8.038462">
- <folding />
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <folding>
+ <element signature="n#!!doc" expanded="true" />
+ </folding>
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="upload.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/app/models/upload.rb">
+ <file leaf-file-name="jquery.fileupload.js" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/app/assets/javascripts/s3_uploader/jquery.fileupload.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="1" column="0" selection-start="34" selection-end="34" vertical-scroll-proportion="0.0">
- <folding />
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <folding>
+ <element signature="n#!!doc" expanded="true" />
+ </folding>
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="s3_uploader.js" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/app/assets/javascripts/s3_uploader/s3_uploader.js">
+ <file leaf-file-name="uplader.rake" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/lib/tasks/uplader.rake">
<provider selected="true" editor-type-id="text-editor">
- <state line="25" column="14" selection-start="839" selection-end="839" vertical-scroll-proportion="0.0">
+ <state line="29" column="59" selection-start="844" selection-end="873" vertical-scroll-proportion="1.041588">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="application.js" pinned="false" current="true" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/app/assets/javascripts/application.js">
+ <file leaf-file-name="_uploader.html.haml" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/app/views/uploads/_uploader.html.haml">
<provider selected="true" editor-type-id="text-editor">
- <state line="15" column="0" selection-start="642" selection-end="642" vertical-scroll-proportion="0.49222797">
- <folding>
- <element signature="n#!!doc" expanded="true" />
- </folding>
+ <state line="6" column="87" selection-start="219" selection-end="219" vertical-scroll-proportion="0.0">
+ <folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="environment.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/config/environment.rb">
+ <file leaf-file-name="index.html.haml" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/app/views/uploads/index.html.haml">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="2" column="15" selection-start="58" selection-end="58" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="application.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/config/application.rb">
+ <file leaf-file-name="uploads_helper.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/app/helpers/uploads_helper.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="53" column="34" selection-start="2597" selection-end="2597" vertical-scroll-proportion="0.0">
+ <state line="22" column="31" selection-start="1030" selection-end="1030" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="production.rb" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/config/environments/production.rb">
+ <file leaf-file-name="uploads_controller.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/app/controllers/uploads_controller.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="14" column="32" selection-start="546" selection-end="546" vertical-scroll-proportion="0.0">
+ <state line="5" column="2" selection-start="68" selection-end="68" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="index.html.haml" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/app/views/uploads/index.html.haml">
+ <file leaf-file-name="application.js" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/app/assets/javascripts/application.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="2" column="15" selection-start="58" selection-end="58" vertical-scroll-proportion="0.0">
- <folding />
+ <state line="15" column="0" selection-start="642" selection-end="642" vertical-scroll-proportion="0.0">
+ <folding>
+ <element signature="n#!!doc" expanded="true" />
+ </folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="uploads.js.coffee.erb" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/assets/javascripts/uploads.js.coffee.erb">
<provider selected="true" editor-type-id="text-editor">
- <state line="49" column="91" selection-start="1517" selection-end="1517" vertical-scroll-proportion="-9.576923">
+ <state line="18" column="8" selection-start="573" selection-end="573" vertical-scroll-proportion="-1.5384616">
<folding />
</state>
</provider>
@@ -127,22 +131,22 @@
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
- <option value="$PROJECT_DIR$/config/initializers/load_config.rb" />
- <option value="$PROJECT_DIR$/app/views/layouts/application.html.haml" />
- <option value="$PROJECT_DIR$/Gemfile" />
<option value="$PROJECT_DIR$/app/models/upload.rb" />
<option value="$PROJECT_DIR$/db/migrate/20120216184202_create_uploads.rb" />
<option value="$PROJECT_DIR$/config/routes.rb" />
<option value="$PROJECT_DIR$/app/assets/stylesheets/uploads.css.scss" />
<option value="$PROJECT_DIR$/app/views/uploads/_uploader.html.haml" />
<option value="$PROJECT_DIR$/app/assets/javascripts/application.js" />
- <option value="$PROJECT_DIR$/app/helpers/uploads_helper.rb" />
- <option value="$PROJECT_DIR$/app/controllers/uploads_controller.rb" />
<option value="$PROJECT_DIR$/app/views/uploads/index.html.haml" />
<option value="$PROJECT_DIR$/config/application.rb" />
<option value="$PROJECT_DIR$/app/assets/javascripts/uploads.js.coffee" />
<option value="$PROJECT_DIR$/config/environments/production.rb" />
+ <option value="$PROJECT_DIR$/app/assets/javascripts/uploads.js.coffee.erb" />
<option value="$PROJECT_DIR$/app/assets/javascripts/s3_uploader/s3_uploader.js" />
+ <option value="$PROJECT_DIR$/app/controllers/uploads_controller.rb" />
+ <option value="$PROJECT_DIR$/config/amazon_s3.yml" />
+ <option value="$PROJECT_DIR$/lib/tasks/uplader.rake" />
+ <option value="$PROJECT_DIR$/app/helpers/uploads_helper.rb" />
</list>
</option>
</component>
@@ -156,7 +160,7 @@
<component name="ProjectFrameBounds">
<option name="y" value="22" />
<option name="width" value="1280" />
- <option name="height" value="880" />
+ <option name="height" value="879" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
@@ -260,7 +264,25 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="db" />
+ <option name="myItemId" value="lib" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="tasks" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="html5_s3_uploader" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="html5_s3_uploader" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="lib" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -277,8 +299,58 @@
<option name="myItemId" value="db" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="html5_s3_uploader" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="html5_s3_uploader" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="views" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="uploads" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="html5_s3_uploader" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="html5_s3_uploader" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="views" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="html5_s3_uploader" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="html5_s3_uploader" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="migrate" />
+ <option name="myItemId" value="app" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -292,7 +364,11 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="config" />
+ <option name="myItemId" value="app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="helpers" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -306,11 +382,11 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="config" />
+ <option name="myItemId" value="app" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="environments" />
+ <option name="myItemId" value="controllers" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -327,6 +403,10 @@
<option name="myItemId" value="app" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="assets" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
</PATH>
</subPane>
</pane>
@@ -663,18 +743,18 @@
<servers />
</component>
<component name="ToolWindowManager">
- <frame x="0" y="22" width="1280" height="880" extended-state="0" />
+ <frame x="0" y="22" width="1280" height="879" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Data Sources" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.21672077" sideWeight="0.84231275" order="0" side_tool="false" content_ui="combo" />
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.23295455" sideWeight="0.7605263" order="0" side_tool="false" content_ui="combo" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
- <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.15768725" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.23947369" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
@@ -739,120 +819,117 @@
<breakpoint-manager />
</component>
<component name="editorHistoryManager">
- <entry file="file://$PROJECT_DIR$/app/helpers/application_helper.rb">
+ <entry file="file://$PROJECT_DIR$/app/assets/stylesheets/uploads.css.scss">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="35" column="5" selection-start="566" selection-end="566" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/config/amazon_s3.yml">
+ <entry file="file://$PROJECT_DIR$/app/models/upload.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="10" column="13" selection-start="434" selection-end="445" vertical-scroll-proportion="0.0">
+ <state line="1" column="0" selection-start="34" selection-end="34" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/db/migrate/20120216184202_create_uploads.rb">
+ <entry file="file://$PROJECT_DIR$/config/environment.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="12" column="20" selection-start="231" selection-end="231" vertical-scroll-proportion="0.0">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/config/routes.rb">
+ <entry file="file://$PROJECT_DIR$/config/application.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="5" column="3" selection-start="100" selection-end="100" vertical-scroll-proportion="0.0">
+ <state line="53" column="34" selection-start="2597" selection-end="2597" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/app/assets/stylesheets/uploads.css.scss">
+ <entry file="file://$PROJECT_DIR$/config/environments/production.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="35" column="5" selection-start="566" selection-end="566" vertical-scroll-proportion="0.0">
+ <state line="14" column="32" selection-start="546" selection-end="546" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/app/views/uploads/_uploader.html.haml">
+ <entry file="file://$PROJECT_DIR$/app/assets/javascripts/uploads.js.coffee.erb">
<provider selected="true" editor-type-id="text-editor">
- <state line="6" column="87" selection-start="219" selection-end="219" vertical-scroll-proportion="0.0">
+ <state line="18" column="8" selection-start="573" selection-end="573" vertical-scroll-proportion="-1.5384616">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/app/models/upload.rb">
+ <entry file="file://$PROJECT_DIR$/app/assets/javascripts/application.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="1" column="0" selection-start="34" selection-end="34" vertical-scroll-proportion="0.0">
- <folding />
+ <state line="15" column="0" selection-start="642" selection-end="642" vertical-scroll-proportion="0.0">
+ <folding>
+ <element signature="n#!!doc" expanded="true" />
+ </folding>
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/app/views/uploads/index.html.haml">
+ <entry file="file://$PROJECT_DIR$/app/assets/javascripts/s3_uploader/jquery.iframe-transport.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="2" column="15" selection-start="58" selection-end="58" vertical-scroll-proportion="0.0">
- <folding />
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <folding>
+ <element signature="n#!!doc" expanded="true" />
+ </folding>
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/app/controllers/uploads_controller.rb">
+ <entry file="file://$PROJECT_DIR$/app/assets/javascripts/s3_uploader/jquery.fileupload.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="21" column="19" selection-start="490" selection-end="490" vertical-scroll-proportion="-16.961538">
- <folding />
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <folding>
+ <element signature="n#!!doc" expanded="true" />
+ </folding>
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/app/helpers/uploads_helper.rb">
+ <entry file="file://$PROJECT_DIR$/app/assets/javascripts/s3_uploader/s3_uploader.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="11" column="44" selection-start="477" selection-end="477" vertical-scroll-proportion="-8.038462">
+ <state line="37" column="16" selection-start="1189" selection-end="1189" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/config/environment.rb">
+ <entry file="file://$PROJECT_DIR$/app/controllers/uploads_controller.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="5" column="2" selection-start="68" selection-end="68" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/config/application.rb">
+ <entry file="file://$PROJECT_DIR$/app/views/uploads/_uploader.html.haml">
<provider selected="true" editor-type-id="text-editor">
- <state line="53" column="34" selection-start="2597" selection-end="2597" vertical-scroll-proportion="0.0">
+ <state line="6" column="87" selection-start="219" selection-end="219" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/app/assets/javascripts/uploads.js.coffee.erb">
+ <entry file="file://$PROJECT_DIR$/app/views/uploads/index.html.haml">
<provider selected="true" editor-type-id="text-editor">
- <state line="49" column="91" selection-start="1517" selection-end="1517" vertical-scroll-proportion="-9.576923">
+ <state line="2" column="15" selection-start="58" selection-end="58" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/config/environments/production.rb">
+ <entry file="file://$PROJECT_DIR$/app/helpers/uploads_helper.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="14" column="32" selection-start="546" selection-end="546" vertical-scroll-proportion="0.0">
+ <state line="22" column="31" selection-start="1030" selection-end="1030" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/app/assets/javascripts/s3_uploader/s3_uploader.js">
+ <entry file="file://$PROJECT_DIR$/lib/tasks/uplader.rake">
<provider selected="true" editor-type-id="text-editor">
- <state line="25" column="14" selection-start="839" selection-end="839" vertical-scroll-proportion="0.0">
+ <state line="29" column="59" selection-start="844" selection-end="873" vertical-scroll-proportion="1.041588">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/app/assets/javascripts/application.js">
- <provider selected="true" editor-type-id="text-editor">
- <state line="15" column="0" selection-start="642" selection-end="642" vertical-scroll-proportion="0.49222797">
- <folding>
- <element signature="n#!!doc" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
</component>
</project>
View
2 app/assets/javascripts/s3_uploader/s3_uploader.js
@@ -34,7 +34,7 @@ jQuery(function() {
return sRnd;
}
- $(window).bind("message", function (e) {
+ $(window).on("message", function (e) {
event.preventDefault();
if (e.originalEvent.origin !== host)
return;
View
2 app/assets/javascripts/uploads.js.coffee.erb
@@ -17,7 +17,7 @@ jQuery ->
$('#uploader iframe')[0].contentWindow.postMessage({ eventType: 'abort upload', uuid: uuid }, uploaderHost);
- $(window).bind "message", (event) ->
+ $(window).on "message", (event) ->
event = event.originalEvent
View
22 app/controllers/uploads_controller.rb
@@ -2,33 +2,11 @@
class UploadsController < ApplicationController
def index
- uploader_html = render_to_string( partial: 'uploads/uploader' )
- ensure_s3_connection!
- AWS::S3::S3Object.store(
- 'uploader/uploader.html',
- uploader_html,
- S3_CONFIG['bucket_name'],
- :access => :public_read
- )
end
-
def create
@upload = Upload.new(params[:upload] || params.delete_if{ |p| !Upload.attribute_names.include?(p) })
render nothing: true if @upload.save
end
-
- private
-
- def ensure_s3_connection!
- unless @connected
- AWS::S3::Base.establish_connection!(
- :access_key_id => S3_CONFIG['access_key_id'],
- :secret_access_key => S3_CONFIG['secret_access_key']
- )
- @connected = true
- end
- end
-
end
View
10 app/helpers/uploads_helper.rb
@@ -8,13 +8,13 @@ def s3_uploader options = {}
options[:resource_name] ||= controller_name.singularize
upload_params = { key: s3_key(options[:uploaded_files_path]),
- AWSAccessKeyId: S3_CONFIG['access_key_id'],
+ AWSAccessKeyId: ENV['S3_UPLOADER_ACCESS_KEY'],
bucket: s3_bucket_url,
_policy: s3_policy(path: options[:uploaded_files_path]),
_signature: s3_signature(path: options[:uploaded_files_path]) }.to_query
content_tag :iframe, '',
- src: "http://#{S3_CONFIG['bucket_name']}.s3.amazonaws.com/#{options[:uploader_path]}?#{upload_params}",
+ src: "http://#{ENV['S3_UPLOADER_BUCKET']}.s3.amazonaws.com/#{options[:uploader_path]}?#{upload_params}",
frameborder: 0,
height: options[:iframe_height] || 60,
width: options[:iframe_width] || 500,
@@ -23,7 +23,7 @@ def s3_uploader options = {}
def s3_bucket_url
- "http://#{S3_CONFIG['bucket_name']}.s3.amazonaws.com/"
+ "http://#{ENV['S3_UPLOADER_BUCKET']}.s3.amazonaws.com/"
end
@@ -41,7 +41,7 @@ def s3_policy options = {}
Base64.encode64(
"{'expiration': '#{10.hours.from_now.utc.strftime('%Y-%m-%dT%H:%M:%S.000Z')}',
'conditions': [
- {'bucket': '#{S3_CONFIG['bucket_name']}'},
+ {'bucket': '#{ENV['S3_UPLOADER_BUCKET']}'},
['starts-with', '$key', ''],
{'acl': '#{options[:acl]}'},
{'success_action_status': '201'},
@@ -56,7 +56,7 @@ def s3_signature options = {}
Base64.encode64(
OpenSSL::HMAC.digest(
OpenSSL::Digest::Digest.new('sha1'),
- S3_CONFIG['secret_access_key'], s3_policy(options))).gsub("\n","")
+ ENV['S3_UPLOADER_SECRET_ACCESS_KEY'], s3_policy(options))).gsub("\n","")
end
View
3 config/initializers/load_config.rb
@@ -1,3 +0,0 @@
-S3_CONFIG = YAML.load_file("#{Rails.root}/config/amazon_s3.yml")[Rails.env]
-
-
View
37 lib/tasks/uplader.rake
@@ -0,0 +1,37 @@
+namespace :uploader do
+
+ task deploy: :environment do
+ av = ActionView::Base.new(Rails.root.join('app', 'views'))
+ uploader_html = av.render 'uploads/uploader'
+ ensure_s3_connection!
+ AWS::S3::S3Object.store(
+ 'uploader/uploader.html',
+ uploader_html,
+ ENV['S3_UPLOADER_BUCKET'],
+ :access => :public_read )
+
+ ['jquery.fileupload.js', 'jquery.iframe-transport.js', 's3_uploader.js'].each do |js_file|
+ AWS::S3::S3Object.store(
+ "uploader/js/#{js_file}",
+ open("#{Rails.root}/app/assets/javascripts/s3_uploader/#{js_file}"),
+ ENV['S3_UPLOADER_BUCKET'],
+ :access => :public_read )
+ end
+ puts 'Uploader deployed.'
+ end
+
+
+ private
+
+
+ def ensure_s3_connection!
+ unless @connected
+ AWS::S3::Base.establish_connection!(
+ :access_key_id => ENV['S3_UPLOADER_ACCESS_KEY'],
+ :secret_access_key => ENV['S3_UPLOADER_SECRET_ACCESS_KEY']
+ )
+ @connected = true
+ end
+ end
+
+end

0 comments on commit 0160963

Please sign in to comment.
Something went wrong with that request. Please try again.