reapack-index 1.2 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 20bc69fbd364488dbc889bf818645e9e5347014b
4
- data.tar.gz: fa612442936464336c08dbf9713347b88afa9cb6
2
+ SHA256:
3
+ metadata.gz: 3f9b62d7bee0df16d8de2903900ac49696ea2a3ee34ff698ac4160cde78588dc
4
+ data.tar.gz: 4e2285d7499f6f84b2ecf04fea0853e3e739c4e9d6e4cc8ce11226828122c64e
5
5
  SHA512:
6
- metadata.gz: 75cd84c336c8603e231c6b5ddd2ad3227fa9436bb5d6711a5372ad5bf46c368c277219983743a27f605d808324fb6b4e7289b9274b0a40fad20d037406a9747c
7
- data.tar.gz: 50a735620a082d2f4573d1a057516ca4802de997403b07e451f1837be69dcf0b4d55f2c7627e9d02b60677c12b0a1e3d820c8e2d888ed21e67133e0b892a464e
6
+ metadata.gz: ef43516204243d62b88d8f358c5fabc30a4bc66151fe167de54490ab39e0ac37373d7835226d436e6605bfbb6de6672a49614d6220bd5908a0a6fdbb4341caa7
7
+ data.tar.gz: aa8170e5582c87c1705bb42772014b75c4bc930e72f6d8519c996d2415ba0fc33740882c5f3e0b5245203ee428c38eb1538705a5cde296874dc3cc9f2cf0a887
@@ -1,8 +1,11 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.4.0
3
+ - 2.3
4
+ - 2.4
5
+ - 2.5
6
+ - 2.6
4
7
  before_install:
5
8
  - gem update bundler
6
- - wget https://github.com/jgm/pandoc/releases/download/1.19.1/pandoc-1.19.1-1-amd64.deb -O pandoc.deb
9
+ - wget https://github.com/jgm/pandoc/releases/download/2.7.2/pandoc-2.7.2-1-amd64.deb -O pandoc.deb
7
10
  - sudo dpkg -i pandoc.deb
8
11
  cache: bundler
@@ -14,6 +14,7 @@ require 'rugged'
14
14
  require 'shellwords'
15
15
  require 'stable_sort'
16
16
  require 'time'
17
+ require 'uri'
17
18
 
18
19
  require 'reapack/index/cdetector'
19
20
  require 'reapack/index/cli'
@@ -1,6 +1,5 @@
1
1
  module ReaPack
2
2
  class Index
3
- # bump in setup/reapack-index.nsi too
4
- VERSION = '1.2'
3
+ VERSION = '1.2.2'
5
4
  end
6
5
  end
@@ -71,7 +71,7 @@ class ReaPack::Index
71
71
  return unless uri.path =~ /\A\/?(?<user>[^\/]+)\/(?<repo>[^\/]+)(\.git|\/)?\Z/
72
72
 
73
73
  tpl = uri.to_web_uri
74
- tpl.path.chomp! '/'
74
+ tpl.path = tpl.path.chomp '/'
75
75
  tpl.path += '/raw/$commit/$path'
76
76
 
77
77
  tpl.to_s
@@ -109,7 +109,7 @@ class ReaPack::Index
109
109
  end
110
110
 
111
111
  template
112
- .gsub('$path', path)
112
+ .gsub('$path', URI::encode(path))
113
113
  .gsub('$commit', @index.commit || 'master')
114
114
  .gsub('$version', @ver.name)
115
115
  .gsub('$package', @pkg.path)
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.required_ruby_version = '>= 2.3'
22
22
 
23
- spec.add_development_dependency 'bundler', '~> 1.10'
23
+ spec.add_development_dependency 'bundler', '~> 2.0'
24
24
  spec.add_development_dependency 'coveralls', '~> 0.8'
25
25
  spec.add_development_dependency 'minitest', '~> 5.8'
26
26
  spec.add_development_dependency 'rake', '~> 12.0'
@@ -54,6 +54,36 @@ class TestIndex::Scan < MiniTest::Test
54
54
  assert_equal expected, File.read(index.path)
55
55
  end
56
56
 
57
+ def test_escape_path_uri
58
+ index = ReaPack::Index.new @dummy_path
59
+ index.files = ['Category/Hello World #1.lua']
60
+ index.url_template = 'http://host/$path'
61
+
62
+ index.scan index.files.first, '@version 1.0'
63
+
64
+ assert_equal true, index.modified?
65
+ assert_equal '1 new category, 1 new package, 1 new version', index.changelog
66
+
67
+ index.write!
68
+
69
+ assert_equal false, index.modified?
70
+
71
+ expected = <<-XML
72
+ <?xml version="1.0" encoding="utf-8"?>
73
+ <index version="1">
74
+ <category name="Category">
75
+ <reapack name="Hello World #1.lua" type="script">
76
+ <version name="1.0">
77
+ <source main="main">http://host/Category/Hello%20World%20%231.lua</source>
78
+ </version>
79
+ </reapack>
80
+ </category>
81
+ </index>
82
+ XML
83
+
84
+ assert_equal expected, File.read(index.path)
85
+ end
86
+
57
87
  def test_package_in_root
58
88
  index = ReaPack::Index.new @dummy_path
59
89
  index.files = ['script.lua', 'Hello/World']
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.2'
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - cfillion
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-22 00:00:00.000000000 Z
11
+ date: 2019-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.10'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.10'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: coveralls
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -264,8 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
264
264
  - !ruby/object:Gem::Version
265
265
  version: '0'
266
266
  requirements: []
267
- rubyforge_project:
268
- rubygems_version: 2.6.13
267
+ rubygems_version: 3.0.2
269
268
  signing_key:
270
269
  specification_version: 4
271
270
  summary: Package indexer for git-based ReaPack repositories