Class: Grund::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/grund/generator.rb

Constant Summary collapse

PACKAGE_NAME =
"grund.zip"
BUNDLE_NAME =
"grund"

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Generator

Returns a new instance of Generator.



9
10
11
12
# File 'lib/grund/generator.rb', line 9

def initialize(args)
  @url = 'https://github.com/johanbrook/grund.css/zipball/master'
  @command = args.first
end

Instance Method Details

#cleanObject



52
53
54
55
# File 'lib/grund/generator.rb', line 52

def clean
  system "rm -rf #{PACKAGE_NAME}"
  system "rm -rf johanbrook-grund*"
end

#helpObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/grund/generator.rb', line 24

def help
  puts <<-h

  GRUND. A SCSS foundation for Compass. 
  I use this as a starting point for new projects.

  Usage:

\x1B[0;1m grund install \x1B[0m

  Download the latest Grund files and put them in the current directory.

\x1B[0;1m compass compile \x1B[0m

  Compiles the master file (master.scss) into CSS with Compass (http://compass-style.org).

  Explore the file structure and make it your own. Pure SCSS stuff like 
  variables and mixins should be put in '_settings.scss' and 'lib/_mixins.scss'.

  Main site styles go in '_main.scss' and in other imported files.
  Includes Necolas' Normalize reset (https://github.com/necolas/normalize.css)

  --
  Project:  https://github.com/johanbrook/grund
  Author:   Johan Brook (http://johanbrook.com)
  h
end

#runObject



14
15
16
17
18
19
20
21
22
# File 'lib/grund/generator.rb', line 14

def run
  if @command == "install"  
    get_zip @url
  elsif @command == "-v" or @command == "--version"
    puts "Grund #{Grund::VERSION}"
  else
    help
  end
end