From d440b6c5223a7a4e71153316e2c53e3a18fad42e Mon Sep 17 00:00:00 2001 From: "Gun.io Whitespace Robot" Date: Thu, 27 Oct 2011 11:25:47 -0400 Subject: [PATCH] Remove whitespace [Gun.io WhitespaceBot] --- README | 22 +-- app/controllers/application.rb | 12 +- app/controllers/tags_controller.rb | 2 +- app/controllers/users_controller.rb | 6 +- app/controllers/video_replies_controller.rb | 6 +- app/controllers/videos_controller.rb | 6 +- app/controllers/videos_controller.rb~ | 6 +- app/models/thumbnail.rb | 8 +- app/models/video.rb | 20 +-- app/models/video.rb~ | 20 +-- app/views/layouts/application.html.erb | 16 +- app/views/layouts/application.html.erb~ | 16 +- app/views/videos/index.html.erb | 6 +- app/views/videos/index.html.erb~ | 6 +- app/views/videos/new.html.erb | 2 +- app/views/videos/new.html.erb~ | 2 +- app/views/videos/show.html.erb | 20 +-- app/views/videos/show.html.erb~ | 20 +-- config/amazon_s3.yml | 12 +- config/environment.rb | 8 +- config/initializers/inflections.rb | 2 +- config/routes.rb | 2 +- config/routes.rb~ | 2 +- .../20090305184450_create_thumbnails.rb | 6 +- db/schema.rb | 2 +- lib/script/railscasts.rb | 6 +- public/flowplayer/LICENSE.txt | 6 +- public/flowplayer/README.txt | 4 +- public/flowplayer/example/index.html | 62 +++---- public/javascripts/flowplayer.js | 14 +- public/stylesheets/style.css | 46 ++--- test/test_helper.rb | 2 +- .../lib/acts_as_state_machine.rb | 64 +++---- .../test/acts_as_state_machine_test.rb | 52 +++--- .../test/fixtures/conversation.rb | 4 +- .../test/fixtures/conversations.yml | 2 +- .../acts_as_state_machine/test/schema.rb | 2 +- .../acts_as_state_machine/test/test_helper.rb | 2 +- .../lib/acts_as_taggable.rb | 86 ++++----- .../acts_as_taggable_on_steroids/lib/tag.rb | 30 ++-- .../lib/tagging.rb | 2 +- .../test/abstract_unit.rb | 24 +-- .../test/acts_as_taggable_test.rb | 166 +++++++++--------- .../test/fixtures/user.rb | 2 +- vendor/plugins/attachment_fu/CHANGELOG | 2 +- vendor/plugins/attachment_fu/README | 24 +-- .../plugins/attachment_fu/amazon_s3.yml.tpl | 12 +- vendor/plugins/attachment_fu/lib/geometry.rb | 4 +- .../attachment_fu/backends/db_file_backend.rb | 6 +- .../backends/file_system_backend.rb | 20 +-- .../attachment_fu/backends/s3_backend.rb | 30 ++-- .../processors/core_image_processor.rb | 8 +- .../attachment_fu/processors/gd2_processor.rb | 6 +- .../test/backends/db_file_test.rb | 2 +- .../test/backends/file_system_test.rb | 24 +-- .../test/backends/remote/s3_test.rb | 6 +- .../test/base_attachment_tests.rb | 14 +- .../plugins/attachment_fu/test/basic_test.rb | 18 +- .../test/extra_attachment_test.rb | 14 +- .../attachment_fu/test/fixtures/attachment.rb | 2 +- .../attachment_fu/test/geometry_test.rb | 20 +-- .../test/processors/core_image_test.rb | 6 +- .../attachment_fu/test/processors/gd2_test.rb | 6 +- .../test/processors/image_science_test.rb | 6 +- .../test/processors/mini_magick_test.rb | 6 +- .../test/processors/rmagick_test.rb | 66 +++---- vendor/plugins/attachment_fu/test/schema.rb | 18 +- .../plugins/attachment_fu/test/test_helper.rb | 18 +- .../attachment_fu/test/validation_test.rb | 12 +- .../red_artisan/core_image/filters/color.rb | 12 +- .../red_artisan/core_image/filters/effects.rb | 14 +- .../core_image/filters/perspective.rb | 8 +- .../red_artisan/core_image/filters/quality.rb | 12 +- .../red_artisan/core_image/filters/scale.rb | 8 +- .../core_image/filters/watermark.rb | 10 +- .../red_artisan/core_image/processor.rb | 24 +-- vendor/plugins/authlogic/README.rdoc | 8 +- .../lib/authlogic/acts_as_authentic/base.rb | 12 +- .../lib/authlogic/acts_as_authentic/email.rb | 14 +- .../acts_as_authentic/logged_in_status.rb | 10 +- .../lib/authlogic/acts_as_authentic/login.rb | 12 +- .../acts_as_authentic/magic_columns.rb | 2 +- .../authlogic/acts_as_authentic/password.rb | 58 +++--- .../acts_as_authentic/perishable_token.rb | 24 +-- .../acts_as_authentic/persistence_token.rb | 16 +- .../restful_authentication.rb | 10 +- .../acts_as_authentic/session_maintenance.rb | 28 +-- .../acts_as_authentic/single_access_token.rb | 14 +- .../acts_as_authentic/validations_scope.rb | 2 +- .../authenticates_many/association.rb | 6 +- .../lib/authlogic/authenticates_many/base.rb | 4 +- .../controller_adapters/abstract_adapter.rb | 10 +- .../controller_adapters/merb_adapter.rb | 4 +- .../controller_adapters/rails_adapter.rb | 8 +- .../lib/authlogic/crypto_providers/aes256.rb | 6 +- .../lib/authlogic/crypto_providers/bcrypt.rb | 10 +- .../lib/authlogic/crypto_providers/md5.rb | 12 +- .../lib/authlogic/crypto_providers/sha1.rb | 6 +- .../lib/authlogic/crypto_providers/sha512.rb | 6 +- .../plugins/authlogic/lib/authlogic/i18n.rb | 2 +- .../plugins/authlogic/lib/authlogic/random.rb | 12 +- .../lib/authlogic/session/activation.rb | 12 +- .../session/active_record_trickery.rb | 10 +- .../authlogic/lib/authlogic/session/base.rb | 8 +- .../session/brute_force_protection.rb | 18 +- .../lib/authlogic/session/callbacks.rb | 14 +- .../lib/authlogic/session/cookies.rb | 30 ++-- .../lib/authlogic/session/existence.rb | 12 +- .../lib/authlogic/session/foundation.rb | 10 +- .../lib/authlogic/session/http_auth.rb | 4 +- .../authlogic/lib/authlogic/session/id.rb | 6 +- .../authlogic/lib/authlogic/session/klass.rb | 14 +- .../lib/authlogic/session/magic_columns.rb | 16 +- .../lib/authlogic/session/magic_states.rb | 6 +- .../authlogic/lib/authlogic/session/params.rb | 16 +- .../lib/authlogic/session/password.rb | 30 ++-- .../lib/authlogic/session/perishable_token.rb | 2 +- .../lib/authlogic/session/persistence.rb | 4 +- .../lib/authlogic/session/priority_record.rb | 6 +- .../authlogic/lib/authlogic/session/scopes.rb | 14 +- .../lib/authlogic/session/session.rb | 10 +- .../lib/authlogic/session/timeout.rb | 10 +- .../authlogic/session/unauthorized_record.rb | 8 +- .../lib/authlogic/session/validation.rb | 16 +- .../authlogic/lib/authlogic/test_case.rb | 4 +- .../authlogic/test_case/controller_adapter.rb | 8 +- .../authlogic/test_case/mock_controller.rb | 16 +- .../authlogic/test_case/mock_cookie_jar.rb | 2 +- .../authlogic/lib/authlogic/version.rb | 4 +- .../test/acts_as_authentic_test/email_test.rb | 30 ++-- .../logged_in_status_test.rb | 8 +- .../test/acts_as_authentic_test/login_test.rb | 30 ++-- .../magic_columns_test.rb | 6 +- .../acts_as_authentic_test/password_test.rb | 70 ++++---- .../perishable_token_test.rb | 20 +-- .../persistence_token_test.rb | 10 +- .../restful_authentication_test.rb | 10 +- .../session_maintenance_test.rb | 4 +- .../single_access_test.rb | 12 +- .../authlogic/test/authenticates_many_test.rb | 6 +- .../test/crypto_provider_test/aes256_test.rb | 2 +- .../test/crypto_provider_test/bcrypt_test.rb | 2 +- .../test/crypto_provider_test/sha1_test.rb | 4 +- .../test/crypto_provider_test/sha512_test.rb | 2 +- .../authlogic/test/fixtures/companies.yml | 2 +- .../authlogic/test/fixtures/employees.yml | 2 +- .../plugins/authlogic/test/fixtures/users.yml | 2 +- .../plugins/authlogic/test/libs/employee.rb | 2 +- vendor/plugins/authlogic/test/random_test.rb | 6 +- .../test/session_test/activation_test.rb | 8 +- .../active_record_trickery_test.rb | 6 +- .../brute_force_protection_test.rb | 30 ++-- .../test/session_test/cookies_test.rb | 34 ++-- .../test/session_test/existence_test.rb | 14 +- .../authlogic/test/session_test/id_test.rb | 2 +- .../authlogic/test/session_test/klass_test.rb | 6 +- .../test/session_test/magic_columns_test.rb | 18 +- .../test/session_test/magic_states_test.rb | 20 +-- .../test/session_test/params_test.rb | 18 +- .../test/session_test/password_test.rb | 22 +-- .../test/session_test/perishability_test.rb | 2 +- .../test/session_test/persistence_test.rb | 2 +- .../test/session_test/scopes_test.rb | 22 +-- .../test/session_test/session_test.rb | 12 +- .../test/session_test/timeout_test.rb | 16 +- .../test/session_test/validation_test.rb | 4 +- vendor/plugins/authlogic/test/test_helper.rb | 34 ++-- vendor/plugins/spawn/README | 10 +- vendor/plugins/spawn/lib/spawn.rb | 4 +- 169 files changed, 1182 insertions(+), 1182 deletions(-) diff --git a/README b/README index 23e0dbf..39024c9 100755 --- a/README +++ b/README @@ -5,32 +5,32 @@ Portfolio: http://www.ralphedge.com Video-App is a YouTube-like site written in rails. It converts video to flash(ffmpeg) and plays videos using FlowPlayer(an open-source flash video player). Has Pagination(will_paginate), Tagging/Tag Cloud(acts_as_taggable_on_steroids), User Authentication(authlogic), Video Replies, and Video Thumbnails. Video conversion is done in a seperate process, using the Spawn plugin. Uses Rails Version 2.2.2...you can change the Rails version it uses in config/environment.rb To Install: (let me know if I need to add anything to this) - *Download the code: + *Download the code: git clone git://github.com/balgarath/video-app.git cd video-app - *(Optional) switch to branch 0.2: + *(Optional) switch to branch 0.2: git fetch origin 0.2:0.2 git checkout 0.2 - + *Edit your config/databases.yml - + *Install will_paginate - if you don't have it already sudo gem install will_paginate - + *install ffmpeg - you may need to download and compile from source - http://www.ffmpeg.org/download.html - + In Ubuntu: sudo apt-get install ffmpeg - + *create and migrate database rake db:create rake db:migrate - + *launch server ./script/server - - - + + + diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 18e6770..236f8ae 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -7,14 +7,14 @@ class ApplicationController < ActionController::Base # See ActionController::RequestForgeryProtection for details # Uncomment the :secret if you're not using the cookie session store protect_from_forgery # :secret => '8406dc20b6131ea8a90ec68109f869b1' - - # See ActionController::Base for details + + # See ActionController::Base for details # Uncomment this to filter the contents of submitted sensitive data parameters - # from your application log (in this case, all fields with names like "password"). + # from your application log (in this case, all fields with names like "password"). # filter_parameter_logging :password - + before_filter :get_tag_cloud - + filter_parameter_logging :password, :password_confirmation helper_method :current_user_session, :current_user @@ -53,5 +53,5 @@ def redirect_back_or_default(default) session[:return_to] = nil end - + end diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 87c9f46..a02d0b5 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -2,7 +2,7 @@ class TagsController < ApplicationController def index @tags = Tag.find :all end - + def show @tag = Tag.find_by_name(params[:id]) @videos = Video.paginate_by_id(Video.find_tagged_with(@tag), :page => params[:page], :per_page => 10) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f0da457..736aa98 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,7 +1,7 @@ class UsersController < ApplicationController - before_filter :require_user, :only => [:show, :edit, :update] - + before_filter :require_user, :only => [:show, :edit, :update] + # GET /users # GET /users.xml def index @@ -63,5 +63,5 @@ def destroy redirect_to(users_url) end - + end diff --git a/app/controllers/video_replies_controller.rb b/app/controllers/video_replies_controller.rb index 19ce94e..886f325 100644 --- a/app/controllers/video_replies_controller.rb +++ b/app/controllers/video_replies_controller.rb @@ -9,9 +9,9 @@ def create redirect_to @reply.video else render @reply.video - + end - + end def delete @@ -20,5 +20,5 @@ def delete @reply.destroy redirect_to @video end - + end diff --git a/app/controllers/videos_controller.rb b/app/controllers/videos_controller.rb index 45dd7be..36bd25e 100644 --- a/app/controllers/videos_controller.rb +++ b/app/controllers/videos_controller.rb @@ -1,7 +1,7 @@ class VideosController < ApplicationController - + before_filter :require_user, :only => [:new, :delete, :create] - + def index @videos = Video.paginate :page => params[:page], :order => 'created_at DESC', :per_page => 10 end @@ -26,7 +26,7 @@ def show @video = Video.find(params[:id]) @reply = VideoReply.new end - + def delete @video = Video.find(params[:id]) @video.destroy diff --git a/app/controllers/videos_controller.rb~ b/app/controllers/videos_controller.rb~ index 65582b8..d00b1f7 100644 --- a/app/controllers/videos_controller.rb~ +++ b/app/controllers/videos_controller.rb~ @@ -1,7 +1,7 @@ class VideosController < ApplicationController - + before_filter :require_user, :only => [:new, :delete, :create] - + def index @videos = Video.paginate :page => params[:page], :order => 'created_at DESC', :per_page => 10 end @@ -25,7 +25,7 @@ class VideosController < ApplicationController @video = Video.find(params[:id]) @reply = VideoReply.new end - + def delete @video = Video.find(params[:id]) @video.destroy diff --git a/app/models/thumbnail.rb b/app/models/thumbnail.rb index 0356b73..0cc4d55 100644 --- a/app/models/thumbnail.rb +++ b/app/models/thumbnail.rb @@ -1,12 +1,12 @@ class Thumbnail < ActiveRecord::Base - has_attachment :content_type => :image, - :storage => :file_system + has_attachment :content_type => :image, + :storage => :file_system has_one :video - + def self.create!(vpath) tpath = vpath + ".jpg" system "ffmpeg -i #{vpath} -ss 20 -s 150x100 -vframes 1 -f image2 -an #{tpath}" t = Thumbnail.new(:filename => File.basename(tpath), :content_type => 'image/jpeg', :temp_path => tpath) - t.save ? t : false + t.save ? t : false end end diff --git a/app/models/video.rb b/app/models/video.rb index 2338063..ab6b04f 100644 --- a/app/models/video.rb +++ b/app/models/video.rb @@ -1,15 +1,15 @@ class Video < ActiveRecord::Base - + acts_as_taggable - + belongs_to :thumbnail belongs_to :user has_many :replies, :class_name => 'VideoReply' - + before_create :save_thumbnail - has_attachment :content_type => :video, - :storage => :file_system, + has_attachment :content_type => :video, + :storage => :file_system, :max_size => 300.megabytes #acts as state machine plugin @@ -30,7 +30,7 @@ class Video < ActiveRecord::Base event :failure do transitions :from => :converting, :to => :error end - + def rename_file true end @@ -61,18 +61,18 @@ def save_thumbnail protected - + def convert_command - + #construct new file extension flv = "." + id.to_s + ".flv" #build the command to execute ffmpeg command = <<-end_command ffmpeg -i #{ RAILS_ROOT + '/public' + public_filename } -ar 22050 -s 720x480 -f flv -y #{ RAILS_ROOT + '/public' + public_filename + flv } - + end_command - + logger.debug "Converting video...command: " + command command end diff --git a/app/models/video.rb~ b/app/models/video.rb~ index 2338063..ab6b04f 100644 --- a/app/models/video.rb~ +++ b/app/models/video.rb~ @@ -1,15 +1,15 @@ class Video < ActiveRecord::Base - + acts_as_taggable - + belongs_to :thumbnail belongs_to :user has_many :replies, :class_name => 'VideoReply' - + before_create :save_thumbnail - has_attachment :content_type => :video, - :storage => :file_system, + has_attachment :content_type => :video, + :storage => :file_system, :max_size => 300.megabytes #acts as state machine plugin @@ -30,7 +30,7 @@ class Video < ActiveRecord::Base event :failure do transitions :from => :converting, :to => :error end - + def rename_file true end @@ -61,18 +61,18 @@ class Video < ActiveRecord::Base protected - + def convert_command - + #construct new file extension flv = "." + id.to_s + ".flv" #build the command to execute ffmpeg command = <<-end_command ffmpeg -i #{ RAILS_ROOT + '/public' + public_filename } -ar 22050 -s 720x480 -f flv -y #{ RAILS_ROOT + '/public' + public_filename + flv } - + end_command - + logger.debug "Converting video...command: " + command command end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 781c1a1..315daf3 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -6,22 +6,22 @@ Video App <%= stylesheet_link_tag 'style' %> - <%= javascript_include_tag 'flowplayer', 'jquery' %> + <%= javascript_include_tag 'flowplayer', 'jquery' %> - +
- +
-
+
<% flash.each do |key,value| %>
@@ -31,14 +31,14 @@ <% end -%> <%= yield :layout %> - +
- +