CppUmlClass 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/CppUmlClass/version.rb +1 -1
- data/lib/create_uml_class.rb +16 -22
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b11ad34c06240ad72f271823c30efae82d3aa7b0effd4fd54df08e36503620e
|
4
|
+
data.tar.gz: 6937f38c94cea4348fa207e5cea4808730adc1f6ac6562b43f7e306d47df4345
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e39c4b16f51bbffc4b4a0ae02600fa9376d41529147ec33d7962a4ca31a147936b5d7dd3bd6d509d943f31ff2388b113d096b58f5d20ff746fe07df036117335
|
7
|
+
data.tar.gz: 8cc6b000eb2e3397419c7e6f1ce4243aa77ed50d4a375fe8a3a1c19d36e0e093d0cd750eeaa2c065f2e45730b29a2815170db9fe113cd49b5f09fa889aa60e90
|
data/lib/CppUmlClass/version.rb
CHANGED
data/lib/create_uml_class.rb
CHANGED
@@ -181,10 +181,17 @@ def composition_list_create(in_dir, out_list)
|
|
181
181
|
|
182
182
|
# ブロックの開始/終了
|
183
183
|
if line.match(/\{/)
|
184
|
-
block_count +=
|
184
|
+
block_count += line.each_char.select { |c| c == "{" }.size
|
185
|
+
start_block = true
|
186
|
+
else
|
187
|
+
start_block = false
|
185
188
|
end
|
189
|
+
# ブロックの終了
|
186
190
|
if line.match(/\}/)
|
187
|
-
block_count -=
|
191
|
+
block_count -= line.each_char.select { |c| c == "}" }.size
|
192
|
+
end_block = true
|
193
|
+
else
|
194
|
+
end_block = false
|
188
195
|
end
|
189
196
|
#puts "comp:block_count=#{block_count}"
|
190
197
|
|
@@ -202,24 +209,13 @@ def composition_list_create(in_dir, out_list)
|
|
202
209
|
end
|
203
210
|
# 関数の開始
|
204
211
|
#if line =~ /^\S+::\S+/
|
205
|
-
if line.gsub(/<.*>/, "") =~ /^\S.*(\S+)::(\S+).*\(.*{
|
212
|
+
if line.gsub(/<.*>/, "") =~ /^\S.*(\S+)::(\S+).*\(.*{/ and
|
206
213
|
(File.extname(file) == ".cpp" or File.extname(file) == ".hpp")
|
207
|
-
#puts "comp:method start"
|
208
|
-
#class_name = line.match(/(\w+)(?=<\w*,?\s*\w*>?::\w+\(\))/).to_s
|
209
|
-
#class_name = line.match(/(\w+)(?=::\S+\(\))/).to_s if class_name == ""
|
210
|
-
#class_name = line.match(/(\w+(?:::\w+)*)(?=::\w+\(.*\))/).to_s if class_name == ""
|
211
|
-
#class_name = class_name.split("::")[1] if class_name =~ /::/
|
212
214
|
line.gsub(/<.*>/, "").match(/(\w+)(?=\S+\()/) do |m|
|
213
215
|
#puts "comp:class_name=#{m}"
|
214
216
|
cstruct_list.push CStruct.new(:method_start, m.to_s, block_count, [], [], [], [])
|
215
217
|
break
|
216
218
|
end
|
217
|
-
|
218
|
-
#puts "class_name=[#{class_name}]"
|
219
|
-
#if class_name != ""
|
220
|
-
# cstruct_list.push CStruct.new(:method_start, class_name, block_count, [], [], [], [])
|
221
|
-
# next
|
222
|
-
#end
|
223
219
|
end
|
224
220
|
|
225
221
|
if cstruct_list.size != 0
|
@@ -230,6 +226,7 @@ def composition_list_create(in_dir, out_list)
|
|
230
226
|
cstruct_list.slice!(-1) # 最後の要素を削除
|
231
227
|
else
|
232
228
|
#puts "comp:#{File.basename(file)}:#{block_count}:line3=#{line}"
|
229
|
+
#puts "#{start_block} : #{end_block}"
|
233
230
|
my_class_name = cstruct_list[-1].name
|
234
231
|
my_cstruct = out_list.select { |m| m.name == my_class_name }[1]
|
235
232
|
#pp my_cstruct
|
@@ -245,6 +242,10 @@ def composition_list_create(in_dir, out_list)
|
|
245
242
|
end
|
246
243
|
end
|
247
244
|
end
|
245
|
+
if start_block and end_block # 1行関数
|
246
|
+
cstruct_list.slice!(-1) # 最後の要素を削除
|
247
|
+
#puts "cstruct size=#{cstruct_list.size}"
|
248
|
+
end
|
248
249
|
end
|
249
250
|
end
|
250
251
|
end
|
@@ -314,15 +315,8 @@ def create_uml_class(in_dir, out_file)
|
|
314
315
|
puts file
|
315
316
|
next
|
316
317
|
end
|
317
|
-
#if out_list.size != 0 and out_list[-1].type == :class_start # classが連続している
|
318
|
-
# class_name = out_list[-1].name + "." + class_name
|
319
|
-
# out_list[-1].name = class_name
|
320
|
-
# cstruct_list[-1].name = class_name
|
321
|
-
#else
|
322
318
|
out_list.push CStruct.new(:class_start, class_name, block_count, [], [], [], [])
|
323
319
|
cstruct_list.push CStruct.new(:class_end, class_name, block_count, [], [], [], [])
|
324
|
-
#end
|
325
|
-
#pp line if class_name == ""
|
326
320
|
base_name.each do |name|
|
327
321
|
name.gsub!(/,/, "")
|
328
322
|
#puts "base_name=#{name}"
|
@@ -453,7 +447,7 @@ if $0 == __FILE__
|
|
453
447
|
#exit
|
454
448
|
#buf = update_source(ARGV[0])
|
455
449
|
#puts buf
|
456
|
-
@config = { "exclude_path" => "
|
450
|
+
@config = { "exclude_path" => "" }
|
457
451
|
|
458
452
|
if true
|
459
453
|
puts create_uml_class(ARGV[0], ARGV[1])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: CppUmlClass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masataka Kuwayama
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: browser_app_base
|