stdouttoggler 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name="stdouttoggler"
3
- s.version="1.0.0"
3
+ s.version="1.0.1"
4
4
  s.platform=Gem::Platform::RUBY
5
5
  s.date="2012-09-14"
6
6
  s.summary="Comments and uncomments output lines in code"
@@ -239,6 +239,61 @@ EOS
239
239
 
240
240
  end #end ruby test
241
241
 
242
-
243
-
244
- end
242
+
243
+ #####################################
244
+ def test_perl
245
+
246
+ @perl_file_uncommented = <<EOS
247
+ #!/bin/perl
248
+ #do not change
249
+
250
+ print "starting";
251
+
252
+ print "slice\n";
253
+
254
+ open(F,"<","JavaFile.java") or die "file: $!";
255
+ while(<F>) {
256
+ print "line";
257
+ }
258
+ close F;
259
+
260
+ print "\n\n";
261
+ EOS
262
+
263
+ @perl_file_commented = <<EOS
264
+ #!/bin/perl
265
+ #do not change
266
+
267
+ #print "starting";
268
+
269
+ #print "slice\n";
270
+
271
+ open(F,"<","JavaFile.java") or die "file: $!";
272
+ while(<F>) {
273
+ #print "line";
274
+ }
275
+ close F;
276
+
277
+ #print "\n\n";
278
+ EOS
279
+
280
+ #this is the perl type map
281
+ StdOutToggler::StdOutRegex::Producer.create_methods_for_producing_stdout_regex_strings(@stdout_type_maps[4])
282
+
283
+ #comment
284
+ perl_comment_regex_holder = StdOutToggler::StdOutRegex::Producer.new().perl_comment_regex
285
+ input = StringIO.new(@perl_file_uncommented)
286
+ output = StringIO.new
287
+ StdOutToggler::FileWriter.modify_file(input, output, perl_comment_regex_holder)
288
+ assert_equal(@perl_file_commented, output.string)
289
+
290
+ #uncomment
291
+ perl_uncomment_regex_holder = StdOutToggler::StdOutRegex::Producer.new().perl_uncomment_regex
292
+ input = StringIO.new(@perl_file_commented)
293
+ output = StringIO.new
294
+ StdOutToggler::FileWriter.modify_file(input, output, perl_uncomment_regex_holder)
295
+ assert_equal(@perl_file_uncommented, output.string)
296
+
297
+ end #end perl test
298
+
299
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stdouttoggler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: