reapack-index 1.0beta4 → 1.0rc2

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,12 +7,12 @@ class TestSource < MiniTest::Test
7
7
  before = make_node '<version name="1.0"/>'
8
8
  after = <<-XML
9
9
  <version name="1.0">
10
- <source platform="all">http://files.cfillion.tk/hello%20world.lua</source>
10
+ <source>http://files.cfillion.tk/hello%20world.lua</source>
11
11
  </version>
12
12
  XML
13
13
 
14
- src = ReaPack::Index::Source.new 'http://files.cfillion.tk/hello world.lua'
15
- assert_equal 'http://files.cfillion.tk/hello world.lua', src.url
14
+ src = ReaPack::Index::Source.new 'http://files.cfillion.tk/./hello world.lua'
15
+ assert_equal 'http://files.cfillion.tk/./hello world.lua', src.url
16
16
 
17
17
  src.make_node before
18
18
 
@@ -38,7 +38,7 @@ class TestSource < MiniTest::Test
38
38
  before = make_node '<version name="1.0"/>'
39
39
  after = <<-XML
40
40
  <version name="1.0">
41
- <source platform="all" file="test.png">http://hello/world</source>
41
+ <source file="test.png">http://hello/world</source>
42
42
  </version>
43
43
  XML
44
44
 
@@ -54,7 +54,7 @@ class TestSource < MiniTest::Test
54
54
  end
55
55
 
56
56
  def test_platform
57
- src = ReaPack::Index::Source.new
57
+ src = ReaPack::Index::Source.new 'http://hello/world'
58
58
  assert_equal :all, src.platform
59
59
 
60
60
  src.platform = 'windows'
@@ -72,16 +72,19 @@ class TestSource < MiniTest::Test
72
72
 
73
73
  assert_equal "invalid platform 'hello'", error.message
74
74
  assert_equal :darwin, src.platform
75
- end
76
75
 
77
- def test_type
78
76
  before = make_node '<version name="1.0"/>'
79
77
  after = <<-XML
80
78
  <version name="1.0">
81
- <source platform="all" type="effect">http://hello/world</source>
79
+ <source platform="darwin">http://hello/world</source>
82
80
  </version>
83
81
  XML
84
82
 
83
+ src.make_node before
84
+ assert_equal after.chomp, before.to_s
85
+ end
86
+
87
+ def test_type
85
88
  src = ReaPack::Index::Source.new 'http://hello/world'
86
89
  assert_nil src.type
87
90
 
@@ -101,6 +104,32 @@ class TestSource < MiniTest::Test
101
104
  assert_equal "invalid type 'jsfx'", error.message
102
105
  assert_equal :effect, src.type
103
106
 
107
+ before = make_node '<version name="1.0"/>'
108
+ after = <<-XML
109
+ <version name="1.0">
110
+ <source type="effect">http://hello/world</source>
111
+ </version>
112
+ XML
113
+
114
+ src.make_node before
115
+ assert_equal after.chomp, before.to_s
116
+ end
117
+
118
+ def test_explicit_main
119
+ before = make_node '<version name="1.0"/>'
120
+ after = <<-XML
121
+ <version name="1.0">
122
+ <source main="true">http://host/</source>
123
+ </version>
124
+ XML
125
+
126
+ assert_equal true, ReaPack::Index::Source.new('http://host/', true).main?
127
+
128
+ src = ReaPack::Index::Source.new 'http://host/'
129
+ assert_equal false, src.main?
130
+ src.main = true
131
+ assert_equal true, src.main?
132
+
104
133
  src.make_node before
105
134
 
106
135
  assert_equal after.chomp, before.to_s
@@ -85,7 +85,7 @@ class TestVersion < MiniTest::Test
85
85
  before = make_node '<version name="1.0"/>'
86
86
  after = <<-XML
87
87
  <version name="1.0">
88
- <source platform="all">http://files.cfillion.tk/test.lua</source>
88
+ <source>http://files.cfillion.tk/test.lua</source>
89
89
  </version>
90
90
  XML
91
91
 
@@ -95,20 +95,19 @@ class TestVersion < MiniTest::Test
95
95
  ver.add_source src
96
96
 
97
97
  assert ver.modified?, 'version is not modified'
98
-
99
98
  assert_equal after.chomp, before.to_s
100
99
  end
101
100
 
102
101
  def test_replace_sources
103
102
  before = make_node <<-XML
104
103
  <version name="1.0">
105
- <source platform="all">http://files.cfillion.tk/old.lua</source>
104
+ <source>http://files.cfillion.tk/old.lua</source>
106
105
  </version>
107
106
  XML
108
107
 
109
108
  after = <<-XML
110
109
  <version name="1.0">
111
- <source platform="all">http://files.cfillion.tk/new.lua</source>
110
+ <source>http://files.cfillion.tk/new.lua</source>
112
111
  </version>
113
112
  XML
114
113
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reapack-index
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0beta4
4
+ version: 1.0rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - cfillion
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-21 00:00:00.000000000 Z
11
+ date: 2016-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '1.1'
131
+ version: '1.2'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '1.1'
138
+ version: '1.2'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: nokogiri
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -178,6 +178,20 @@ dependencies:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0.24'
181
+ - !ruby/object:Gem::Dependency
182
+ name: stable_sort
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '1.1'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '1.1'
181
195
  description:
182
196
  email:
183
197
  - reapack-index@cfillion.tk
@@ -204,6 +218,7 @@ files:
204
218
  - lib/reapack/index/package.rb
205
219
  - lib/reapack/index/parsers.rb
206
220
  - lib/reapack/index/provides.rb
221
+ - lib/reapack/index/scanner.rb
207
222
  - lib/reapack/index/source.rb
208
223
  - lib/reapack/index/version.rb
209
224
  - reapack-index.gemspec
@@ -214,7 +229,6 @@ files:
214
229
  - test/cli/test_metadata.rb
215
230
  - test/cli/test_scan.rb
216
231
  - test/data/index.xml
217
- - test/data/noindex.lua
218
232
  - test/helper.rb
219
233
  - test/index/test_metadata.rb
220
234
  - test/index/test_provides.rb
@@ -229,6 +243,7 @@ files:
229
243
  - test/test_package.rb
230
244
  - test/test_parsers.rb
231
245
  - test/test_provides.rb
246
+ - test/test_scanner.rb
232
247
  - test/test_source.rb
233
248
  - test/test_version.rb
234
249
  homepage: https://github.com/cfillion/reapack-index
@@ -260,7 +275,6 @@ test_files:
260
275
  - test/cli/test_metadata.rb
261
276
  - test/cli/test_scan.rb
262
277
  - test/data/index.xml
263
- - test/data/noindex.lua
264
278
  - test/helper.rb
265
279
  - test/index/test_metadata.rb
266
280
  - test/index/test_provides.rb
@@ -275,6 +289,7 @@ test_files:
275
289
  - test/test_package.rb
276
290
  - test/test_parsers.rb
277
291
  - test/test_provides.rb
292
+ - test/test_scanner.rb
278
293
  - test/test_source.rb
279
294
  - test/test_version.rb
280
295
  has_rdoc:
@@ -1 +0,0 @@
1
- -- @noindex