Merge pull request #3 from ciastek/generator-bug-dodge

fixes issue #2 described at https://github.com/scottdavis/flowplayer-gem/issues/2
This commit is contained in:
Scott Davis 2012-02-25 10:41:58 -08:00
commit ee1c1e346e
1 changed files with 20 additions and 22 deletions

View File

@ -1,24 +1,22 @@
module Flowplayer module Flowplayer::Generator
module Generator class InstallGenerator < Rails::Generators::Base
class InstallGenerator < Rails::Generators::Base namespace 'flowplayer'
namespace 'flowplayer' source_root File.expand_path("../../../../../vendor/assets/", __FILE__)
source_root File.expand_path("../../../../../vendor/assets/", __FILE__) argument :install_type, :type => :string, :banner => "commercial", :required => false, :default => ''
argument :install_type, :type => :string, :banner => "commercial", :required => false, :default => ''
def install_flowplayer
def install_flowplayer copy_file 'javascripts/flowplayer-3.2.4.min.js', Rails.root.join('public', 'javascripts', 'flowplayer.min.js')
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
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
end end