mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Support ruby through a combination of rbenv, ruby-build, and GEM_HOME
This commit is contained in:
parent
390af24c44
commit
b381bb68b7
10 changed files with 124 additions and 24 deletions
1
testing/resources/ruby_hooks_repo/.gitignore
vendored
Normal file
1
testing/resources/ruby_hooks_repo/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
*.gem
|
||||
3
testing/resources/ruby_hooks_repo/bin/ruby_hook
Executable file
3
testing/resources/ruby_hooks_repo/bin/ruby_hook
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
puts 'Hello world from a ruby hook'
|
||||
4
testing/resources/ruby_hooks_repo/hooks.yaml
Normal file
4
testing/resources/ruby_hooks_repo/hooks.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
- id: ruby_hook
|
||||
name: Ruby Hook
|
||||
entry: ruby_hook
|
||||
language: ruby
|
||||
9
testing/resources/ruby_hooks_repo/ruby_hook.gemspec
Normal file
9
testing/resources/ruby_hooks_repo/ruby_hook.gemspec
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
Gem::Specification.new do |s|
|
||||
s.name = 'ruby_hook'
|
||||
s.version = '0.1.0'
|
||||
s.authors = ['Anthony Sottile']
|
||||
s.summary = 'A ruby hook!'
|
||||
s.description = 'A ruby hook!'
|
||||
s.files = ['bin/ruby_hook']
|
||||
s.executables = ['ruby_hook']
|
||||
end
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import jsonschema
|
||||
import os
|
||||
import os.path
|
||||
import pytest
|
||||
import shutil
|
||||
from plumbum import local
|
||||
|
||||
|
|
@ -41,3 +42,10 @@ def is_valid_according_to_schema(obj, schema):
|
|||
return True
|
||||
except jsonschema.exceptions.ValidationError:
|
||||
return False
|
||||
|
||||
|
||||
def skipif_slowtests_false(func):
|
||||
return pytest.mark.skipif(
|
||||
os.environ.get('slowtests') == 'false',
|
||||
reason='slowtests=false',
|
||||
)(func)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue