Class: Entityjs::Release

Inherits:
Object
  • Object
show all
Defined in:
lib/entityjs/commands/release.rb

Overview

compiles entity source code and outputs it

Class Method Summary collapse

Class Method Details

.generate(name = nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/entityjs/commands/release.rb', line 6

def self.generate(name=nil)
  
  if name.is_a? Array
    name = name.first
  end
  
  name ||= self.release_name
  
  puts "Collecting files"
  
  min = Entityjs::Build.compile_entity
  
  puts "Minifying"
  
  min = Entityjs::Build.minify(min)
  
  File.open(name, 'w') do |f|
    
    f.write(min)
    
  end
  
  puts "Done!"
  puts "File is at"
  puts "  ./#{name}"
  
  
  return 0
end

.release_nameObject



36
37
38
# File 'lib/entityjs/commands/release.rb', line 36

def self.release_name
  return "entity-#{Entityjs::VERSION}.min.js"
end