reapack-index 1.1rc3 → 1.1rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reapack/index/gem_version.rb +1 -1
- data/lib/reapack/index/scanner.rb +7 -1
- data/lib/reapack/index/source.rb +7 -2
- data/lib/reapack/index.rb +4 -1
- data/reapack-index.gemspec +1 -1
- data/setup/reapack-index.nsi +2 -2
- data/test/index/test_metadata.rb +41 -4
- data/test/index/test_provides.rb +19 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 055dade2288572ca9c5ba6b088830910e4c02ba4
|
4
|
+
data.tar.gz: c0a47135f969d857dd62758411e24c3c55ee11b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b36c261cb78483239b8c7130f60ed1140e82b439ed3d7b63b37a70f829575cab3c4811384bfac35f6420e9102f27b620aba1baf512ad396d9c90675c59d11434
|
7
|
+
data.tar.gz: 76444bacda5d294b627caf9f53167675dd6980f1edb5ff4771f73db4c1438d51ed7ccaa906b9d90ce96ef09af2746ac7bd553678aada64190c9b375165944c91
|
@@ -157,7 +157,13 @@ class ReaPack::Index
|
|
157
157
|
line.url_template ? expanded : file
|
158
158
|
|
159
159
|
if file == @pkg.path
|
160
|
-
|
160
|
+
if metapackage?
|
161
|
+
# the current file is still added as a source even if @metapackage
|
162
|
+
# is enabled but won't be added to the Action List unless specified
|
163
|
+
elsif line.main.nil?
|
164
|
+
# not a metapackage? then the current file is registered by default
|
165
|
+
src.detect_sections @pkg
|
166
|
+
end
|
161
167
|
else
|
162
168
|
if line.url_template
|
163
169
|
src.file = file
|
data/lib/reapack/index/source.rb
CHANGED
@@ -55,8 +55,13 @@ class ReaPack::Index
|
|
55
55
|
@sections = []
|
56
56
|
|
57
57
|
if (@type || pkg.type) == :script
|
58
|
-
|
59
|
-
|
58
|
+
@sections << \
|
59
|
+
case pkg.topdir.downcase
|
60
|
+
when 'midi editor'
|
61
|
+
:midi_editor
|
62
|
+
else
|
63
|
+
:main
|
64
|
+
end
|
60
65
|
end
|
61
66
|
|
62
67
|
@sections.freeze # force going through sections=() for validation
|
data/lib/reapack/index.rb
CHANGED
@@ -41,6 +41,9 @@ class ReaPack::Index
|
|
41
41
|
|
42
42
|
FS_ROOT = File.expand_path('/').freeze
|
43
43
|
|
44
|
+
NAME_REGEX = /\A[^*\\:<>?\/|"[:cntrl:]]{4,24}\Z/.freeze
|
45
|
+
NAME_INVALID = /\A(:?[\.\x20].+|.+[\.\x20]|CLOCK\$|COM\d|LPT\d)\Z/i.freeze
|
46
|
+
|
44
47
|
attr_reader :path, :url_template, :cdetector
|
45
48
|
attr_accessor :amend, :commit, :files, :time, :strict
|
46
49
|
attr_accessor :auto_bump_commit
|
@@ -223,7 +226,7 @@ class ReaPack::Index
|
|
223
226
|
end
|
224
227
|
|
225
228
|
def name=(newName)
|
226
|
-
if
|
229
|
+
if !NAME_REGEX.match(newName) || NAME_INVALID.match(newName)
|
227
230
|
raise Error, "invalid name '#{newName}'"
|
228
231
|
end
|
229
232
|
|
data/reapack-index.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_runtime_dependency 'addressable', '~> 2.4'
|
30
30
|
spec.add_runtime_dependency 'colorize', '~> 0.7'
|
31
31
|
spec.add_runtime_dependency 'gitable', '~> 0.3'
|
32
|
-
spec.add_runtime_dependency 'metaheader', '~> 1.
|
32
|
+
spec.add_runtime_dependency 'metaheader', '~> 1.3'
|
33
33
|
spec.add_runtime_dependency 'nokogiri', '~> 1.6.8'
|
34
34
|
spec.add_runtime_dependency 'pandoc-ruby', '~> 2.0'
|
35
35
|
spec.add_runtime_dependency 'rugged', '~> 0.24'
|
data/setup/reapack-index.nsi
CHANGED
@@ -4,7 +4,7 @@ Unicode true
|
|
4
4
|
!include Sections.nsh
|
5
5
|
!include StrRep.nsh
|
6
6
|
|
7
|
-
!define VERSION "1.
|
7
|
+
!define VERSION "1.1rc4"
|
8
8
|
!define NAME "reapack-index ${VERSION}"
|
9
9
|
!define LONG_VERSION "0.1.0.0"
|
10
10
|
|
@@ -13,7 +13,7 @@ Unicode true
|
|
13
13
|
!define RUBYINSTALLER_URL \
|
14
14
|
"http://dl.bintray.com/oneclick/rubyinstaller/${RUBYINSTALLER_FILE}"
|
15
15
|
|
16
|
-
!define PANDOC_VERSION "1.
|
16
|
+
!define PANDOC_VERSION "1.18"
|
17
17
|
!define PANDOC_FILE "pandoc-${PANDOC_VERSION}-windows.msi"
|
18
18
|
!define PANDOC_URL \
|
19
19
|
"https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/${PANDOC_FILE}"
|
data/test/index/test_metadata.rb
CHANGED
@@ -95,10 +95,7 @@ class TestIndex::Metadata < MiniTest::Test
|
|
95
95
|
index.name = 'Hello World'
|
96
96
|
assert_equal '1 modified metadata, empty index', index.changelog
|
97
97
|
|
98
|
-
|
99
|
-
assert_raises ReaPack::Index::Error do index.name = 'hello/world'; end
|
100
|
-
assert_equal "invalid name '.'", error.message
|
101
|
-
|
98
|
+
assert_raises ReaPack::Index::Error do index.name = '.'; end
|
102
99
|
assert_equal 'Hello World', index.name
|
103
100
|
|
104
101
|
expected = <<-XML
|
@@ -109,4 +106,44 @@ class TestIndex::Metadata < MiniTest::Test
|
|
109
106
|
index.write!
|
110
107
|
assert_equal expected, File.read(index.path)
|
111
108
|
end
|
109
|
+
|
110
|
+
def test_name_valid
|
111
|
+
index = ReaPack::Index.new @dummy_path
|
112
|
+
|
113
|
+
[
|
114
|
+
'1234',
|
115
|
+
'hello world',
|
116
|
+
'hello_world',
|
117
|
+
'Новая папка',
|
118
|
+
'Hello ~World~',
|
119
|
+
'Repository #1',
|
120
|
+
].each {|name| index.name = name }
|
121
|
+
end
|
122
|
+
|
123
|
+
def test_name_invalid
|
124
|
+
index = ReaPack::Index.new @dummy_path
|
125
|
+
|
126
|
+
[
|
127
|
+
'',
|
128
|
+
'ab/cd',
|
129
|
+
'ab\\cd',
|
130
|
+
'..',
|
131
|
+
'.',
|
132
|
+
'....',
|
133
|
+
'.hidden',
|
134
|
+
'trailing.',
|
135
|
+
' leading',
|
136
|
+
'trailing ',
|
137
|
+
"ctrl\0chars",
|
138
|
+
|
139
|
+
# Windows device names...
|
140
|
+
"CLOCK$",
|
141
|
+
"COM1",
|
142
|
+
"LPT2",
|
143
|
+
"lpt1",
|
144
|
+
].each {|name|
|
145
|
+
error = assert_raises(ReaPack::Index::Error, name) do index.name = name end
|
146
|
+
assert_equal "invalid name '#{name}'", error.message
|
147
|
+
}
|
148
|
+
end
|
112
149
|
end
|
data/test/index/test_provides.rb
CHANGED
@@ -332,11 +332,7 @@ class TestIndex::Provides < MiniTest::Test
|
|
332
332
|
def test_main_self
|
333
333
|
index = ReaPack::Index.new @dummy_path
|
334
334
|
index.url_template = 'http://host/$path'
|
335
|
-
index.files = [
|
336
|
-
'Category/script.lua',
|
337
|
-
'Category/a.dat',
|
338
|
-
'Category/b.dat',
|
339
|
-
]
|
335
|
+
index.files = ['Category/script.lua']
|
340
336
|
|
341
337
|
index.scan index.files.first, <<-IN
|
342
338
|
@version 1.0
|
@@ -346,4 +342,22 @@ class TestIndex::Provides < MiniTest::Test
|
|
346
342
|
index.write!
|
347
343
|
assert_match 'main="main"', File.read(index.path)
|
348
344
|
end
|
345
|
+
|
346
|
+
def test_metapackage_override
|
347
|
+
index = ReaPack::Index.new @dummy_path
|
348
|
+
index.url_template = 'http://host/$path'
|
349
|
+
index.files = ['Category/script.lua']
|
350
|
+
|
351
|
+
index.scan index.files.first, <<-IN
|
352
|
+
@metapackage
|
353
|
+
@version 1.0
|
354
|
+
@provides .
|
355
|
+
IN
|
356
|
+
|
357
|
+
index.write!
|
358
|
+
contents = File.read index.path
|
359
|
+
|
360
|
+
refute_match 'main="main"', contents
|
361
|
+
assert_match '<source>http://host/Category/script.lua</source>', contents
|
362
|
+
end
|
349
363
|
end
|
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.
|
4
|
+
version: 1.1rc4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cfillion
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-29 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.
|
131
|
+
version: '1.3'
|
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.
|
138
|
+
version: '1.3'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: nokogiri
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|