Sha256: c05b8d4fc4fa49e0159d20c4d3ab521eba6a06c692c72947d0f8166522eb2da5
Contents?: true
Size: 1.47 KB
Versions: 5
Compression:
Stored size: 1.47 KB
Contents
require "fileutils" module Poxy class Generator def initialize(arguments) @subcommand = arguments.first end def run if @subcommand == "install" install elsif @subcommand == "update" update elsif @subcommand == "remove" remove end end def update if poxy_files_already_exist? remove_poxy_directory install_files puts "Poxy files updated." else puts "No existing poxy installation. Doing nothing." end end def install if poxy_files_already_exist? puts "Poxy files already installed, doing nothing." else install_files puts "Poxy files installed to poxy/" end end def remove if poxy_files_already_exist? remove_poxy_directory puts "Poxy was successfully removed." else puts "No existing poxy installation. Doing nothing." end end private def poxy_files_already_exist? File.directory?("poxy") end def install_files FileUtils.mkdir_p("poxy") FileUtils.cp_r(all_stylesheets, "poxy/") end def remove_poxy_directory FileUtils.rm_rf("poxy") end def all_stylesheets Dir["#{stylesheets_directory}/*"] end def stylesheets_directory File.join(top_level_directory, "app", "assets", "stylesheets") end def top_level_directory File.dirname(File.dirname(File.dirname(__FILE__))) end end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
poxy-0.0.6 | lib/poxy/generator.rb |
poxy-0.0.5 | lib/poxy/generator.rb |
poxy-0.0.4 | lib/poxy/generator.rb |
poxy-0.0.1 | lib/poxy/generator.rb |
poxy-0.0.0 | lib/poxy/generator.rb |