breakout_parser 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/ext/breakout_parser/extconf.rb +21 -1
  2. metadata +2 -2
@@ -14,7 +14,27 @@ if RUBY_PLATFORM['mswin32']
14
14
  end
15
15
  create_makefile(([extension_name]*2).join('/'))
16
16
 
17
- if !windows && File.exist?('Makefile') && find_executable('bison') && find_executable('lex')
17
+ def check_version name, need_ver
18
+ exe = find_executable name
19
+ return false unless exe
20
+ exe_ver = `#{exe} -V`[/\d+\.\d+\.\d+/]
21
+ unless exe_ver
22
+ puts "[?] cannot determine #{name} version"
23
+ return false
24
+ end
25
+ exe_ver = exe_ver.split('.').map(&:to_i)
26
+ need_ver = need_ver.split('.').map(&:to_i)
27
+ r = (exe_ver[0] > need_ver[0]) || (
28
+ (exe_ver[0] == need_ver[0]) && (
29
+ (exe_ver[1] > need_ver[1]) ||
30
+ (exe_ver[1] == need_ver[1] && exe_ver[2] >= need_ver[2])
31
+ )
32
+ )
33
+ puts "[-] wanted #{name} >= #{need_ver.join('.')}, but got only #{exe_ver.join('.')}" unless r
34
+ r
35
+ end
36
+
37
+ if !windows && File.exist?('Makefile') && check_version('bison','2.4.0') && check_version('lex','2.5.30')
18
38
  File.open('Makefile','a') do |f|
19
39
  f.puts
20
40
  f.puts "parser.tab.c parser.tab.h: parser.y"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breakout_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey "Zed" Zaikin
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-13 00:00:00 +05:00
12
+ date: 2010-03-24 00:00:00 +05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency