Class: EasySwig::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/config.rb

Overview

Generation Settings

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(default_dir = nil) ⇒ Config

Creates a new Configutation using the default values for a given directory

Parameters:

  • default_dir (String) (defaults to: nil)

    Working directory



36
37
38
39
# File 'lib/config.rb', line 36

def initialize(default_dir = nil)
	@default_dir = default_dir
	set_defaults
end

Instance Attribute Details

#csv_fileObject

String

CSV configuration file input. Defaults to: path/to/working/dir/api.csv



14
15
16
# File 'lib/config.rb', line 14

def csv_file
  @csv_file
end

#custom_fileObject

String

Custom .i file to be appended at the beginning of the generated .i target. Used for advanced configuration

Defaults to path/to/working/dir/custom_config.i



25
26
27
# File 'lib/config.rb', line 25

def custom_file
  @custom_file
end

#default_dirObject

String

Working directory. Defaults to current working directory



6
7
8
# File 'lib/config.rb', line 6

def default_dir
  @default_dir
end

#doxy_dirObject

String

Directory generated by Doxygen (which include a /xml subdirectory for all XML files. Defaults to: path/to/working/dir/easy-swig/doxygen



10
11
12
# File 'lib/config.rb', line 10

def doxy_dir
  @doxy_dir
end

#generate_dirObject

String

Output directory for Easy-Swig generated .i file(s) aka. ‘target’. Defaults to path/to/working/dir/easy-swig/generate



18
19
20
# File 'lib/config.rb', line 18

def generate_dir
  @generate_dir
end

#headers_dirObject

String

Directory for your project’s header files. Defaults to: path/to/working/dir/include



12
13
14
# File 'lib/config.rb', line 12

def headers_dir
  @headers_dir
end

#htmlObject

String

Instructs Doxygen to also generate HTML documentation for the header files. Defaults to nil (false)



20
21
22
# File 'lib/config.rb', line 20

def html
  @html
end

#includes_dirObject

Array<String>

System include directories. Defaults to Linux include directory: [“/usr/include”]



30
31
32
# File 'lib/config.rb', line 30

def includes_dir
  @includes_dir
end

#langObject

String

Target language for SWIG. Defaults to ‘csharp’ (C#)



22
23
24
# File 'lib/config.rb', line 22

def lang
  @lang
end

#module_nameObject

String

Name of the module. Used to name generated resources. Defaults to the name of the default (working) directory



8
9
10
# File 'lib/config.rb', line 8

def module_name
  @module_name
end

#output_dirObject

String

Output directory for SWIG generated files. Defaults to : path/to/working/dir/easy-swig/swig



16
17
18
# File 'lib/config.rb', line 16

def output_dir
  @output_dir
end

#stl_supportObject

String

Special support for the Standard Template Library. Values ‘YES’/‘NO’ (defaults to ‘YES’)



32
33
34
# File 'lib/config.rb', line 32

def stl_support
  @stl_support
end

#target_fileObject

String

Target .i file as input for SWIG. If a directory SWIG will be invoked once for every found .i file

Defaults to path/to/working/dir/easy-swig/generate/<MODULE_NAME>.i



28
29
30
# File 'lib/config.rb', line 28

def target_file
  @target_file
end

Instance Method Details

#set_defaultsObject



41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/config.rb', line 41

def set_defaults
  @default_dir ||= Dir.getwd
  @module_name ||= File.basename(@default_dir)
  @output_dir ||= "#{@default_dir}/easy-swig/swig"
  @doxy_dir ||= "#{@default_dir}/easy-swig/doxygen"
  @generate_dir ||= "#{@default_dir}/easy-swig/generate"
  @headers_dir ||= "#{@default_dir}/include"
  @csv_file ||= "#{@default_dir}/api.csv"
  @custom_file ||= "#{@default_dir}/custom_config.i"
  @lang ||= "csharp"
  @stl_support ||= 'YES'
  @target_file ||= "#{@default_dir}/easy-swig/generate/#{@lang}/#{@module_name}.i"
  @includes_dir ||= ["/usr/include"]
end