Sha256: e1a4d840092662a121940751882fbf329ddee119527e8fb0766cd5c316ed8f1b

Contents?: true

Size: 662 Bytes

Versions: 7

Compression:

Stored size: 662 Bytes

Contents

#!/usr/bin/env ratch

main :syntax do
  scripts = "lib/**/*.rb"
  libpath = [ 'lib/methods', 'lib/core', 'lib/more' ].join(':')

  checklist = []
  cnt = 0
  scripts = multiglob(*scripts) #- multiglob_r(ignore)
  scripts.each do |s|
    next unless File.file?(s)
    #if not system "ruby -c -Ibin:lib:test #{s} &> /dev/null" then
    r = system "ruby -c -I#{libpath} #{s} > /dev/null"
    if r
      puts "#{s} [PASS]" #if verbose?
    else
      puts "Syntax Error: #{s}"
      checklist << :syntax
      cnt += 1
    end
  end

  if cnt == 0
    puts "Syntax checks out."
  else
    puts "#{cnt} Syntax Failures:\n  "
    puts checklist.join("\n  ")
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
facets-2.0.3 task/syntax
facets-2.0.4 task/syntax
facets-2.0.5 task/syntax
ratch-0.2.3 lib/ratch/toolset/ruby/syntax
ratch-0.4.1 lib/ratch/toolset/ruby/test/syntax
ratch-0.3.0 lib/ratch/toolset/ruby/test/syntax
ratch-0.4.0 lib/ratch/toolset/ruby/test/syntax