rept 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/rept +10 -0
- data/bin/rept4diff +10 -0
- data/lib/addText.rept +9 -0
- data/lib/fileinsert.rb +90 -0
- data/lib/init.yaml +4 -0
- data/lib/lib.rb +34 -0
- data/lib/rept.rb +418 -0
- data/lib/rept.yaml +66 -0
- data/lib/rept4diff.rb +225 -0
- data/lib/rept4diff.yaml +10 -0
- data/lib/yamltext.rb +19 -0
- data/rakefile +65 -0
- data/sample/c++/addclass/addclass.rept +47 -0
- data/sample/c++/addclass/makefile +6 -0
- data/sample/c++/advance/Root.cpp +24 -0
- data/sample/c++/advance/Root.h +14 -0
- data/sample/c++/advance/advance.rept +54 -0
- data/sample/c++/advance/makefile +9 -0
- data/sample/c++/dynamic_marker/data.h +30 -0
- data/sample/c++/dynamic_marker/dynamicMarker.rept +24 -0
- data/sample/ruby/command_line/command_line.rept +98 -0
- data/test/addTest.rept +22 -0
- data/test/fileinsert_crlf.txt +10 -0
- data/test/fileinsert_crlf_000.txt +11 -0
- data/test/fileinsert_crlf_001.txt +12 -0
- data/test/fileinsert_crlf_002.txt +12 -0
- data/test/fileinsert_lf.txt +10 -0
- data/test/fileinsert_lf_000.txt +11 -0
- data/test/fileinsert_lf_001.txt +12 -0
- data/test/fileinsert_lf_002.txt +12 -0
- data/test/test.rb +5 -0
- data/test/test1.diff +52 -0
- data/test/test1.rept +40 -0
- data/test/test2.diff +20 -0
- data/test/test2.rept +18 -0
- data/test/test_fileinsert.rb +48 -0
- data/test/test_rept4diff.rb +31 -0
- metadata +90 -0
data/test/test.rb
ADDED
data/test/test1.diff
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
Index: Bar.cpp
|
2
|
+
===================================================================
|
3
|
+
--- Bar.cpp (���r�W���� 0)
|
4
|
+
+++ Bar.cpp (���r�W���� 242)
|
5
|
+
@@ -0,0 +1,16 @@
|
6
|
+
+// --------------------------------------------------------------------------
|
7
|
+
+/**
|
8
|
+
+ * Bar�N���X�A����
|
9
|
+
+ */
|
10
|
+
+
|
11
|
+
+#include "Bar.h"
|
12
|
+
+
|
13
|
+
+void Bar::method1()
|
14
|
+
+{
|
15
|
+
+}
|
16
|
+
+
|
17
|
+
+int Bar::method2() const
|
18
|
+
+{
|
19
|
+
+ return 0
|
20
|
+
+}
|
21
|
+
+
|
22
|
+
Index: Bar.h
|
23
|
+
===================================================================
|
24
|
+
--- Bar.h (���r�W���� 0)
|
25
|
+
+++ Bar.h (���r�W���� 242)
|
26
|
+
@@ -0,0 +1,17 @@
|
27
|
+
+// --------------------------------------------------------------------------
|
28
|
+
+/**
|
29
|
+
+ * Bar�N���X�A�w�b�_
|
30
|
+
+ */
|
31
|
+
+
|
32
|
+
+class Bar {
|
33
|
+
+public:
|
34
|
+
+ Bar();
|
35
|
+
+ ~Bar();
|
36
|
+
+
|
37
|
+
+public:
|
38
|
+
+ void method1();
|
39
|
+
+ int method2() const;
|
40
|
+
+
|
41
|
+
+private:
|
42
|
+
+ bar_; // BAR�̒�`
|
43
|
+
+};
|
44
|
+
Index: makefile
|
45
|
+
===================================================================
|
46
|
+
--- makefile (���r�W���� 241)
|
47
|
+
+++ makefile (���r�W���� 242)
|
48
|
+
@@ -4,2 +4,3 @@
|
49
|
+
|
50
|
+
SRC_FILES = \
|
51
|
+
+ Bar.cpp \
|
52
|
+
# @insert
|
data/test/test1.rept
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
Args:
|
2
|
+
Bar
|
3
|
+
Index: ReptName1.cpp
|
4
|
+
// --------------------------------------------------------------------------
|
5
|
+
/**
|
6
|
+
* ReptName1�N���X�A����
|
7
|
+
*/
|
8
|
+
|
9
|
+
#include "ReptName1.h"
|
10
|
+
|
11
|
+
void ReptName1::method1()
|
12
|
+
{
|
13
|
+
}
|
14
|
+
|
15
|
+
int ReptName1::method2() const
|
16
|
+
{
|
17
|
+
return 0
|
18
|
+
}
|
19
|
+
|
20
|
+
Index: ReptName1.h
|
21
|
+
// --------------------------------------------------------------------------
|
22
|
+
/**
|
23
|
+
* ReptName1�N���X�A�w�b�_
|
24
|
+
*/
|
25
|
+
|
26
|
+
class ReptName1 {
|
27
|
+
public:
|
28
|
+
ReptName1();
|
29
|
+
~ReptName1();
|
30
|
+
|
31
|
+
public:
|
32
|
+
void method1();
|
33
|
+
int method2() const;
|
34
|
+
|
35
|
+
private:
|
36
|
+
reptName1_; // REPTNAME1�̒�`
|
37
|
+
};
|
38
|
+
Index: makefile
|
39
|
+
--> ReptName1.cpp \
|
40
|
+
# @insert
|
data/test/test2.diff
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Index: makefile
|
2
|
+
===================================================================
|
3
|
+
--- makefile (���r�W���� 241)
|
4
|
+
+++ makefile (���r�W���� 242)
|
5
|
+
@@ -4,0 +4,1 @@
|
6
|
+
+ Bar.cpp \
|
7
|
+
Foo.cpp \
|
8
|
+
Foo.cpp \
|
9
|
+
+ Bar.cpp \
|
10
|
+
Foo.cpp \
|
11
|
+
Foo.cpp \
|
12
|
+
+ Bar.cpp \
|
13
|
+
- Bewasa.cpp \
|
14
|
+
+ Bar.cpp \
|
15
|
+
+ Bar.cpp \
|
16
|
+
+ Bar.cpp \
|
17
|
+
+ Bar.cpp \
|
18
|
+
Foo.cpp \
|
19
|
+
+ Bar.cpp \
|
20
|
+
+ Bar.cpp \
|
data/test/test2.rept
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Args:
|
2
|
+
Bar
|
3
|
+
Index: makefile
|
4
|
+
--> ReptName1.cpp \
|
5
|
+
Foo.cpp \
|
6
|
+
|
7
|
+
--> ReptName1.cpp \
|
8
|
+
Foo.cpp \
|
9
|
+
|
10
|
+
--> ReptName1.cpp \
|
11
|
+
--> ReptName1.cpp \
|
12
|
+
--> ReptName1.cpp \
|
13
|
+
--> ReptName1.cpp \
|
14
|
+
--> ReptName1.cpp \
|
15
|
+
Foo.cpp \
|
16
|
+
|
17
|
+
--> ReptName1.cpp \
|
18
|
+
--> ReptName1.cpp \
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'fileinsert'
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
class TC_fileinsert < Test::Unit::TestCase
|
6
|
+
def setup
|
7
|
+
Dir.chdir('test')
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
Dir.chdir('..')
|
12
|
+
end
|
13
|
+
|
14
|
+
def fileSameTest(src, dst)
|
15
|
+
FileUtils.cp(src, 'fileinsert_test.txt')
|
16
|
+
yield
|
17
|
+
assert(FileUtils.cmp('fileinsert_test.txt', dst))
|
18
|
+
File.unlink('fileinsert_test.txt')
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_fileinsert
|
22
|
+
fileSameTest('fileinsert_lf.txt', 'fileinsert_lf_000.txt') do
|
23
|
+
file_insert('fileinsert_test.txt', 1, "******\n")
|
24
|
+
end
|
25
|
+
|
26
|
+
fileSameTest('fileinsert_lf.txt', 'fileinsert_lf_001.txt') do
|
27
|
+
file_insert('fileinsert_test.txt', 1, "******\n******\n")
|
28
|
+
end
|
29
|
+
|
30
|
+
fileSameTest('fileinsert_lf.txt', 'fileinsert_lf_002.txt') do
|
31
|
+
file_insert('fileinsert_test.txt', 1, "******\r\n******\r\n")
|
32
|
+
end
|
33
|
+
|
34
|
+
fileSameTest('fileinsert_crlf.txt', 'fileinsert_crlf_000.txt') do
|
35
|
+
file_insert('fileinsert_test.txt', 1, "******\n")
|
36
|
+
end
|
37
|
+
|
38
|
+
fileSameTest('fileinsert_crlf.txt', 'fileinsert_crlf_001.txt') do
|
39
|
+
file_insert('fileinsert_test.txt', 1, "******\n******\n")
|
40
|
+
end
|
41
|
+
|
42
|
+
fileSameTest('fileinsert_crlf.txt', 'fileinsert_crlf_002.txt') do
|
43
|
+
file_insert('fileinsert_test.txt', 1, "******\r\n******\r\n")
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'rept4diff'
|
3
|
+
|
4
|
+
class TC_Rept4Diff < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
Dir.chdir('test')
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
Dir.chdir('..')
|
11
|
+
end
|
12
|
+
|
13
|
+
def readRept(fname)
|
14
|
+
data = []
|
15
|
+
open(fname) {|f| f.each {|l| data << l} }
|
16
|
+
data
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_test1
|
20
|
+
parser = Parser.new('test1.diff', ['Bar'])
|
21
|
+
parser.parse
|
22
|
+
assert_equal(parser.result, readRept('test1.rept'))
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_test2
|
26
|
+
parser = Parser.new('test2.diff', ['Bar'])
|
27
|
+
parser.parse
|
28
|
+
assert_equal(parser.result, readRept('test2.rept'))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rept
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- ongaeshi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-05-10 00:00:00 +09:00
|
13
|
+
default_executable: rept
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: rept description
|
17
|
+
email: ""
|
18
|
+
executables:
|
19
|
+
- rept
|
20
|
+
- rept4diff
|
21
|
+
extensions: []
|
22
|
+
|
23
|
+
extra_rdoc_files: []
|
24
|
+
|
25
|
+
files:
|
26
|
+
- rakefile
|
27
|
+
- bin/rept
|
28
|
+
- bin/rept4diff
|
29
|
+
- lib/addText.rept
|
30
|
+
- lib/fileinsert.rb
|
31
|
+
- lib/init.yaml
|
32
|
+
- lib/lib.rb
|
33
|
+
- lib/rept.rb
|
34
|
+
- lib/rept.yaml
|
35
|
+
- lib/rept4diff.rb
|
36
|
+
- lib/rept4diff.yaml
|
37
|
+
- lib/yamltext.rb
|
38
|
+
- sample/c++/addclass/addclass.rept
|
39
|
+
- sample/c++/addclass/makefile
|
40
|
+
- sample/c++/advance/advance.rept
|
41
|
+
- sample/c++/advance/makefile
|
42
|
+
- sample/c++/advance/Root.cpp
|
43
|
+
- sample/c++/advance/Root.h
|
44
|
+
- sample/c++/dynamic_marker/data.h
|
45
|
+
- sample/c++/dynamic_marker/dynamicMarker.rept
|
46
|
+
- sample/ruby/command_line/command_line.rept
|
47
|
+
- test/addTest.rept
|
48
|
+
- test/fileinsert_crlf.txt
|
49
|
+
- test/fileinsert_crlf_000.txt
|
50
|
+
- test/fileinsert_crlf_001.txt
|
51
|
+
- test/fileinsert_crlf_002.txt
|
52
|
+
- test/fileinsert_lf.txt
|
53
|
+
- test/fileinsert_lf_000.txt
|
54
|
+
- test/fileinsert_lf_001.txt
|
55
|
+
- test/fileinsert_lf_002.txt
|
56
|
+
- test/test.rb
|
57
|
+
- test/test1.diff
|
58
|
+
- test/test1.rept
|
59
|
+
- test/test2.diff
|
60
|
+
- test/test2.rept
|
61
|
+
- test/test_fileinsert.rb
|
62
|
+
- test/test_rept4diff.rb
|
63
|
+
has_rdoc: true
|
64
|
+
homepage: http://rubyforge.org/projects/rept/
|
65
|
+
post_install_message:
|
66
|
+
rdoc_options: []
|
67
|
+
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: "0"
|
75
|
+
version:
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: "0"
|
81
|
+
version:
|
82
|
+
requirements: []
|
83
|
+
|
84
|
+
rubyforge_project: rept
|
85
|
+
rubygems_version: 1.2.0
|
86
|
+
signing_key:
|
87
|
+
specification_version: 2
|
88
|
+
summary: rept summary
|
89
|
+
test_files: []
|
90
|
+
|