licensed 2.14.0 → 2.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -2
- data/lib/licensed/shell.rb +21 -4
- data/lib/licensed/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e51a39bfeaf0f48ca7a05b08047b8a64236b276097a0ee7f301dc1ca4e1ad1f
|
4
|
+
data.tar.gz: ee8de1cdebb66fa213f25b4b4bcd38957a4746b86bed6375a057cdd372603cc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 583a36dbc2a4e2cb6c9ae76a8976f01e61c2ec3f855d36aac3ce68f303170c7ddd2f0a5ed1e7acc5e67ae26eedd05ee05c1b884cf73a5a6836b2e81879b12078
|
7
|
+
data.tar.gz: ca025576af3f1a385f6517d2534a39e83ae2bc6a575933559f0457cab3afd28037ab16aef79e068958c225bdacec293b21afa3e4d2f5238bde473a3a3a924daa
|
data/CHANGELOG.md
CHANGED
@@ -6,10 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## 2.14.1
|
10
|
+
2020-10-09
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
- Shell command output is encoded to UTF8 (https://github.com/github/licensed/pull/319)
|
14
|
+
|
9
15
|
## 2.14.0
|
10
16
|
2020-10-04
|
11
17
|
|
12
|
-
###
|
18
|
+
### Added
|
13
19
|
- `reviewed` dependencies can use glob pattern matching (https://github.com/github/licensed/pull/313)
|
14
20
|
|
15
21
|
### Fixed
|
@@ -360,4 +366,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
360
366
|
|
361
367
|
Initial release :tada:
|
362
368
|
|
363
|
-
[Unreleased]: https://github.com/github/licensed/compare/2.14.
|
369
|
+
[Unreleased]: https://github.com/github/licensed/compare/2.14.1...HEAD
|
data/lib/licensed/shell.rb
CHANGED
@@ -9,11 +9,12 @@ module Licensed
|
|
9
9
|
def self.execute(cmd, *args, allow_failure: false, env: {})
|
10
10
|
stdout, stderr, status = Open3.capture3(env, cmd, *args)
|
11
11
|
|
12
|
-
if status.success?
|
13
|
-
|
14
|
-
else
|
15
|
-
raise Error.new([cmd, *args], status.exitstatus, stderr)
|
12
|
+
if !status.success? && !allow_failure
|
13
|
+
raise Error.new([cmd, *args], status.exitstatus, encode_content(stderr))
|
16
14
|
end
|
15
|
+
|
16
|
+
# ensure that returned data is properly encoded
|
17
|
+
encode_content(stdout.strip)
|
17
18
|
end
|
18
19
|
|
19
20
|
# Executes a command and returns a boolean value indicating if the command
|
@@ -55,5 +56,21 @@ module Licensed
|
|
55
56
|
end.join(" ")
|
56
57
|
end
|
57
58
|
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
ENCODING = Encoding::UTF_8
|
63
|
+
ENCODING_OPTIONS = {
|
64
|
+
invalid: :replace,
|
65
|
+
undef: :replace,
|
66
|
+
replace: "",
|
67
|
+
univeral_newline: true
|
68
|
+
}.freeze
|
69
|
+
|
70
|
+
# Ensure that content that is returned from shell commands is in a usable
|
71
|
+
# encoding for the rest of the application
|
72
|
+
def self.encode_content(content)
|
73
|
+
content.encode(ENCODING, **ENCODING_OPTIONS)
|
74
|
+
end
|
58
75
|
end
|
59
76
|
end
|
data/lib/licensed/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: licensed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.14.
|
4
|
+
version: 2.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: licensee
|