Class: WebSystem::RequestGenerator

Inherits:
DevSystem::SimpleGenerator show all
Defined in:
lib/web_system/sub/request/generators/request_generator.rb

Instance Attribute Summary

Attributes inherited from DevSystem::BaseGenerator

#env

Instance Method Summary collapse

Methods inherited from DevSystem::SimpleGenerator

#add_change, #changes, #copy_examples, #copy_file, #copy_files, #create_controller, #create_file, #create_unit, #inform, #last_change, #name!, #place!, #puts_line, #save

Methods inherited from DevSystem::BaseGenerator

#args, #call, call, #command, get_generator_signatures, #inform, #save

Methods inherited from DevSystem::Generator

get_generator_signatures

Methods inherited from Liza::Controller

color, inherited, on_connected

Methods inherited from Liza::Unit

const_missing, division, part, system, #system, test_class

Instance Method Details

#call_baseObject

liza g request:base name place=app



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/web_system/sub/request/generators/request_generator.rb', line 33

def call_base
  @controller_class = Request

  name!
  place!

  @args = Array command.simple_args[1..-1]

  create_controller @name, @controller_class, @place, @path do |unit, test|
    unit.section :controller_section_base_1, caption: ""
    test.section :controller_test_section_1, caption: ""
  end
end

#call_defaultObject

liza g request name place=app



5
6
7
# File 'lib/web_system/sub/request/generators/request_generator.rb', line 5

def call_default
  call_simple
end

#call_simpleObject

liza g request:simple name place=app



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/web_system/sub/request/generators/request_generator.rb', line 11

def call_simple
  @controller_class = Request

  name!
  place!

  @args = Array command.simple_args[1..-1]

  @args = ["index"] if @args.empty?

  ancestor = SimpleRequest
  create_controller @name, @controller_class, @place, @path, ancestor: ancestor do |unit, test|
    unit.section :controller_section_1
    @args.each do |arg|
      unit.view  :controller_view_1, key: arg, format: :html
    end
    test.section :controller_test_section_1, caption: ""
  end
end