milkode 1.8.2 → 1.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/milkode/common/grenfiletest.rb +12 -2
- data/lib/milkode/version.rb +1 -1
- data/test/test_milkode_yaml.rb +5 -53
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a432906d7cb9dedf6688b795be9573b66e379c8b
|
4
|
+
data.tar.gz: 3d5100c8567be3bb2cc6fa1c3a673c8517ef15a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41970fcfa6ba574092643ae8a68a4d0660383a9e626008a4f00273becd3fff7c5b556f15a6533e84b8e196054374ccac6d74b44d07bbc36527ef49bc2b156af8
|
7
|
+
data.tar.gz: fe3cb53ed37fd66c2e62bfae30cde65ee220c1116295b2285c6b4772d052091dbfa64df3e7ebd0c027b2c96b7c979b55064e068aa39e715de582069f3d6952a7
|
@@ -5,11 +5,21 @@ module GrenFileTest
|
|
5
5
|
IGNORE_DIR = /(\A\.svn\Z)|(\A\.git\Z)|(\ACVS\Z)/
|
6
6
|
|
7
7
|
def self.ignoreDir?(fpath)
|
8
|
-
|
8
|
+
begin
|
9
|
+
IGNORE_DIR.match(File.basename(fpath))
|
10
|
+
rescue ArgumentError => e
|
11
|
+
puts "[skip dir] #{fpath}: #{e.to_s}"
|
12
|
+
true
|
13
|
+
end
|
9
14
|
end
|
10
15
|
|
11
16
|
def self.ignoreFile?(fpath)
|
12
|
-
|
17
|
+
begin
|
18
|
+
IGNORE_FILE.match(File.basename(fpath))
|
19
|
+
rescue ArgumentError => e
|
20
|
+
puts "[skip] #{fpath}: #{e.to_s}"
|
21
|
+
true
|
22
|
+
end
|
13
23
|
end
|
14
24
|
|
15
25
|
def self.binary?(fpath)
|
data/lib/milkode/version.rb
CHANGED
data/test/test_milkode_yaml.rb
CHANGED
@@ -7,7 +7,6 @@
|
|
7
7
|
|
8
8
|
require 'test_helper'
|
9
9
|
require 'milkode/cdstk/milkode_yaml.rb'
|
10
|
-
require 'milkode/common/util'
|
11
10
|
|
12
11
|
class TestMilkodeYaml < Test::Unit::TestCase
|
13
12
|
include Milkode
|
@@ -32,25 +31,9 @@ contents:
|
|
32
31
|
- directory: /path/to/dir
|
33
32
|
EOF
|
34
33
|
|
35
|
-
# YAML#dumpの出力形式が1.8と1.9で変わってしまったので、1.8の時はテストしない
|
36
|
-
|
37
34
|
def test_dump
|
38
35
|
obj = MilkodeYaml.new(SRC)
|
39
|
-
|
40
|
-
assert_equal SRC, obj.dump
|
41
|
-
elsif Milkode::Util.ruby19?
|
42
|
-
assert_equal <<EOF, obj.dump
|
43
|
-
---
|
44
|
-
version: '0.2'
|
45
|
-
contents:
|
46
|
-
- directory: /a/dir1
|
47
|
-
- directory: /path/to/dir
|
48
|
-
ignore:
|
49
|
-
- ! '*.bak'
|
50
|
-
- /rdoc
|
51
|
-
- directory: /a/b/c
|
52
|
-
EOF
|
53
|
-
end
|
36
|
+
assert_equal YAML.load(SRC), YAML.load(obj.dump)
|
54
37
|
end
|
55
38
|
|
56
39
|
def test_version
|
@@ -75,7 +58,7 @@ EOF
|
|
75
58
|
|
76
59
|
assert_equal 1, obj.contents.size
|
77
60
|
|
78
|
-
assert_equal <<EOF, obj.dump
|
61
|
+
assert_equal YAML.load(<<EOF), YAML.load(obj.dump)
|
79
62
|
---
|
80
63
|
version: '0.2'
|
81
64
|
contents:
|
@@ -89,8 +72,7 @@ EOF
|
|
89
72
|
|
90
73
|
assert_equal 2, obj.contents.size
|
91
74
|
|
92
|
-
|
93
|
-
assert_equal <<EOF, obj.dump
|
75
|
+
assert_equal YAML.load(<<EOF), YAML.load(obj.dump)
|
94
76
|
---
|
95
77
|
version: '0.2'
|
96
78
|
contents:
|
@@ -100,19 +82,6 @@ contents:
|
|
100
82
|
- '*.bak'
|
101
83
|
- /rdoc
|
102
84
|
EOF
|
103
|
-
elsif Milkode::Util.ruby19?
|
104
|
-
assert_equal <<EOF, obj.dump
|
105
|
-
---
|
106
|
-
version: '0.2'
|
107
|
-
contents:
|
108
|
-
- directory: /a/dir1
|
109
|
-
- directory: /path/to/dir
|
110
|
-
ignore:
|
111
|
-
- ! '*.bak'
|
112
|
-
- /rdoc
|
113
|
-
EOF
|
114
|
-
end
|
115
|
-
|
116
85
|
end
|
117
86
|
|
118
87
|
def test_migrate
|
@@ -122,14 +91,13 @@ EOF
|
|
122
91
|
obj = MilkodeYaml.new(V_0_1)
|
123
92
|
assert_equal true, obj.migrate
|
124
93
|
|
125
|
-
assert_equal <<EOF, obj.dump
|
94
|
+
assert_equal YAML.load(<<EOF), YAML.load(obj.dump)
|
126
95
|
---
|
127
96
|
version: '0.2'
|
128
97
|
contents:
|
129
98
|
- directory: /a/dir1
|
130
99
|
- directory: /path/to/dir
|
131
100
|
EOF
|
132
|
-
|
133
101
|
end
|
134
102
|
|
135
103
|
def test_find_name
|
@@ -145,8 +113,7 @@ EOF
|
|
145
113
|
p = Package.create(p.directory, p.ignore + ['*.a'])
|
146
114
|
obj.update(p)
|
147
115
|
|
148
|
-
|
149
|
-
assert_equal <<EOF, obj.dump
|
116
|
+
assert_equal YAML.load(<<EOF), YAML.load(obj.dump)
|
150
117
|
---
|
151
118
|
version: '0.2'
|
152
119
|
contents:
|
@@ -158,21 +125,6 @@ contents:
|
|
158
125
|
- '*.a'
|
159
126
|
- directory: /a/b/c
|
160
127
|
EOF
|
161
|
-
elsif Milkode::Util.ruby19?
|
162
|
-
assert_equal <<EOF, obj.dump
|
163
|
-
---
|
164
|
-
version: '0.2'
|
165
|
-
contents:
|
166
|
-
- directory: /a/dir1
|
167
|
-
- directory: /path/to/dir
|
168
|
-
ignore:
|
169
|
-
- ! '*.bak'
|
170
|
-
- /rdoc
|
171
|
-
- ! '*.a'
|
172
|
-
- directory: /a/b/c
|
173
|
-
EOF
|
174
|
-
end
|
175
|
-
|
176
128
|
|
177
129
|
p = Package.create("not_found")
|
178
130
|
assert_raise(RuntimeError) { obj.update(p) }
|