flowplayer-gem/lib/flowplayer/railties/generator/install_generator.rb

24 lines
1002 B
Ruby
Raw Normal View History

2011-02-01 21:03:28 +00:00
module Flowplayer
module Generator
class InstallGenerator < Rails::Generators::Base
namespace 'flowplayer'
2011-11-08 23:19:40 +00:00
source_root File.expand_path("../../../../../vendor/assets/", __FILE__)
2011-02-01 21:03:28 +00:00
argument :install_type, :type => :string, :banner => "commercial", :required => false, :default => ''
def install_flowplayer
2011-11-08 23:19:40 +00:00
copy_file 'javascripts/flowplayer-3.2.4.min.js', Rails.root.join('public', 'javascripts', 'flowplayer.min.js')
2011-02-01 21:03:28 +00:00
end
def install_swfs
if install_type == 'commercial'
2011-11-08 23:19:40 +00:00
copy_file 'flash/flowplayer.commercial-3.2.5.swf', Rails.root.join('public', 'flowplayer.swf')
2011-02-01 21:03:28 +00:00
else
2011-11-08 23:19:40 +00:00
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')
2011-02-01 21:03:28 +00:00
end
2011-11-08 23:19:40 +00:00
copy_file 'flash/flowplayer.controls-3.2.3.swf', Rails.root.join('public', 'flowplayer.controls.swf')
2011-02-01 21:03:28 +00:00
end
end
end
end