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: d8af7d04b6fa2b7c8bfb0885cc012c386128e57fe295175c090e2d6bf8c7185f
4
- data.tar.gz: f1762977f60bc39d2d036c10b10290d6be62eeba76eac44666dd4ff0c770220b
3
+ metadata.gz: a8e3c13fca83fa0756a3bf325a0c78770cf491ab9bf163c1577c28073ba1a091
4
+ data.tar.gz: 5f2fb952f2b1fe6b8c089ae1003f1b42f9ca61ff5a9b488ec438d85588b82d15
5
5
  SHA512:
6
- metadata.gz: 72625ddbc7242affafdf245404a0f0fd5fc426775f23d7556b0c1898a970c70f7e41c170dd7b387fb6b2423aace86b0461659fc8ecb3c8aee3ae7f907c127cd0
7
- data.tar.gz: e946e2d8f38cb8a91ca477c7884c0279f217c0a742c6af32b67e43d880bec04c502f957343776f8b008a625656197980fc28157920577d425d26e513371eeccb
6
+ metadata.gz: 301de90b40f74a867a1f6e674bdd0c97b468f71d02e3eb8f9339b9b65008b4e71b96a6f87bb18d8016fe2f7708a95a067f0f5d77d5c6086c25649bb5f8db6abb
7
+ data.tar.gz: 41b3f27a63ead68eba66da52d9105d7c1eddee0836044ca676d36c09a931e2943de7764dabdbe73d487026f1b34f6b574a56adea3e1445d9f2d6891ba0cf3d7f
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.6.0
4
+ date: 2018-10-25
5
+
6
+ - Restore support for ruby-1.8.6, fixes #34
7
+ - Do not force overwrite wrapper, fixes #33
8
+
3
9
  ## 1.5.0
4
10
  date: 2018-06-25
5
11
 
@@ -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(&:chomp)]
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? File.join path, 'gems', full_name}
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
@@ -1,3 +1,3 @@
1
1
  module ExecutableHooks
2
- VERSION = "1.5.0"
2
+ VERSION = "1.6.0"
3
3
  end
@@ -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)
@@ -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(&:to_s).include?('options')
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.5.0
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-06-24 00:00:00.000000000 Z
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.6
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