Module: Edge

Defined in:
lib/edge/engine.rb,
lib/edge/message.rb,
lib/edge/version.rb,
lib/edge_framework.rb,
lib/edge/install_generator.rb

Defined Under Namespace

Modules: Generators Classes: Engine, Message

Constant Summary collapse

VERSION =
"1.2.6"
CODENAME =
"Ezalor"

Class Method Summary collapse

Class Method Details

.command_too_longObject

Generic message for command that is too long



70
71
72
# File 'lib/edge_framework.rb', line 70

def self.command_too_long()
  puts "Passed parameters exceed limits. If your #{ log('project_name') } contains space, enclose it with double-quote (\")"
end

.create(type, name) ⇒ Object

Create project



19
20
21
22
23
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
51
52
53
54
55
56
57
# File 'lib/edge_framework.rb', line 19

def self.create(type, name)
  # If name is specified, create new directory

  if name
    FileUtils.mkdir( name )
    destination = File.join( Dir.pwd, name )
  # If type is specified, create new file in the current directory

  elsif type
    puts "[create] \t #{type} template"
    destination = Dir.pwd
  else
    puts message(:create_wrong_syntax)
    return false
  end

  # Gem home directory

  home = File.expand_path( "..", File.dirname(__FILE__) )
  template = File.join( home, "template" )

  # Copy template files

  template_type = File.join( template, type )
  # If directory doesn't exist

  if !File.directory?(template_type)
    puts "[error] \t Template not found"
    puts message(:available_template)
    return false
  end
  FileUtils.cp_r( Dir["#{template_type}/*"], destination )

  # Copy base files

  base = File.join( template, "base" )
  FileUtils.cp_r( Dir["#{base}/*"], destination )

  # Copy javascript files

  # js_source = File.join( home, "assets", "js" )

  # js_destination = File.join( destination, "assets", "js")

  # FileUtils.cp_r( Dir["#{js_source}/*"], js_destination )


  puts "[success] \t Run `compass watch` to generate the CSS"
end

.helpObject

Help message



60
61
62
# File 'lib/edge_framework.rb', line 60

def self.help()
  puts message(:help)
end

.message(key) ⇒ Object



14
15
16
# File 'lib/edge_framework.rb', line 14

def self.message(key)
  return @message.get_message(key);
end

.not_found(command) ⇒ Object

Error message for non-existance command



65
66
67
# File 'lib/edge_framework.rb', line 65

def self.not_found(command)
  puts "The command '#{command}' does not exist. Run #{ log("edge -h") } for help" 
end