ebngen 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 147413ecf4452625222bca479b14917ec25643d7
4
- data.tar.gz: ee491d9165a7dbf795225260de25a3043d3eb2b2
3
+ metadata.gz: 3e0884f0b04347561316ce53cf34c0ce4be04b1b
4
+ data.tar.gz: ee6dc7c0734a2fc49891a8c2096daf9397aa0132
5
5
  SHA512:
6
- metadata.gz: 9c0964479470a4c7e2dd16fbcd79809674506ba84e0861c5db7906eb8e2b6d0c3a8e029fc9259ec171f0654e79626eb550c9aebef90ff71aed3cf1e4cd8e96fc
7
- data.tar.gz: 2125baea19cb8e9f5e77bf42e9a370c5944573351b318fd645ebdfc760d22087b314cbb2ff318f4ed5c91f3eb330fd8fea51b7a651a218804dfd90ec9a2a8d5a
6
+ metadata.gz: b76e1ded1b9a7c7ec475560e64130939725fa2ed3a9a0879d7f53ce3e97c2c746048607e64629a71c6146f8286e6982dffdf95a6e9a6d69b5fbdce254eb5ed65
7
+ data.tar.gz: e2f83004cdedb8bc2e45c5da964cd12f8112ea15023a196b331e180b4be169b7381fd18364e6b04bf1aaee28b3dd56816a462a93ed17be9e3e0405ef3c81687e
@@ -1,25 +1,25 @@
1
-
2
- module Core
3
-
4
- # perform simple assertion like c <assert.h>
5
- # implementation raise an exception instead go to abort
6
- # two ways how use assert:
7
- # 1) assert(condition, "message")
8
- # 2) assert(condition) do "message" end
9
- # I would prefer use 2.nd way because 1.st way always
10
- # evaluate the message parameter ("like #{failed_var.some_info...}")
11
- # while 2.nd evaluate message only if condition fails
12
- def assert(condition, message=nil)
13
- unless (condition)
14
- if block_given?
15
- message = yield(condition)
16
- end
17
- raise message == nil ? "assertion error" : message
18
- end
19
- end
20
-
21
- module_function :assert
22
-
23
- end
24
-
25
-
1
+
2
+ module Core
3
+
4
+ # perform simple assertion like c <assert.h>
5
+ # implementation raise an exception instead go to abort
6
+ # two ways how use assert:
7
+ # 1) assert(condition, "message")
8
+ # 2) assert(condition) do "message" end
9
+ # I would prefer use 2.nd way because 1.st way always
10
+ # evaluate the message parameter ("like #{failed_var.some_info...}")
11
+ # while 2.nd evaluate message only if condition fails
12
+ def assert(condition, message=nil)
13
+ unless (condition)
14
+ if block_given?
15
+ message = yield(condition)
16
+ end
17
+ raise message == nil ? "assertion error" : message
18
+ end
19
+ end
20
+
21
+ module_function :assert
22
+
23
+ end
24
+
25
+
@@ -1,25 +1,25 @@
1
- module Base
2
- def process(project_data)
3
- project_data.each_key do |key|
4
- methods = instance_methods(false)
5
- if methods.include(key.to_sym)
6
- send(key.to_sym, project_data)
7
- else
8
- puts "#{key} is not processed"
9
- end
10
- end
11
- end
12
-
13
- def create_method(name)
14
- self.class.send(:define_method, name){|project_data|
15
- project_data[name].each_key do |key|
16
- methods = self.class.instance_methods(false)
17
- if methods.include?(key.to_sym)
18
- send(key.to_sym)
19
- else
20
- puts "#{key} is not processed"
21
- end
22
- end
23
- }
24
- end
1
+ module Base
2
+ def process(project_data)
3
+ project_data.each_key do |key|
4
+ methods = instance_methods(false)
5
+ if methods.include(key.to_sym)
6
+ send(key.to_sym, project_data)
7
+ else
8
+ puts "#{key} is not processed"
9
+ end
10
+ end
11
+ end
12
+
13
+ def create_method(name)
14
+ self.class.send(:define_method, name){|project_data|
15
+ project_data[name].each_key do |key|
16
+ methods = self.class.instance_methods(false)
17
+ if methods.include?(key.to_sym)
18
+ send(key.to_sym)
19
+ else
20
+ puts "#{key} is not processed"
21
+ end
22
+ end
23
+ }
24
+ end
25
25
  end
@@ -1,29 +1,29 @@
1
- require 'pathname'
2
- require_relative '_assert'
3
-
4
-
5
- class PathModifier
6
-
7
- attr_reader :rootdir_table
8
-
9
- def initialize(rootdir_table)
10
- @rootdir_table = rootdir_table
11
- end
12
-
13
- def fullpath(rootdir_name, relpath)
14
- Core.assert(@rootdir_table.has_key?(rootdir_name)) do
15
- "rootdir '#{rootdir_name}' is not present in table '@{rootdir_table}'"
16
- end
17
- if (@rootdir_table[ rootdir_name ] && !@rootdir_table[ rootdir_name ].empty?)
18
- relpath = File.join(
19
- @rootdir_table[ rootdir_name ].gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR), relpath.gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR)
20
- )
21
- end
22
- return relpath.gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR)
23
- end
24
-
25
- def relpath(project_full_path, root_dir_path)
26
- return Pathname.new(root_dir_path.gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR)).relative_path_from(Pathname.new(project_full_path.gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR))).to_s
27
- end
28
- end
29
-
1
+ require 'pathname'
2
+ require_relative '_assert'
3
+
4
+
5
+ class PathModifier
6
+
7
+ attr_reader :rootdir_table
8
+
9
+ def initialize(rootdir_table)
10
+ @rootdir_table = rootdir_table
11
+ end
12
+
13
+ def fullpath(rootdir_name, relpath)
14
+ Core.assert(@rootdir_table.has_key?(rootdir_name)) do
15
+ "rootdir '#{rootdir_name}' is not present in table '@{rootdir_table}'"
16
+ end
17
+ if (@rootdir_table[ rootdir_name ] && !@rootdir_table[ rootdir_name ].empty?)
18
+ relpath = File.join(
19
+ @rootdir_table[ rootdir_name ].gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR), relpath.gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR)
20
+ )
21
+ end
22
+ return relpath.gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR)
23
+ end
24
+
25
+ def relpath(project_full_path, root_dir_path)
26
+ return Pathname.new(root_dir_path.gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR)).relative_path_from(Pathname.new(project_full_path.gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR))).to_s
27
+ end
28
+ end
29
+
@@ -1,49 +1,49 @@
1
- require 'rubygems'
2
- require "yaml"
3
-
4
-
5
- module UNI_Project
6
- def is_toolchain_support(tool_chain)
7
- return @projects_hash.has_key?(tool_chain)
8
- end
9
-
10
- def set_hash(options)
11
- @projects_hash = options
12
- end
13
-
14
- def get_output_dir(toolchain, path_hash)
15
- @projects_hash[toolchain]["outdir"]
16
- end
17
-
18
- def get_src_list(toolchain)
19
- return @projects_hash[toolchain]["source"]
20
- end
21
-
22
- def get_libraries(toolchain)
23
- return @projects_hash[toolchain]["libraries"]
24
- end
25
-
26
- def get_target_list(toolchain)
27
- return @projects_hash[toolchain]["targets"].keys
28
- end
29
-
30
- def get_type(toolchain)
31
- return @projects_hash[toolchain]["type"]
32
- end
33
-
34
- def get_targets(toolchain)
35
- return @projects_hash[toolchain]["targets"]
36
- end
37
-
38
- def get_project_name()
39
- return @projects_hash['document']['project_name']
40
- end
41
-
42
- def get_board()
43
- return @projects_hash['document']['board']
44
- end
45
-
46
- def get_template(toolchain)
47
- return @projects_hash[toolchain]['templates']
48
- end
1
+ require 'rubygems'
2
+ require "yaml"
3
+
4
+
5
+ module UNI_Project
6
+ def is_toolchain_support(tool_chain)
7
+ return @projects_hash.has_key?(tool_chain)
8
+ end
9
+
10
+ def set_hash(options)
11
+ @projects_hash = options
12
+ end
13
+
14
+ def get_output_dir(toolchain, path_hash)
15
+ @projects_hash[toolchain]["outdir"]
16
+ end
17
+
18
+ def get_src_list(toolchain)
19
+ return @projects_hash[toolchain]["source"]
20
+ end
21
+
22
+ def get_libraries(toolchain)
23
+ return @projects_hash[toolchain]["libraries"]
24
+ end
25
+
26
+ def get_target_list(toolchain)
27
+ return @projects_hash[toolchain]["targets"].keys
28
+ end
29
+
30
+ def get_type(toolchain)
31
+ return @projects_hash[toolchain]["type"]
32
+ end
33
+
34
+ def get_targets(toolchain)
35
+ return @projects_hash[toolchain]["targets"]
36
+ end
37
+
38
+ def get_project_name()
39
+ return @projects_hash['document']['project_name']
40
+ end
41
+
42
+ def get_board()
43
+ return @projects_hash['document']['board']
44
+ end
45
+
46
+ def get_template(toolchain)
47
+ return @projects_hash[toolchain]['templates']
48
+ end
49
49
  end