Class: Repres::Dosser::SwaggerGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/repres/dosser/swagger/swagger_generator.rb

Instance Method Summary collapse

Instance Method Details

#bind_optionsObject



24
25
26
27
28
29
30
31
32
# File 'lib/generators/repres/dosser/swagger/swagger_generator.rb', line 24

def bind_options
  @platform_name          = file_name.downcase
  @version_number         = options['version'].to_i
  @platform_module_name   = @platform_name.camelize
  @version_module_name    = "V#{@version_number}"
  @version_name           = "v#{@version_number}"
  @application_name       = application_name
  @application_name_const = application_name.upcase
end

#produceObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/generators/repres/dosser/swagger/swagger_generator.rb', line 11

def produce

  bind_options

  generate 'repres:dosser:platform', "#{@platform_name} --version #{@version_number}"

  generate_gemfile
  generate_initializer
  generate_swagger
  generate_route

end