class Oulu::Generator

Public Instance Methods

install() click to toggle source
# File lib/oulu/generator.rb, line 11
def install
  if oulu_files_already_exist? && !options[:force]
    puts "Oulu files already installed, doing nothing."
  else
    install_files
    puts "Oulu files installed to #{install_path}/"
  end
end
update() click to toggle source
# File lib/oulu/generator.rb, line 22
def update
  if oulu_files_already_exist?
    remove_oulu_directory
    install_files
    puts "Oulu files updated."
  else
    puts "No existing oulu installation. Doing nothing."
  end
end
version() click to toggle source
# File lib/oulu/generator.rb, line 33
def version
  say "Oulu #{Oulu::VERSION}"
end

Private Instance Methods

all_stylesheets() click to toggle source
# File lib/oulu/generator.rb, line 68
def all_stylesheets
  Dir["#{stylesheets_directory}/*"]
end
copy_in_scss_files() click to toggle source
# File lib/oulu/generator.rb, line 64
def copy_in_scss_files
  FileUtils.cp_r(all_stylesheets, install_path)
end
install_files() click to toggle source
# File lib/oulu/generator.rb, line 51
def install_files
  make_install_directory
  copy_in_scss_files
end
install_path() click to toggle source
# File lib/oulu/generator.rb, line 43
def install_path
  @install_path ||= if options[:path]
      Pathname.new(File.join(options[:path], 'oulu'))
    else
      Pathname.new('oulu')
    end
end
make_install_directory() click to toggle source
# File lib/oulu/generator.rb, line 60
def make_install_directory
  FileUtils.mkdir_p(install_path)
end
oulu_files_already_exist?() click to toggle source
# File lib/oulu/generator.rb, line 39
def oulu_files_already_exist?
  install_path.exist?
end
remove_oulu_directory() click to toggle source
# File lib/oulu/generator.rb, line 56
def remove_oulu_directory
  FileUtils.rm_rf("oulu")
end
stylesheets_directory() click to toggle source
# File lib/oulu/generator.rb, line 72
def stylesheets_directory
  File.join(top_level_directory, "app", "assets", "stylesheets")
end
top_level_directory() click to toggle source
# File lib/oulu/generator.rb, line 76
def top_level_directory
  File.dirname(File.dirname(File.dirname(__FILE__)))
end