Skip to content

Instantly share code, notes, and snippets.

{"playlists"=>
[{"id"=>"2011",
"title"=>"test playlist",
"client_id"=>"1403",
"date_start"=>"0",
"date_end"=>"0",
"time_start"=>"0",
"time_end"=>"0",
"assets"=>
[{"id"=>"2003",
if current_playlist_published < new_playlist_published
new_playlist["playlists"][0]["assets"].each do |asset|
url_path = url + asset['path'] + 'files/' + asset["title"]
local_file = web_dir + asset["title"]
file_list = []
file_list << asset["title"]
File.open(web_dir + 'playlist.json', 'w') {|f| f.write(new_playlist_raw) }
if FileTest.exists?(local_file)
pp "#{local_file} ---File Exists Not Downloading---"
new_playlist["playlists"][0]["assets"].each do |asset|
url_path = url + asset['path'] + 'files/' + asset["title"]
local_file = web_dir + asset["title"]
File.open(web_dir + 'playlist.json', 'w') {|f| f.write(new_playlist_raw) }
if FileTest.exists?(local_file)
pp "#{local_file} ---File Exists Not Downloading---"
else
open( web_dir + asset["title"], 'wb') do |file|
file << open(url_path).read
end
Dir.foreach(web_dir) do |f|
pp f
pp new_playlist["playlists"][0]["assets"].any? {|a| a[:title] == f }
end
# ASSET HASH STRUCTURE
# {"id"=>"1855",
# "title"=>"BBQMay2010.swf",
# "client_id"=>"1403",
# "path"=>"/sites/default/files/assets/1403/",
# "type"=>"swf",
# "modified"=>"20121128",
# "date_start"=>"0",
# "date_end"=>"0",
# "time_start"=>"0",
Hash
{"playlists"=>
[{"id"=>"1848",
"title"=>"Playlist test",
"client_id"=>"1403",
"date_start"=>"0",
"date_end"=>"0",
"time_start"=>"0",
"time_end"=>"0",
"assets"=>
ActionView::Template::Error (undefined method `first_name' for #<User:0x00000008ff51d8>):
2012-12-07T15:42:07+00:00 app[web.1]: 49: <%= f.text_field :first_name, :class => "xlarge", :placeholder => "First Name" %>
2012-12-07T15:42:07+00:00 app[web.1]: 46: <%= form_for(resource, :as => resource_name,:url => registration_path(resource_name),:html => {:multipart => true}) do |f| %>
2012-12-07T15:42:07+00:00 app[web.1]: 47: <%= devise_error_messages! %>
2012-12-07T15:42:07+00:00 app[web.1]: app/views/users/registrations/new.html.erb:49:in `block in _app_views_users_registrations_new_html_erb__3542012466051859277_76777520'
2012-12-07T15:42:07+00:00 app[web.1]: 48:
2012-12-07T15:42:07+00:00 app[web.1]: app/views/users/registrations/new.html.erb:46:in `_app_views_users_registrations_new_html_erb__3542012466051859277_76777520'
2012-12-07T15:42:07+00:00 app[web.1]:
2012-12-07T15:42:07+00:00 app[web.1]: 50: <%= f.text_field :last_name, :class => "xlarge", :placeholder => "Last Name" %
<%= form_for(resource, :as => resource_name,:url => registration_path(resource_name),:html => {:multipart => true}) do |f| %>
<%= devise_error_messages! %>
<%= f.text_field :first_name, :class => "xlarge", :placeholder => "First Name" %>
<%= f.text_field :last_name, :class => "xlarge", :placeholder => "Last Name" %>
</br>
<%= f.email_field :email, :class => "xlarge", :placeholder => "Email*" %>
<%= f.text_field :phone_number, :class => "xlarge", :placeholder => "Phone Number*" %>
</br>
<%= f.text_field :street_address, :class => "xlarge", :placeholder => "Street" %>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<%= f.text_field :first_name, :class => "xlarge", :placeholder => "First Name" %>
<%= f.text_field :last_name, :class => "xlarge", :placeholder => "Last Name" %>
</br>
<%= f.email_field :email, :class => "xlarge", :placeholder => "Email*" %>
<%= f.text_field :phone_number, :class => "xlarge", :placeholder => "Phone Number*" %>
</br>
<%= f.text_field :street_address, :class => "xlarge", :placeholder => "Street" %>
#!/bin/bash
git add --all
git commit -am $1
git push origin master
git push live master
cap deploy:update
cap deploy:migrate
cap deploy:cleanup -s keep_releases=1
cap deploy:restart