-
-
Notifications
You must be signed in to change notification settings - Fork 356
/
predicate_functions.sh
64 lines (58 loc) · 1.2 KB
/
predicate_functions.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# This file was generated on 2014-11-12T12:16:22-05:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.
function is_mri {
if ruby -e "exit(!defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby')"; then
# RUBY_ENGINE only returns 'ruby' on MRI.
# MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode)
return 0
else
return 1
fi;
}
function is_mri_192 {
if is_mri; then
if ruby -e "exit(RUBY_VERSION == '1.9.2')"; then
return 0
else
return 1
fi
else
return 1
fi
}
function is_mri_2plus {
if is_mri; then
if ruby -e "exit(RUBY_VERSION.to_f > 2.0)"; then
return 0
else
return 1
fi
else
return 1
fi
}
function rspec_support_compatible {
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then
return 0
else
return 1
fi
}
function documentation_enforced {
if [ -x ./bin/yard ]; then
if is_mri_2plus; then
return 0
else
return 1
fi
else
return 1
fi
}
function style_and_lint_enforced {
if [ -x ./bin/rubocop ]; then
return 0
else
return 1
fi
}