Class: F2h::InitialFiles
- Inherits:
-
Object
- Object
- F2h::InitialFiles
- Defined in:
- lib/initial_files.rb
Instance Method Summary collapse
-
#initialize ⇒ InitialFiles
constructor
A new instance of InitialFiles.
- #make_dirs ⇒ Object
- #make_files ⇒ Object
Constructor Details
#initialize ⇒ InitialFiles
Returns a new instance of InitialFiles.
3 4 5 6 7 8 9 10 11 |
# File 'lib/initial_files.rb', line 3 def initialize @get_current_dir = Dir.getwd @get_current_foldername = File.basename(@get_current_dir) @box_name = "" @banner_name = "" @types = ["box", "banner"] @ext = { "html" => false,"css" => true,"js" => true } @bp = Boilerplate.new end |
Instance Method Details
#make_dirs ⇒ Object
34 35 36 37 38 39 |
# File 'lib/initial_files.rb', line 34 def make_dirs Dir.mkdir("js") unless Dir.exist?("js") Dir.mkdir("css") unless Dir.exist?("css") Dir.mkdir("box_images") unless Dir.exist?("box_images") Dir.mkdir("banner_images") unless Dir.exist?("banner_images") end |
#make_files ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/initial_files.rb', line 13 def make_files make_dirs @types.each do |t| @ext.each do |k,value| if value File.open("#{k}/"+@get_current_foldername+"_#{t}.#{k}", 'w+') do |file| k.eql?("js") ? t.eql?("box") ? to_write = @bp.box_js_boilerplate : to_write = @bp. : t.eql?("box") ? to_write = @bp.box_css_boilerplate : to_write = @bp. # file.write(send("#{@bp}.#{t}_#{k}_boilerplate")) file.write(to_write) end else File.open(@get_current_foldername+"_#{t}.#{k}", 'w+') do |file| to_write = @bp.html_boilerplate(@get_current_foldername, t) file.write(to_write) end end end end exec('curl -o js/TweenMax.min.js http://cdnjs.cloudflare.com/ajax/libs/gsap/1.17.0/TweenMax.min.js;curl -o js/jquery.min.js https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js') end |