Top Level Namespace

Instance Method Summary collapse

Instance Method Details

#get_extObject



15
16
17
18
19
20
21
# File 'lib/specgen.rb', line 15

def get_ext
  if OS.windows? then
    return ".exe"
  else
    return ""
  end
end

#get_osObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/specgen.rb', line 3

def get_os
  if OS.mac? then
    return "darwin"
  end
  if OS.posix? then
    return "linux"
  end
  if OS.windows? then
    return "windows"
  end
end

#get_specgen_pathObject



23
24
25
# File 'lib/specgen.rb', line 23

def get_specgen_path
  File.join(File.dirname(File.expand_path(__FILE__)), "dist", "#{get_os}_amd64", "specgen#{get_ext}")
end

#specgen_client_ruby(spec_file: "./spec.yaml", generate_path: ".") ⇒ Object



27
28
29
30
31
32
# File 'lib/specgen.rb', line 27

def specgen_client_ruby(spec_file: "./spec.yaml", generate_path: ".")
  specgen_path = get_specgen_path
  command = "#{specgen_path} client-ruby --spec-file #{spec_file} --generate-path #{generate_path}"
  puts "Executing specgen:"
  sh command
end

#specgen_models_ruby(spec_file: "./spec.yaml", generate_path: ".") ⇒ Object



34
35
36
37
38
39
# File 'lib/specgen.rb', line 34

def specgen_models_ruby(spec_file: "./spec.yaml", generate_path: ".")
  specgen_path = get_specgen_path
  command = "#{specgen_path} models-ruby --spec-file #{spec_file} --generate-path #{generate_path}"
  puts "Executing specgen:"
  sh command
end