From 0c813000170e18bc612d773948fedc1df8c28c56 Mon Sep 17 00:00:00 2001 From: Sebastian Spieszko Date: Sat, 25 Feb 2012 16:38:28 +0100 Subject: [PATCH] dodges generator issue described at https://github.com/scottdavis/flowplayer-gem/issues/2 --- .../railties/generator/install_generator.rb | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/lib/flowplayer/railties/generator/install_generator.rb b/lib/flowplayer/railties/generator/install_generator.rb index 3c902dd..c52e711 100644 --- a/lib/flowplayer/railties/generator/install_generator.rb +++ b/lib/flowplayer/railties/generator/install_generator.rb @@ -1,24 +1,22 @@ -module Flowplayer - module Generator - class InstallGenerator < Rails::Generators::Base - namespace 'flowplayer' - source_root File.expand_path("../../../../../vendor/assets/", __FILE__) - argument :install_type, :type => :string, :banner => "commercial", :required => false, :default => '' - - def install_flowplayer - copy_file 'javascripts/flowplayer-3.2.4.min.js', Rails.root.join('public', 'javascripts', 'flowplayer.min.js') - end - - def install_swfs - if install_type == 'commercial' - copy_file 'flash/flowplayer.commercial-3.2.5.swf', Rails.root.join('public', 'flowplayer.swf') - else - copy_file 'flash/flowplayer-3.2.5.swf', Rails.root.join('public', 'flowplayer.swf') - copy_file '../../FLOWPLAYER_LICENSE.txt', Rails.root.join('FLOWPLAYER_LICENSE.txt') - end - copy_file 'flash/flowplayer.controls-3.2.3.swf', Rails.root.join('public', 'flowplayer.controls.swf') - end - +module Flowplayer::Generator + class InstallGenerator < Rails::Generators::Base + namespace 'flowplayer' + source_root File.expand_path("../../../../../vendor/assets/", __FILE__) + argument :install_type, :type => :string, :banner => "commercial", :required => false, :default => '' + + def install_flowplayer + copy_file 'javascripts/flowplayer-3.2.4.min.js', Rails.root.join('public', 'javascripts', 'flowplayer.min.js') end + + def install_swfs + if install_type == 'commercial' + copy_file 'flash/flowplayer.commercial-3.2.5.swf', Rails.root.join('public', 'flowplayer.swf') + else + copy_file 'flash/flowplayer-3.2.5.swf', Rails.root.join('public', 'flowplayer.swf') + copy_file '../../FLOWPLAYER_LICENSE.txt', Rails.root.join('FLOWPLAYER_LICENSE.txt') + end + copy_file 'flash/flowplayer.controls-3.2.3.swf', Rails.root.join('public', 'flowplayer.controls.swf') + end + end -end \ No newline at end of file +end