lefthook 0.7.1 → 0.7.6

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: f96b23e2d46cbd1ae2b8808a88d524c5d9994f8e4e1148ed23997495556a850a
4
- data.tar.gz: c94a26e9959f5c0c9a977d1a76267f5d194c66047dd5178ebc712385677cf86d
3
+ metadata.gz: '0899d4b5d745e86c0fbe2697a886512838d5018e2028821ad21c329c864b256f'
4
+ data.tar.gz: 72ac6e279c27afe06bed2b2754b47e1725282b0c1ea5de05362c3e55e2824208
5
5
  SHA512:
6
- metadata.gz: 66b443ccec61dfceb234677f45bcc7e5f4155b15fc869abb6d1198b3a71323079756c9c6fd86b5aff1c873c7131c0960b7d01763952d2a4c05ec7479b5de7dbe
7
- data.tar.gz: a799c0e1edd0a9f2ebb8a80d313223de640cebfbf4c6762e6b7f2d29733879412f48be27aaf98293ef91ce9fe2b57b437cfa9afe39a67770482240e70c9a87e7
6
+ metadata.gz: c610959e961116244a35395faff44b5abcbefdd40a7cb8ee53b83c19a03eed5d581303ddb77446a570dc53a8c1c9e0dfa2c981fe5f8aca5968d9b272e5ab4a1a
7
+ data.tar.gz: 44ce0488ba7e51b7e9e25f151996a1de71e48f940acfcf9607db1845758527d04b92825032c6d2b9b76e085f5dcb6a0630a9a921656f6ddde9fa741226c4b390
data/bin/lefthook CHANGED
@@ -1,20 +1,35 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- binary = case RUBY_PLATFORM
4
- when /linux/
5
- 'lefthook-linux'
6
- when /darwin/
7
- 'lefthook-mac'
8
- when /windows/
9
- 'lefthook-win.exe'
10
- else
11
- raise "Invalid platform."
12
- end
3
+ require "rubygems"
4
+
5
+ platform = Gem::Platform.new(RUBY_PLATFORM)
6
+ arch =
7
+ case platform.cpu.sub(/\Auniversal\./, '')
8
+ when /\Aarm64/ then "arm64" # Apple reports arm64e on M1 macs
9
+ when "x86_64" then "amd64"
10
+ when "x64" then "amd64" # Windows with MINGW64 reports RUBY_PLATFORM as "x64-mingw32"
11
+ when "x86" then "386"
12
+ else raise "Unknown architecture: #{platform.cpu}"
13
+ end
14
+
15
+ os =
16
+ case platform.os
17
+ when "linux" then "linux"
18
+ when "darwin" then "darwin" # MacOS
19
+ when "windows" then "windows"
20
+ when "mingw32" then "windows" # Windows with MINGW64 reports RUBY_PLATFORM as "x64-mingw32"
21
+ else raise "Unknown OS: #{platform.os}"
22
+ end
23
+
24
+ binary = "lefthook_#{os}_#{arch}/lefthook"
25
+ binary = "#{binary}.exe" if os == "windows"
13
26
 
14
27
  args = $*.map { |x| x.include?(' ') ? "'" + x + "'" : x }
15
28
  cmd = File.expand_path "#{File.dirname(__FILE__)}/../libexec/#{binary}"
16
29
 
17
- puts "#{cmd} #{args.join(' ')}"
30
+ unless File.exists?(cmd)
31
+ raise "Invalid platform. Lefthook wasn't build for #{RUBY_PLATFORM}"
32
+ end
18
33
 
19
34
  pid = spawn("#{cmd} #{args.join(' ')}")
20
35
  Process.wait(pid)
Binary file
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lefthook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - A.A.Abroskin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-02 00:00:00.000000000 Z
11
+ date: 2021-06-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description:
13
+ description:
14
14
  email:
15
15
  - arkweid@evilmartians.com
16
16
  executables:
@@ -20,10 +20,14 @@ extra_rdoc_files: []
20
20
  files:
21
21
  - bin/lefthook
22
22
  - lib/lefthook.rb
23
- - libexec/lefthook-linux
24
- - libexec/lefthook-mac
25
- - libexec/lefthook-win.exe
26
- homepage: https://github.com/Arkweid/lefthook
23
+ - libexec/lefthook_darwin_amd64/lefthook
24
+ - libexec/lefthook_darwin_arm64/lefthook
25
+ - libexec/lefthook_linux_386/lefthook
26
+ - libexec/lefthook_linux_amd64/lefthook
27
+ - libexec/lefthook_linux_arm64/lefthook
28
+ - libexec/lefthook_windows_386/lefthook.exe
29
+ - libexec/lefthook_windows_amd64/lefthook.exe
30
+ homepage: https://github.com/evilmartians/lefthook
27
31
  licenses:
28
32
  - MIT
29
33
  metadata: {}
@@ -43,8 +47,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
47
  - !ruby/object:Gem::Version
44
48
  version: '0'
45
49
  requirements: []
46
- rubygems_version: 3.0.3
47
- signing_key:
50
+ rubygems_version: 3.2.3
51
+ signing_key:
48
52
  specification_version: 4
49
53
  summary: A single dependency-free binary to manage all your git hooks that works with
50
54
  any language in any environment, and in all common team workflows.
Binary file
data/libexec/lefthook-mac DELETED
Binary file
Binary file