yard-sketchup 1.0.0 → 1.0.1
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 +5 -5
- data/lib/yard-sketchup.rb +6 -1
- data/lib/yard-sketchup/templates/rubocop-changelog/fulldoc/text/setup.rb +75 -75
- data/lib/yard-sketchup/version.rb +1 -1
- data/lib/yard-sketchup/yard/handlers/class_constants.rb +17 -17
- data/lib/yard-sketchup/yard/handlers/class_enum_constants.rb +17 -17
- data/lib/yard-sketchup/yard/handlers/global_constants.rb +19 -19
- data/lib/yard-sketchup/yard/logger.rb +45 -45
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: '084e3be9a0938d97bd50f24073a7c89b23ea01ea6f9311d527d6953946b60016'
|
4
|
+
data.tar.gz: a076d6f82578890e28f285032d1e7789a74abc848f2f5a6715214c35681ad164
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05f0fdfbf89178ef42250eb52ca8c6a27589c6ea4276f6f3ebf1571bf5e6466e7d08ed86248372f601fd0e50b1d39d8206637c23b97f74047a97ee92f14ea348
|
7
|
+
data.tar.gz: 99d47493bf38149b0ffc9106c13a0cf97d219ce633c7a80ca978c2e7ae6086fcdabf550cc107c2eece7e35c8fdb4eebe3b528cec049b4647342ffc9beed28f50
|
data/lib/yard-sketchup.rb
CHANGED
@@ -17,7 +17,12 @@ module SketchUpYARD
|
|
17
17
|
YARD::Templates::Engine.register_template_path self.templates_path
|
18
18
|
|
19
19
|
# https://www.rubydoc.info/gems/yard/file/docs/TagsArch.md#Adding_Custom_Tags
|
20
|
-
|
20
|
+
# https://github.com/lsegal/yard/issues/1227
|
21
|
+
# Custom visible tags:
|
22
|
+
tags = [
|
23
|
+
YARD::Tags::Library.define_tag('Known Bugs', :bug),
|
24
|
+
]
|
25
|
+
YARD::Tags::Library.visible_tags |= tags
|
21
26
|
end
|
22
27
|
|
23
28
|
def self.templates_path
|
@@ -1,75 +1,75 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
require 'set'
|
3
|
-
require 'stringio'
|
4
|
-
|
5
|
-
include Helpers::ModuleHelper
|
6
|
-
|
7
|
-
def init
|
8
|
-
generate_changelog
|
9
|
-
end
|
10
|
-
|
11
|
-
|
12
|
-
def all_objects
|
13
|
-
run_verifier(Registry.all())
|
14
|
-
end
|
15
|
-
|
16
|
-
def namespace_objects
|
17
|
-
run_verifier(Registry.all(:class, :module))
|
18
|
-
end
|
19
|
-
|
20
|
-
|
21
|
-
def changelog_filename
|
22
|
-
'Changelog SU201x.log'
|
23
|
-
end
|
24
|
-
|
25
|
-
VERSION_MATCH = /^\D+([0-9.]+)(?:\s+M(\d+))?$/
|
26
|
-
|
27
|
-
def generate_changelog
|
28
|
-
output = StringIO.new
|
29
|
-
|
30
|
-
versions = Hash.new
|
31
|
-
all_objects.each { |object|
|
32
|
-
version_tag = object.tag(:version)
|
33
|
-
next if version_tag.nil?
|
34
|
-
version = version_tag.text
|
35
|
-
|
36
|
-
# Don't list SU6 or older.
|
37
|
-
next if version.match(VERSION_MATCH).captures[0].to_i <= 6
|
38
|
-
|
39
|
-
versions[version] ||= {}
|
40
|
-
versions[version][object.type] ||= []
|
41
|
-
versions[version][object.type] << object.path
|
42
|
-
}
|
43
|
-
versions = versions.sort { |a, b|
|
44
|
-
v1, mv1 = a[0].match(VERSION_MATCH).captures
|
45
|
-
v2, mv2 = b[0].match(VERSION_MATCH).captures
|
46
|
-
if v1 == v2
|
47
|
-
(mv2 || '0').to_i <=> (mv1 || '0').to_i
|
48
|
-
else
|
49
|
-
v2.to_f <=> v1.to_f
|
50
|
-
end
|
51
|
-
}
|
52
|
-
|
53
|
-
output.puts "FEATURES = ["
|
54
|
-
versions.each { |version, features|
|
55
|
-
output.puts ""
|
56
|
-
output.puts " {"
|
57
|
-
output.puts " version: '#{version}',"
|
58
|
-
output.puts " types: {"
|
59
|
-
features.sort.each { |type, objects|
|
60
|
-
unless objects.empty?
|
61
|
-
output.puts " #{type}: ["
|
62
|
-
objects.sort.each { |object|
|
63
|
-
output.puts " '#{object}',"
|
64
|
-
}
|
65
|
-
output.puts " ],"
|
66
|
-
end
|
67
|
-
}
|
68
|
-
output.puts " },"
|
69
|
-
output.puts " },"
|
70
|
-
}
|
71
|
-
output.puts "]"
|
72
|
-
|
73
|
-
puts output.string
|
74
|
-
exit # Avoid the YARD summary
|
75
|
-
end
|
1
|
+
require 'fileutils'
|
2
|
+
require 'set'
|
3
|
+
require 'stringio'
|
4
|
+
|
5
|
+
include Helpers::ModuleHelper
|
6
|
+
|
7
|
+
def init
|
8
|
+
generate_changelog
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
def all_objects
|
13
|
+
run_verifier(Registry.all())
|
14
|
+
end
|
15
|
+
|
16
|
+
def namespace_objects
|
17
|
+
run_verifier(Registry.all(:class, :module))
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
def changelog_filename
|
22
|
+
'Changelog SU201x.log'
|
23
|
+
end
|
24
|
+
|
25
|
+
VERSION_MATCH = /^\D+([0-9.]+)(?:\s+M(\d+))?$/
|
26
|
+
|
27
|
+
def generate_changelog
|
28
|
+
output = StringIO.new
|
29
|
+
|
30
|
+
versions = Hash.new
|
31
|
+
all_objects.each { |object|
|
32
|
+
version_tag = object.tag(:version)
|
33
|
+
next if version_tag.nil?
|
34
|
+
version = version_tag.text
|
35
|
+
|
36
|
+
# Don't list SU6 or older.
|
37
|
+
next if version.match(VERSION_MATCH).captures[0].to_i <= 6
|
38
|
+
|
39
|
+
versions[version] ||= {}
|
40
|
+
versions[version][object.type] ||= []
|
41
|
+
versions[version][object.type] << object.path
|
42
|
+
}
|
43
|
+
versions = versions.sort { |a, b|
|
44
|
+
v1, mv1 = a[0].match(VERSION_MATCH).captures
|
45
|
+
v2, mv2 = b[0].match(VERSION_MATCH).captures
|
46
|
+
if v1 == v2
|
47
|
+
(mv2 || '0').to_i <=> (mv1 || '0').to_i
|
48
|
+
else
|
49
|
+
v2.to_f <=> v1.to_f
|
50
|
+
end
|
51
|
+
}
|
52
|
+
|
53
|
+
output.puts "FEATURES = ["
|
54
|
+
versions.each { |version, features|
|
55
|
+
output.puts ""
|
56
|
+
output.puts " {"
|
57
|
+
output.puts " version: '#{version}',"
|
58
|
+
output.puts " types: {"
|
59
|
+
features.sort.each { |type, objects|
|
60
|
+
unless objects.empty?
|
61
|
+
output.puts " #{type}: ["
|
62
|
+
objects.sort.each { |object|
|
63
|
+
output.puts " '#{object}',"
|
64
|
+
}
|
65
|
+
output.puts " ],"
|
66
|
+
end
|
67
|
+
}
|
68
|
+
output.puts " },"
|
69
|
+
output.puts " },"
|
70
|
+
}
|
71
|
+
output.puts "]"
|
72
|
+
|
73
|
+
puts output.string
|
74
|
+
exit # Avoid the YARD summary
|
75
|
+
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
module SketchUpYARD
|
2
|
-
class ClassConstantHandler < YARD::Handlers::C::Base
|
3
|
-
|
4
|
-
MATCH = %r{\bDEFINE_RUBY_CLASS_CONSTANT\s*\(([^,]+)\s*,\s*([^,]+)\s*,\s*(\w+)\s*\)\s*;}xm
|
5
|
-
handles MATCH
|
6
|
-
statement_class BodyStatement
|
7
|
-
|
8
|
-
process do
|
9
|
-
statement.source.scan(MATCH) do |klass_name, value, const_name|
|
10
|
-
type = "const"
|
11
|
-
value = "nil"
|
12
|
-
handle_constants(type, klass_name, const_name, value)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|
1
|
+
module SketchUpYARD
|
2
|
+
class ClassConstantHandler < YARD::Handlers::C::Base
|
3
|
+
|
4
|
+
MATCH = %r{\bDEFINE_RUBY_CLASS_CONSTANT\s*\(([^,]+)\s*,\s*([^,]+)\s*,\s*(\w+)\s*\)\s*;}xm
|
5
|
+
handles MATCH
|
6
|
+
statement_class BodyStatement
|
7
|
+
|
8
|
+
process do
|
9
|
+
statement.source.scan(MATCH) do |klass_name, value, const_name|
|
10
|
+
type = "const"
|
11
|
+
value = "nil"
|
12
|
+
handle_constants(type, klass_name, const_name, value)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
module SketchUpYARD
|
2
|
-
class ClassEnumConstantHandler < YARD::Handlers::C::Base
|
3
|
-
|
4
|
-
MATCH = %r{\bDEFINE_RUBY_CLASS_ENUM\s*\(([^,]+)\s*,\s*(\w+)\s*\)\s*;}xm
|
5
|
-
handles MATCH
|
6
|
-
statement_class BodyStatement
|
7
|
-
|
8
|
-
process do
|
9
|
-
statement.source.scan(MATCH) do |klass_name, const_name|
|
10
|
-
type = "const"
|
11
|
-
value = "nil"
|
12
|
-
handle_constants(type, klass_name, const_name, value)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|
1
|
+
module SketchUpYARD
|
2
|
+
class ClassEnumConstantHandler < YARD::Handlers::C::Base
|
3
|
+
|
4
|
+
MATCH = %r{\bDEFINE_RUBY_CLASS_ENUM\s*\(([^,]+)\s*,\s*(\w+)\s*\)\s*;}xm
|
5
|
+
handles MATCH
|
6
|
+
statement_class BodyStatement
|
7
|
+
|
8
|
+
process do
|
9
|
+
statement.source.scan(MATCH) do |klass_name, const_name|
|
10
|
+
type = "const"
|
11
|
+
value = "nil"
|
12
|
+
handle_constants(type, klass_name, const_name, value)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
module SketchUpYARD
|
2
|
-
class GlobalConstantHandler < YARD::Handlers::C::Base
|
3
|
-
|
4
|
-
MATCH = %r{\bDEFINE_RUBY_(?:(?:NAMED_)?CONSTANT|ENUM)\s*\((?:[^)]+,\s*)?(\w+)\)\s*;}xm
|
5
|
-
handles MATCH
|
6
|
-
statement_class BodyStatement
|
7
|
-
|
8
|
-
process do
|
9
|
-
statement.source.scan(MATCH) do |captures|
|
10
|
-
const_name = captures.first
|
11
|
-
type = "global_const"
|
12
|
-
var_name = nil
|
13
|
-
value = "nil"
|
14
|
-
handle_constants(type, var_name, const_name, value)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
end
|
1
|
+
module SketchUpYARD
|
2
|
+
class GlobalConstantHandler < YARD::Handlers::C::Base
|
3
|
+
|
4
|
+
MATCH = %r{\bDEFINE_RUBY_(?:(?:NAMED_)?CONSTANT|ENUM)\s*\((?:[^)]+,\s*)?(\w+)\)\s*;}xm
|
5
|
+
handles MATCH
|
6
|
+
statement_class BodyStatement
|
7
|
+
|
8
|
+
process do
|
9
|
+
statement.source.scan(MATCH) do |captures|
|
10
|
+
const_name = captures.first
|
11
|
+
type = "global_const"
|
12
|
+
var_name = nil
|
13
|
+
value = "nil"
|
14
|
+
handle_constants(type, var_name, const_name, value)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -1,45 +1,45 @@
|
|
1
|
-
require 'yard/logging'
|
2
|
-
|
3
|
-
# Hack to show some progress on Windows while building the docs.
|
4
|
-
# Helpful in seeing what takes most time.
|
5
|
-
# It's Copy+Paste from YARD 0.9.9 with some noted edits.
|
6
|
-
module YARD
|
7
|
-
class Logger < ::Logger
|
8
|
-
|
9
|
-
def show_progress
|
10
|
-
return false if YARD.ruby18? # threading is too ineffective for progress support
|
11
|
-
# <hack>
|
12
|
-
# return false if YARD.windows? # windows has poor ANSI support
|
13
|
-
# </hack>
|
14
|
-
return false unless io.tty? # no TTY support on IO
|
15
|
-
return false unless level > INFO # no progress in verbose/debug modes
|
16
|
-
@show_progress
|
17
|
-
end
|
18
|
-
|
19
|
-
def progress(msg, nontty_log = :debug)
|
20
|
-
send(nontty_log, msg) if nontty_log
|
21
|
-
return unless show_progress
|
22
|
-
icon = ""
|
23
|
-
if defined?(::Encoding)
|
24
|
-
icon = PROGRESS_INDICATORS[@progress_indicator] + " "
|
25
|
-
end
|
26
|
-
@mutex.synchronize do
|
27
|
-
print("\e[2K\e[?25l\e[1m#{icon}#{msg}\e[0m\r")
|
28
|
-
@progress_msg = msg
|
29
|
-
if Time.now - @progress_last_update > 0.2
|
30
|
-
@progress_indicator += 1
|
31
|
-
@progress_indicator %= PROGRESS_INDICATORS.size
|
32
|
-
@progress_last_update = Time.now
|
33
|
-
end
|
34
|
-
end
|
35
|
-
Thread.new do
|
36
|
-
sleep(0.05)
|
37
|
-
# <hack>
|
38
|
-
# progress(msg + ".", nil) if @progress_msg == msg
|
39
|
-
# </hack>
|
40
|
-
progress(msg, nil) if @progress_msg == msg
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
end if true # Set to false to disable hack.
|
1
|
+
require 'yard/logging'
|
2
|
+
|
3
|
+
# Hack to show some progress on Windows while building the docs.
|
4
|
+
# Helpful in seeing what takes most time.
|
5
|
+
# It's Copy+Paste from YARD 0.9.9 with some noted edits.
|
6
|
+
module YARD
|
7
|
+
class Logger < ::Logger
|
8
|
+
|
9
|
+
def show_progress
|
10
|
+
return false if YARD.ruby18? # threading is too ineffective for progress support
|
11
|
+
# <hack>
|
12
|
+
# return false if YARD.windows? # windows has poor ANSI support
|
13
|
+
# </hack>
|
14
|
+
return false unless io.tty? # no TTY support on IO
|
15
|
+
return false unless level > INFO # no progress in verbose/debug modes
|
16
|
+
@show_progress
|
17
|
+
end
|
18
|
+
|
19
|
+
def progress(msg, nontty_log = :debug)
|
20
|
+
send(nontty_log, msg) if nontty_log
|
21
|
+
return unless show_progress
|
22
|
+
icon = ""
|
23
|
+
if defined?(::Encoding)
|
24
|
+
icon = PROGRESS_INDICATORS[@progress_indicator] + " "
|
25
|
+
end
|
26
|
+
@mutex.synchronize do
|
27
|
+
print("\e[2K\e[?25l\e[1m#{icon}#{msg}\e[0m\r")
|
28
|
+
@progress_msg = msg
|
29
|
+
if Time.now - @progress_last_update > 0.2
|
30
|
+
@progress_indicator += 1
|
31
|
+
@progress_indicator %= PROGRESS_INDICATORS.size
|
32
|
+
@progress_last_update = Time.now
|
33
|
+
end
|
34
|
+
end
|
35
|
+
Thread.new do
|
36
|
+
sleep(0.05)
|
37
|
+
# <hack>
|
38
|
+
# progress(msg + ".", nil) if @progress_msg == msg
|
39
|
+
# </hack>
|
40
|
+
progress(msg, nil) if @progress_msg == msg
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end if true # Set to false to disable hack.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard-sketchup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trimble Inc, SketchUp Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|
@@ -93,8 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
|
-
|
97
|
-
rubygems_version: 2.6.14
|
96
|
+
rubygems_version: 3.0.3
|
98
97
|
signing_key:
|
99
98
|
specification_version: 4
|
100
99
|
summary: SketchUp Ruby API YARD template.
|