executable-hooks 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8e3c13fca83fa0756a3bf325a0c78770cf491ab9bf163c1577c28073ba1a091
|
4
|
+
data.tar.gz: 5f2fb952f2b1fe6b8c089ae1003f1b42f9ca61ff5a9b488ec438d85588b82d15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 301de90b40f74a867a1f6e674bdd0c97b468f71d02e3eb8f9339b9b65008b4e71b96a6f87bb18d8016fe2f7708a95a067f0f5d77d5c6086c25649bb5f8db6abb
|
7
|
+
data.tar.gz: 41b3f27a63ead68eba66da52d9105d7c1eddee0836044ca676d36c09a931e2943de7764dabdbe73d487026f1b34f6b574a56adea3e1445d9f2d6891ba0cf3d7f
|
data/CHANGELOG.md
CHANGED
@@ -91,7 +91,7 @@ class RegenerateBinstubsCommand < Gem::Command
|
|
91
91
|
return false if executable_paths.include?(nil) # not found
|
92
92
|
executable_shebangs =
|
93
93
|
executable_paths.map do |path|
|
94
|
-
[path, File.readlines(path).map
|
94
|
+
[path, File.readlines(path).map{|l|l.chomp}]
|
95
95
|
end
|
96
96
|
return false if executable_shebangs.detect{|path, lines| !(lines[0] =~ /^#!\//) }
|
97
97
|
puts "#{spec.name} #{spec.version}"
|
@@ -128,7 +128,7 @@ class RegenerateBinstubsCommand < Gem::Command
|
|
128
128
|
end
|
129
129
|
|
130
130
|
def existing_gem_path(full_name)
|
131
|
-
expanded_gem_paths.find{|path| File.exists?
|
131
|
+
expanded_gem_paths.find{|path| File.exists?(File.join(path, 'gems', full_name))}
|
132
132
|
end
|
133
133
|
|
134
134
|
def expanded_gem_paths
|
@@ -35,7 +35,7 @@ module ExecutableHooks
|
|
35
35
|
bindir = calculate_bindir(options)
|
36
36
|
destination = calculate_destination(bindir)
|
37
37
|
|
38
|
-
if File.exist?(wrapper_path)
|
38
|
+
if File.exist?(wrapper_path) && !same_file(wrapper_path, destination)
|
39
39
|
FileUtils.mkdir_p(bindir) unless File.exist?(bindir)
|
40
40
|
# exception based on Gem::Installer.generate_bin
|
41
41
|
raise Gem::FilePermissionError.new(bindir) unless File.writable?(bindir)
|
@@ -44,6 +44,12 @@ module ExecutableHooks
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
def same_file(file1, file2)
|
48
|
+
File.exist?(file1) && File.exist?(file2) &&
|
49
|
+
File.read(file1) == File.read(file2)
|
50
|
+
end
|
51
|
+
private :same_file
|
52
|
+
|
47
53
|
def uninstall
|
48
54
|
destination = calculate_destination(calculate_bindir(options))
|
49
55
|
FileUtils.rm_f(destination) if File.exist?(destination)
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -13,7 +13,7 @@ if
|
|
13
13
|
|
14
14
|
# Set the custom_shebang if user did not set one
|
15
15
|
Gem.pre_install do |gem_installer|
|
16
|
-
options = if gem_installer.methods.map
|
16
|
+
options = if gem_installer.methods.map{|m|m.to_s}.include?('options')
|
17
17
|
gem_installer.options
|
18
18
|
end
|
19
19
|
ExecutableHooks::Wrapper.new(options).install
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: executable-hooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Papis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tf
|
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
77
|
version: '0'
|
78
78
|
requirements: []
|
79
79
|
rubyforge_project:
|
80
|
-
rubygems_version: 2.7.
|
80
|
+
rubygems_version: 2.7.7
|
81
81
|
signing_key:
|
82
82
|
specification_version: 4
|
83
83
|
summary: Hook into rubygems executables allowing extra actions to be taken before
|