comment_strip-ruby 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -2
- data/lib/comment_strip/language_families/c.rb +250 -0
- data/lib/comment_strip/strip.rb +19 -206
- data/lib/comment_strip/version.rb +3 -3
- data/lib/comment_strip.rb +10 -3
- data/test/scratch/ex1.rb +7 -0
- data/test/unit/tc_strip.rb +2 -2
- data/test/unit/tc_version.rb +1 -1
- data/test/unit/ts_all.rb +1 -1
- metadata +26 -6
- data/lib/comment_strip/comment_strip.rb +0 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69539de8b13faa339084af8667f5e062f1b7d3244861a3008d74622d74af5eb6
|
4
|
+
data.tar.gz: acc60fe0c8e9d094b204ad35e2d6b6370d4e11d5f5e677103ffd2ba943f0fc7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76a23018cbd60b02fc811132a103676158603b6dfd8c038b15f5671a0704d983ba3bfe54c0e70dedd72e98cf3e9de1cf972c48c3268cdc4385c6f685c9e04332
|
7
|
+
data.tar.gz: d4c21de13d0bf22a7b482b71899bd9a7163dc712c685d4b336234b30d4318d04f9621769723a9e56a914fbe8e58f1ddf0f7dec7d2ee1a2b3bff98ba70f2fb6fb
|
data/README.md
CHANGED
@@ -16,7 +16,17 @@ T.B.C.
|
|
16
16
|
|
17
17
|
## Installation
|
18
18
|
|
19
|
-
Install
|
19
|
+
Install directly:
|
20
|
+
|
21
|
+
```bash
|
22
|
+
$ gem install comment_strip-ruby
|
23
|
+
```
|
24
|
+
|
25
|
+
or add it to your `Gemfile`:
|
26
|
+
|
27
|
+
```plaintext
|
28
|
+
gem 'comment_strip-ruby'
|
29
|
+
```
|
20
30
|
|
21
31
|
## Components
|
22
32
|
|
@@ -24,7 +34,16 @@ T.B.C.
|
|
24
34
|
|
25
35
|
## Examples
|
26
36
|
|
27
|
-
|
37
|
+
It is as simple as the following:
|
38
|
+
|
39
|
+
```Ruby
|
40
|
+
require 'comment_strip'
|
41
|
+
|
42
|
+
stripped = CommentStrip.strip($stdin.read, :C)
|
43
|
+
|
44
|
+
puts "Stripped form of input:\n#{stripped}"
|
45
|
+
```
|
46
|
+
|
28
47
|
|
29
48
|
## Project Information
|
30
49
|
|
@@ -0,0 +1,250 @@
|
|
1
|
+
# ######################################################################## #
|
2
|
+
# File: comment_strip/language_families/c.rb
|
3
|
+
#
|
4
|
+
# Purpose: Definition of strip() function for C-family languages.
|
5
|
+
#
|
6
|
+
# Created: 14th September 2020
|
7
|
+
# Updated: 11th July 2022
|
8
|
+
#
|
9
|
+
# Home: http://github.com/synesissoftware/comment_strip.r
|
10
|
+
#
|
11
|
+
# Copyright (c) 2020-2022, Matthew Wilson and Synesis Information Systems
|
12
|
+
# All rights reserved.
|
13
|
+
#
|
14
|
+
# Redistribution and use in source and binary forms, with or without
|
15
|
+
# modification, are permitted provided that the following conditions are
|
16
|
+
# met:
|
17
|
+
#
|
18
|
+
# * Redistributions of source code must retain the above copyright notice,
|
19
|
+
# this list of conditions and the following disclaimer.
|
20
|
+
#
|
21
|
+
# * Redistributions in binary form must reproduce the above copyright
|
22
|
+
# notice, this list of conditions and the following disclaimer in the
|
23
|
+
# documentation and/or other materials provided with the distribution.
|
24
|
+
#
|
25
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
26
|
+
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
27
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
28
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
29
|
+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
30
|
+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
31
|
+
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
32
|
+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
33
|
+
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
34
|
+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
35
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
36
|
+
#
|
37
|
+
# ######################################################################## #
|
38
|
+
|
39
|
+
|
40
|
+
require 'xqsr3/quality/parameter_checking'
|
41
|
+
|
42
|
+
=begin
|
43
|
+
=end
|
44
|
+
|
45
|
+
module CommentStrip
|
46
|
+
module LanguageFamilies
|
47
|
+
|
48
|
+
module C
|
49
|
+
|
50
|
+
def self.strip input, lf, **options
|
51
|
+
|
52
|
+
return nil if input.nil?
|
53
|
+
return input if input.empty?
|
54
|
+
|
55
|
+
line = 0
|
56
|
+
column = 0
|
57
|
+
|
58
|
+
state = :text
|
59
|
+
|
60
|
+
r = ''
|
61
|
+
|
62
|
+
cc_lines = 0
|
63
|
+
|
64
|
+
input.each_char do |c|
|
65
|
+
|
66
|
+
case c
|
67
|
+
when ?\r, ?\n
|
68
|
+
|
69
|
+
line += 1
|
70
|
+
column = 0
|
71
|
+
else
|
72
|
+
|
73
|
+
column += 1
|
74
|
+
end
|
75
|
+
|
76
|
+
skip = false
|
77
|
+
|
78
|
+
case c
|
79
|
+
when ?\r, ?\n
|
80
|
+
|
81
|
+
case state
|
82
|
+
when :c_comment, :c_comment_star
|
83
|
+
|
84
|
+
cc_lines += 1
|
85
|
+
|
86
|
+
state = :c_comment
|
87
|
+
when :cpp_comment
|
88
|
+
|
89
|
+
state = :text
|
90
|
+
when :sq_string, :sq_string_escape, :sq_string_closing
|
91
|
+
|
92
|
+
state = :text
|
93
|
+
when :dq_string_escape
|
94
|
+
|
95
|
+
state = :dq_string
|
96
|
+
when :slash_start
|
97
|
+
|
98
|
+
r << '/'
|
99
|
+
|
100
|
+
state = :text
|
101
|
+
end
|
102
|
+
else
|
103
|
+
|
104
|
+
# special cases:
|
105
|
+
#
|
106
|
+
# - for escaped single/double quote
|
107
|
+
# - for slash-start
|
108
|
+
# - for comment-star
|
109
|
+
|
110
|
+
case state
|
111
|
+
when :sq_string_open
|
112
|
+
|
113
|
+
state = (?\\ == c) ? :sq_string_escape : :sq_string_closing
|
114
|
+
when :sq_string_escape
|
115
|
+
|
116
|
+
state = :sq_string_closing
|
117
|
+
when :dq_string_escape
|
118
|
+
|
119
|
+
state = :dq_string
|
120
|
+
when :c_comment_star
|
121
|
+
|
122
|
+
case c
|
123
|
+
when ?/
|
124
|
+
|
125
|
+
r << ?\n * cc_lines
|
126
|
+
cc_lines = 0
|
127
|
+
|
128
|
+
state = :text
|
129
|
+
skip = true
|
130
|
+
when '*'
|
131
|
+
|
132
|
+
;
|
133
|
+
else
|
134
|
+
|
135
|
+
state = :c_comment
|
136
|
+
end
|
137
|
+
else
|
138
|
+
|
139
|
+
if false
|
140
|
+
elsif state == :slash_start && ('/' != c && '*' != c)
|
141
|
+
|
142
|
+
state = :text
|
143
|
+
r << '/'
|
144
|
+
else
|
145
|
+
|
146
|
+
case c
|
147
|
+
when '/'
|
148
|
+
|
149
|
+
case state
|
150
|
+
when :text
|
151
|
+
|
152
|
+
state = :slash_start
|
153
|
+
when :slash_start
|
154
|
+
|
155
|
+
state = :cpp_comment
|
156
|
+
when :c_comment_star
|
157
|
+
|
158
|
+
r << ?\n * cc_lines
|
159
|
+
cc_lines = 0
|
160
|
+
|
161
|
+
state = :text
|
162
|
+
skip = true
|
163
|
+
end
|
164
|
+
when '*'
|
165
|
+
|
166
|
+
case state
|
167
|
+
when :slash_start
|
168
|
+
|
169
|
+
state = :c_comment
|
170
|
+
when :c_comment
|
171
|
+
|
172
|
+
state = :c_comment_star
|
173
|
+
else
|
174
|
+
|
175
|
+
end
|
176
|
+
|
177
|
+
when ?\'
|
178
|
+
|
179
|
+
case state
|
180
|
+
when :text
|
181
|
+
|
182
|
+
state = :sq_string_open
|
183
|
+
when :sq_string_closing
|
184
|
+
|
185
|
+
state = :text
|
186
|
+
else
|
187
|
+
|
188
|
+
end
|
189
|
+
when '"'
|
190
|
+
|
191
|
+
case state
|
192
|
+
when :text
|
193
|
+
|
194
|
+
state = :dq_string
|
195
|
+
when :dq_string
|
196
|
+
|
197
|
+
state = :text
|
198
|
+
else
|
199
|
+
end
|
200
|
+
when ?\\
|
201
|
+
|
202
|
+
case state
|
203
|
+
when :sq_string_open
|
204
|
+
|
205
|
+
state = :sq_string_escape
|
206
|
+
when :sq_string_escape
|
207
|
+
|
208
|
+
state = :sq_string
|
209
|
+
when :dq_string
|
210
|
+
|
211
|
+
state = :dq_string_escape
|
212
|
+
else
|
213
|
+
|
214
|
+
end
|
215
|
+
else
|
216
|
+
|
217
|
+
case state
|
218
|
+
when :sq_string_escape
|
219
|
+
|
220
|
+
state = :sq_string_closing
|
221
|
+
else
|
222
|
+
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
|
230
|
+
case state
|
231
|
+
when :slash_start
|
232
|
+
when :cpp_comment
|
233
|
+
when :c_comment
|
234
|
+
when :c_comment_star
|
235
|
+
|
236
|
+
else
|
237
|
+
|
238
|
+
r << c unless skip
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
r
|
243
|
+
end
|
244
|
+
end # module C
|
245
|
+
|
246
|
+
end # module LanguageFamilies
|
247
|
+
end # module CommentStrip
|
248
|
+
|
249
|
+
# ############################## end of file ############################# #
|
250
|
+
|
data/lib/comment_strip/strip.rb
CHANGED
@@ -4,11 +4,11 @@
|
|
4
4
|
# Purpose: Definition of strip() function
|
5
5
|
#
|
6
6
|
# Created: 14th September 2020
|
7
|
-
# Updated:
|
7
|
+
# Updated: 11th July 2022
|
8
8
|
#
|
9
9
|
# Home: http://github.com/synesissoftware/comment_strip.r
|
10
10
|
#
|
11
|
-
# Copyright (c) 2020-
|
11
|
+
# Copyright (c) 2020-2022, Matthew Wilson and Synesis Information Systems
|
12
12
|
# All rights reserved.
|
13
13
|
#
|
14
14
|
# Redistribution and use in source and binary forms, with or without
|
@@ -37,236 +37,49 @@
|
|
37
37
|
# ######################################################################## #
|
38
38
|
|
39
39
|
|
40
|
+
require File.join(__dir__, 'language_families', 'c')
|
41
|
+
|
42
|
+
require 'xqsr3/quality/parameter_checking'
|
40
43
|
|
41
44
|
=begin
|
42
45
|
=end
|
43
46
|
|
44
47
|
module CommentStrip
|
45
48
|
|
49
|
+
include ::Xqsr3::Quality::ParameterChecking
|
50
|
+
|
46
51
|
# Strips comments from an input string, according to the rules and
|
47
52
|
# conventions of a given language-family
|
48
53
|
#
|
49
54
|
# === Signature
|
50
55
|
#
|
51
56
|
# * *Parameters:*
|
52
|
-
# - +
|
57
|
+
# - +input+ (::String, +nil+) the input source code
|
53
58
|
# - +lf+ (::String) the name of the language family. Currently only
|
54
59
|
# the value +'C'+ is accepted
|
55
60
|
# - +options+ (::Hash) options that moderate the behaviour
|
56
61
|
#
|
57
62
|
# * *Options:*
|
63
|
+
# None currently defined.
|
58
64
|
#
|
59
|
-
|
65
|
+
# === Signature
|
66
|
+
# (String) The stripped for of the input.
|
67
|
+
def strip input, lf, **options
|
60
68
|
|
61
|
-
|
69
|
+
check_parameter input, 'input', responds_to: [ :each_char, :empty?, :nil?, ], nil: true
|
70
|
+
check_parameter lf, 'lf', types: [ ::String, ::Symbol ]
|
71
|
+
|
72
|
+
case lf.to_s.upcase
|
62
73
|
when 'C'
|
63
74
|
|
64
|
-
|
75
|
+
LanguageFamilies::C.strip input, lf, **options
|
65
76
|
else
|
66
77
|
|
67
|
-
raise "language family '#{lf}' unrecognised"
|
68
|
-
end
|
69
|
-
|
70
|
-
return nil if s.nil?
|
71
|
-
return s if s.empty?
|
72
|
-
|
73
|
-
line = 0
|
74
|
-
column = 0
|
75
|
-
|
76
|
-
state = :text
|
77
|
-
|
78
|
-
r = ''
|
79
|
-
|
80
|
-
cc_lines = 0
|
81
|
-
|
82
|
-
s.each_char do |c|
|
83
|
-
|
84
|
-
case c
|
85
|
-
when ?\r, ?\n
|
86
|
-
|
87
|
-
line += 1
|
88
|
-
column = 0
|
89
|
-
else
|
90
|
-
|
91
|
-
column += 1
|
92
|
-
end
|
93
|
-
|
94
|
-
skip = false
|
95
|
-
|
96
|
-
case c
|
97
|
-
when ?\r, ?\n
|
98
|
-
|
99
|
-
case state
|
100
|
-
when :c_comment, :c_comment_star
|
101
|
-
|
102
|
-
cc_lines += 1
|
103
|
-
|
104
|
-
state = :c_comment
|
105
|
-
when :cpp_comment
|
106
|
-
|
107
|
-
state = :text
|
108
|
-
when :sq_string, :sq_string_escape, :sq_string_closing
|
109
|
-
|
110
|
-
state = :text
|
111
|
-
when :dq_string_escape
|
112
|
-
|
113
|
-
state = :dq_string
|
114
|
-
when :slash_start
|
115
|
-
|
116
|
-
r << '/'
|
117
|
-
|
118
|
-
state = :text
|
119
|
-
end
|
120
|
-
else
|
121
|
-
|
122
|
-
# special cases:
|
123
|
-
#
|
124
|
-
# - for escaped single/double quote
|
125
|
-
# - for slash-start
|
126
|
-
# - for comment-star
|
127
|
-
|
128
|
-
case state
|
129
|
-
when :sq_string_open
|
130
|
-
|
131
|
-
state = (?\\ == c) ? :sq_string_escape : :sq_string_closing
|
132
|
-
when :sq_string_escape
|
133
|
-
|
134
|
-
state = :sq_string_closing
|
135
|
-
when :dq_string_escape
|
136
|
-
|
137
|
-
state = :dq_string
|
138
|
-
when :c_comment_star
|
139
|
-
|
140
|
-
case c
|
141
|
-
when ?/
|
142
|
-
|
143
|
-
r << ?\n * cc_lines
|
144
|
-
cc_lines = 0
|
145
|
-
|
146
|
-
state = :text
|
147
|
-
skip = true
|
148
|
-
when '*'
|
149
|
-
|
150
|
-
;
|
151
|
-
else
|
152
|
-
|
153
|
-
state = :c_comment
|
154
|
-
end
|
155
|
-
else
|
156
|
-
|
157
|
-
if false
|
158
|
-
elsif state == :slash_start && ('/' != c && '*' != c)
|
159
|
-
|
160
|
-
state = :text
|
161
|
-
r << '/'
|
162
|
-
else
|
163
|
-
|
164
|
-
case c
|
165
|
-
when '/'
|
166
|
-
|
167
|
-
case state
|
168
|
-
when :text
|
169
|
-
|
170
|
-
state = :slash_start
|
171
|
-
when :slash_start
|
172
|
-
|
173
|
-
state = :cpp_comment
|
174
|
-
when :c_comment_star
|
175
|
-
|
176
|
-
r << ?\n * cc_lines
|
177
|
-
cc_lines = 0
|
178
|
-
|
179
|
-
state = :text
|
180
|
-
skip = true
|
181
|
-
end
|
182
|
-
when '*'
|
183
|
-
|
184
|
-
case state
|
185
|
-
when :slash_start
|
186
|
-
|
187
|
-
state = :c_comment
|
188
|
-
when :c_comment
|
189
|
-
|
190
|
-
state = :c_comment_star
|
191
|
-
else
|
192
|
-
|
193
|
-
end
|
194
|
-
|
195
|
-
when ?\'
|
196
|
-
|
197
|
-
case state
|
198
|
-
when :text
|
199
|
-
|
200
|
-
state = :sq_string_open
|
201
|
-
when :sq_string_closing
|
202
|
-
|
203
|
-
state = :text
|
204
|
-
else
|
205
|
-
|
206
|
-
end
|
207
|
-
when '"'
|
208
|
-
|
209
|
-
case state
|
210
|
-
when :text
|
211
|
-
|
212
|
-
state = :dq_string
|
213
|
-
when :dq_string
|
214
|
-
|
215
|
-
state = :text
|
216
|
-
else
|
217
|
-
end
|
218
|
-
when ?\\
|
219
|
-
|
220
|
-
case state
|
221
|
-
when :sq_string_open
|
222
|
-
|
223
|
-
state = :sq_string_escape
|
224
|
-
when :sq_string_escape
|
225
|
-
|
226
|
-
state = :sq_string
|
227
|
-
when :dq_string
|
228
|
-
|
229
|
-
state = :dq_string_escape
|
230
|
-
else
|
231
|
-
|
232
|
-
end
|
233
|
-
else
|
234
|
-
|
235
|
-
case state
|
236
|
-
when :sq_string_escape
|
237
|
-
|
238
|
-
state = :sq_string_closing
|
239
|
-
else
|
240
|
-
|
241
|
-
end
|
242
|
-
end
|
243
|
-
end
|
244
|
-
end
|
245
|
-
end
|
246
|
-
|
247
|
-
$stderr.puts "[#{line}, #{column}] state=#{state}, c=#{c} (#{c.ord}); skip=#{skip} [#cc lines: #{cc_lines}]\n" if $DEBUG
|
248
|
-
|
249
|
-
case state
|
250
|
-
when :slash_start
|
251
|
-
when :cpp_comment
|
252
|
-
when :c_comment
|
253
|
-
when :c_comment_star
|
254
|
-
|
255
|
-
else
|
256
|
-
|
257
|
-
r << c unless skip
|
258
|
-
end
|
78
|
+
raise "language family '#{lf}' unrecognised or not supported1"
|
259
79
|
end
|
260
|
-
|
261
|
-
r
|
262
|
-
end
|
263
|
-
|
264
|
-
# Strips comments
|
265
|
-
def strip s, lf, **options
|
266
|
-
|
267
|
-
::CommentStrip.strip s, lf, **options
|
268
80
|
end
|
269
81
|
|
82
|
+
extend self
|
270
83
|
end # module CommentStrip
|
271
84
|
|
272
85
|
# ############################## end of file ############################# #
|
@@ -4,11 +4,11 @@
|
|
4
4
|
# Purpose: Version for comment_strip.r library
|
5
5
|
#
|
6
6
|
# Created: 14th September 2020
|
7
|
-
# Updated:
|
7
|
+
# Updated: 11th July 2022
|
8
8
|
#
|
9
9
|
# Home: http://github.com/synesissoftware/comment_strip.r
|
10
10
|
#
|
11
|
-
# Copyright (c) 2020-
|
11
|
+
# Copyright (c) 2020-2022, Matthew Wilson and Synesis Information Systems
|
12
12
|
# All rights reserved.
|
13
13
|
#
|
14
14
|
# Redistribution and use in source and binary forms, with or without
|
@@ -43,7 +43,7 @@
|
|
43
43
|
module CommentStrip
|
44
44
|
|
45
45
|
# Current version of the comment_strip.r library
|
46
|
-
VERSION = '0.1.
|
46
|
+
VERSION = '0.1.2'
|
47
47
|
|
48
48
|
private
|
49
49
|
VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
|
data/lib/comment_strip.rb
CHANGED
@@ -4,11 +4,11 @@
|
|
4
4
|
# Purpose: Top-level include for comment_strip.r library
|
5
5
|
#
|
6
6
|
# Created: 14th September 2020
|
7
|
-
# Updated:
|
7
|
+
# Updated: 11th July 2022
|
8
8
|
#
|
9
9
|
# Home: http://github.com/synesissoftware/comment_strip.r
|
10
10
|
#
|
11
|
-
# Copyright (c) 2020, Matthew Wilson and Synesis Information Systems
|
11
|
+
# Copyright (c) 2020-2022, Matthew Wilson and Synesis Information Systems
|
12
12
|
# All rights reserved.
|
13
13
|
#
|
14
14
|
# Redistribution and use in source and binary forms, with or without
|
@@ -37,10 +37,17 @@
|
|
37
37
|
# ######################################################################## #
|
38
38
|
|
39
39
|
|
40
|
+
%w{
|
41
|
+
strip
|
42
|
+
version
|
43
|
+
}.each { |mod_name| require File.join(__dir__, 'comment_strip', mod_name) }
|
44
|
+
|
40
45
|
=begin
|
41
46
|
=end
|
42
47
|
|
43
|
-
|
48
|
+
# Main module for comment_strip.r library
|
49
|
+
module CommentStrip
|
50
|
+
end # module CommentStrip
|
44
51
|
|
45
52
|
# ############################## end of file ############################# #
|
46
53
|
|
data/test/scratch/ex1.rb
ADDED
data/test/unit/tc_strip.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
|
3
|
-
$:.unshift File.join(
|
3
|
+
$:.unshift File.join(__dir__, '../..', 'lib')
|
4
4
|
|
5
5
|
|
6
6
|
require 'comment_strip'
|
@@ -45,7 +45,7 @@ class Test_strip_1 < Test::Unit::TestCase
|
|
45
45
|
def test_empty
|
46
46
|
|
47
47
|
assert_equal "", strip('', 'C')
|
48
|
-
assert_equal "", ::CommentStrip.strip('',
|
48
|
+
assert_equal "", ::CommentStrip.strip('', :C)
|
49
49
|
end
|
50
50
|
|
51
51
|
def test_simple_main
|
data/test/unit/tc_version.rb
CHANGED
data/test/unit/ts_all.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comment_strip-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Wilson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
11
|
+
date: 2022-07-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: xqsr3
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.37'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.37.2
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.37'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.37.2
|
13
33
|
description: "Source code comment stripping library\n\n"
|
14
34
|
email: matthew@synesis.com.au
|
15
35
|
executables: []
|
@@ -19,9 +39,10 @@ files:
|
|
19
39
|
- LICENSE
|
20
40
|
- README.md
|
21
41
|
- lib/comment_strip.rb
|
22
|
-
- lib/comment_strip/
|
42
|
+
- lib/comment_strip/language_families/c.rb
|
23
43
|
- lib/comment_strip/strip.rb
|
24
44
|
- lib/comment_strip/version.rb
|
45
|
+
- test/scratch/ex1.rb
|
25
46
|
- test/unit/tc_strip.rb
|
26
47
|
- test/unit/tc_version.rb
|
27
48
|
- test/unit/ts_all.rb
|
@@ -44,8 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
44
65
|
- !ruby/object:Gem::Version
|
45
66
|
version: '0'
|
46
67
|
requirements: []
|
47
|
-
|
48
|
-
rubygems_version: 2.7.6.2
|
68
|
+
rubygems_version: 3.1.4
|
49
69
|
signing_key:
|
50
70
|
specification_version: 4
|
51
71
|
summary: comment_strip.r
|
@@ -1,52 +0,0 @@
|
|
1
|
-
# ######################################################################## #
|
2
|
-
# File: comment_strip/comment_strip.rb
|
3
|
-
#
|
4
|
-
# Purpose: Main file for comment_strip.r library
|
5
|
-
#
|
6
|
-
# Created: 14th September 2020
|
7
|
-
# Updated: 14th September 2020
|
8
|
-
#
|
9
|
-
# Home: http://github.com/synesissoftware/comment_strip.r
|
10
|
-
#
|
11
|
-
# Copyright (c) 2020, Matthew Wilson and Synesis Information Systems
|
12
|
-
# All rights reserved.
|
13
|
-
#
|
14
|
-
# Redistribution and use in source and binary forms, with or without
|
15
|
-
# modification, are permitted provided that the following conditions are
|
16
|
-
# met:
|
17
|
-
#
|
18
|
-
# * Redistributions of source code must retain the above copyright notice,
|
19
|
-
# this list of conditions and the following disclaimer.
|
20
|
-
#
|
21
|
-
# * Redistributions in binary form must reproduce the above copyright
|
22
|
-
# notice, this list of conditions and the following disclaimer in the
|
23
|
-
# documentation and/or other materials provided with the distribution.
|
24
|
-
#
|
25
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
26
|
-
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
27
|
-
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
28
|
-
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
29
|
-
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
30
|
-
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
31
|
-
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
32
|
-
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
33
|
-
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
34
|
-
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
35
|
-
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
36
|
-
#
|
37
|
-
# ######################################################################## #
|
38
|
-
|
39
|
-
|
40
|
-
require File.join(File.dirname(__FILE__), 'strip')
|
41
|
-
require File.join(File.dirname(__FILE__), 'version')
|
42
|
-
|
43
|
-
=begin
|
44
|
-
=end
|
45
|
-
|
46
|
-
# Main module for comment_strip.r library
|
47
|
-
module CommentStrip
|
48
|
-
end # module CommentStrip
|
49
|
-
|
50
|
-
# ############################## end of file ############################# #
|
51
|
-
|
52
|
-
|