Class: Seek::SampleTemplates::Generator

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

Constant Summary collapse

JAR_VERSION =
'0.2'.freeze
JAR_PATH =
File.dirname(__FILE__) + "/../../../jars/sample-template-generator-#{JAR_VERSION}.jar"
DEFAULT_MEMORY_ALLOCATION =
'512M'.freeze
BUFFER_SIZE =

1/4 a megabyte

250_000

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, json, memory_allocation = DEFAULT_MEMORY_ALLOCATION) ⇒ Generator

Returns a new instance of Generator.

Raises:

  • (Exception)


33
34
35
36
37
38
# File 'lib/seek/sample_templates/generator.rb', line 33

def initialize(path, json, memory_allocation = DEFAULT_MEMORY_ALLOCATION)
  @path = path
  @json = json
  @memory_allocation = memory_allocation
  raise Exception, 'Windows is not currently supported' if windows?
end

Instance Attribute Details

#jsonObject

Returns the value of attribute json.



31
32
33
# File 'lib/seek/sample_templates/generator.rb', line 31

def json
  @json
end

#memory_allocationObject

Returns the value of attribute memory_allocation.



31
32
33
# File 'lib/seek/sample_templates/generator.rb', line 31

def memory_allocation
  @memory_allocation
end

#pathObject

Returns the value of attribute path.



31
32
33
# File 'lib/seek/sample_templates/generator.rb', line 31

def path
  @path
end

Instance Method Details

#generateObject



40
41
42
# File 'lib/seek/sample_templates/generator.rb', line 40

def generate
  run_with_open4
end