thermite 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -1
- data/NEWS.md +9 -0
- data/lib/thermite/config.rb +4 -5
- data/lib/thermite/github_release_binary.rb +8 -2
- data/test/lib/thermite/config_test.rb +10 -0
- data/test/lib/thermite/github_release_binary_test.rb +41 -2
- data/thermite.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5be6d2dadd7ecc7511529c5c02bc2a8b818b2c2
|
4
|
+
data.tar.gz: 93507f6f71a4135fb8a26d9188a59bfe7ae9e02f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd95587e1e64983ca41e37bf597ed87564a6f929f5fcd05d5972fd59348bc871995c02e6328c02bd619f7b7914020ea016b5987198e02dedca28598b5917caa0
|
7
|
+
data.tar.gz: 6480dbe2896f46ff2126cf650049e239caaf8171999390fa6f1480c57e21fc6e1e96a4f24b6fdbe687f5ba728aed3c7bf5c6ef0a85e9dcbe79368136ff1d6836
|
data/.travis.yml
CHANGED
data/NEWS.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## [0.9.0] - 2017-01-18
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
|
9
|
+
* The library name is consistent with how Cargo handles hyphens (#19)
|
10
|
+
* Raise error if using GitHub Releases & repository not in `Cargo.toml` (#18)
|
11
|
+
|
5
12
|
## [0.8.0] - 2016-12-05
|
6
13
|
|
7
14
|
### Added
|
@@ -95,6 +102,8 @@
|
|
95
102
|
|
96
103
|
Initial release.
|
97
104
|
|
105
|
+
[0.9.0]: https://github.com/malept/thermite/compare/v0.8.0...v0.9.0
|
106
|
+
[0.8.0]: https://github.com/malept/thermite/compare/v0.7.0...v0.8.0
|
98
107
|
[0.7.0]: https://github.com/malept/thermite/compare/v0.6.0...v0.7.0
|
99
108
|
[0.6.0]: https://github.com/malept/thermite/compare/v0.5.0...v0.6.0
|
100
109
|
[0.5.0]: https://github.com/malept/thermite/compare/v0.4.0...v0.5.0
|
data/lib/thermite/config.rb
CHANGED
@@ -99,13 +99,12 @@ module Thermite
|
|
99
99
|
#
|
100
100
|
# The name of the library compiled by Rust.
|
101
101
|
#
|
102
|
+
# Due to the way that Cargo works, all hyphens in library names are replaced with underscores.
|
103
|
+
#
|
102
104
|
def library_name
|
103
105
|
@library_name ||= begin
|
104
|
-
|
105
|
-
|
106
|
-
else
|
107
|
-
toml[:package][:name]
|
108
|
-
end
|
106
|
+
base = toml[:lib] && toml[:lib][:name] ? toml[:lib] : toml[:package]
|
107
|
+
base[:name].tr('-', '_') if base[:name]
|
109
108
|
end
|
110
109
|
end
|
111
110
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
# frozen_string_literal: true
|
3
3
|
#
|
4
|
-
# Copyright (c) 2016 Mark Lee and contributors
|
4
|
+
# Copyright (c) 2016, 2017 Mark Lee and contributors
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
7
7
|
# associated documentation files (the "Software"), to deal in the Software without restriction,
|
@@ -83,7 +83,13 @@ module Thermite
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def github_uri
|
86
|
-
@github_uri ||=
|
86
|
+
@github_uri ||= begin
|
87
|
+
unless (repository = config.toml[:package][:repository])
|
88
|
+
raise KeyError, 'No repository found in Config.toml'
|
89
|
+
end
|
90
|
+
|
91
|
+
repository
|
92
|
+
end
|
87
93
|
end
|
88
94
|
|
89
95
|
def github_download_uri(tag, version)
|
@@ -41,6 +41,16 @@ module Thermite
|
|
41
41
|
assert_equal 'barbaz', config.library_name
|
42
42
|
end
|
43
43
|
|
44
|
+
def test_library_name_from_cargo_lib_has_no_hyphens
|
45
|
+
config.stubs(:toml).returns(lib: { name: 'foo-bar' }, package: { name: 'bar-baz' })
|
46
|
+
assert_equal 'foo_bar', config.library_name
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_library_name_from_cargo_package_has_no_hyphens
|
50
|
+
config.stubs(:toml).returns(lib: {}, package: { name: 'bar-baz' })
|
51
|
+
assert_equal 'bar_baz', config.library_name
|
52
|
+
end
|
53
|
+
|
44
54
|
def test_shared_library
|
45
55
|
config.stubs(:library_name).returns('foobar')
|
46
56
|
config.stubs(:shared_ext).returns('ext')
|
@@ -1,3 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# Copyright (c) 2016, 2017 Mark Lee and contributors
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
7
|
+
# associated documentation files (the "Software"), to deal in the Software without restriction,
|
8
|
+
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
9
|
+
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all copies or
|
13
|
+
# substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
16
|
+
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
18
|
+
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
19
|
+
# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
|
1
21
|
require 'tmpdir'
|
2
22
|
require 'test_helper'
|
3
23
|
require 'thermite/github_release_binary'
|
@@ -51,9 +71,23 @@ module Thermite
|
|
51
71
|
assert mock_module.download_binary_from_github_release
|
52
72
|
end
|
53
73
|
|
54
|
-
def
|
74
|
+
def test_download_cargo_version_from_github_release_with_no_repository
|
55
75
|
mock_module(github_releases: true)
|
56
76
|
mock_module.config.stubs(:toml).returns(package: { version: '4.5.6' })
|
77
|
+
|
78
|
+
assert_raises KeyError do
|
79
|
+
mock_module.download_binary_from_github_release
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_download_cargo_version_from_github_release_with_client_error
|
84
|
+
mock_module(github_releases: true)
|
85
|
+
mock_module.config.stubs(:toml).returns(
|
86
|
+
package: {
|
87
|
+
repository: 'test/test',
|
88
|
+
version: '4.5.6'
|
89
|
+
}
|
90
|
+
)
|
57
91
|
Net::HTTP.stubs(:get_response).returns(Net::HTTPClientError.new('1.1', 403, 'Forbidden'))
|
58
92
|
|
59
93
|
assert !mock_module.download_binary_from_github_release
|
@@ -61,7 +95,12 @@ module Thermite
|
|
61
95
|
|
62
96
|
def test_download_cargo_version_from_github_release_with_server_error
|
63
97
|
mock_module(github_releases: true)
|
64
|
-
mock_module.config.stubs(:toml).returns(
|
98
|
+
mock_module.config.stubs(:toml).returns(
|
99
|
+
package: {
|
100
|
+
repository: 'test/test',
|
101
|
+
version: '4.5.6'
|
102
|
+
}
|
103
|
+
)
|
65
104
|
server_error = Net::HTTPServerError.new('1.1', 500, 'Internal Server Error')
|
66
105
|
Net::HTTP.stubs(:get_response).returns(server_error)
|
67
106
|
|
data/thermite.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thermite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|