mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 12:28:47 +00:00
Merge pull request #1958 from floscher/fix-convert-script
Fixes script/convert-grammars: require thread-gem and solve problem with visibility of variable p
This commit is contained in:
@@ -5,6 +5,7 @@ require 'net/http'
|
|||||||
require 'optparse'
|
require 'optparse'
|
||||||
require 'plist'
|
require 'plist'
|
||||||
require 'set'
|
require 'set'
|
||||||
|
require 'thread'
|
||||||
require 'tmpdir'
|
require 'tmpdir'
|
||||||
require 'uri'
|
require 'uri'
|
||||||
require 'yaml'
|
require 'yaml'
|
||||||
@@ -195,7 +196,7 @@ def load_grammars(tmp_dir, source, all_scopes)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def install_grammars(grammars)
|
def install_grammars(grammars, path)
|
||||||
installed = []
|
installed = []
|
||||||
|
|
||||||
grammars.each do |grammar|
|
grammars.each do |grammar|
|
||||||
@@ -204,7 +205,7 @@ def install_grammars(grammars)
|
|||||||
installed << scope
|
installed << scope
|
||||||
end
|
end
|
||||||
|
|
||||||
$stderr.puts("OK #{p.url} (#{installed.join(', ')})")
|
$stderr.puts("OK #{path} (#{installed.join(', ')})")
|
||||||
end
|
end
|
||||||
|
|
||||||
def run_thread(queue, all_scopes)
|
def run_thread(queue, all_scopes)
|
||||||
@@ -221,7 +222,7 @@ def run_thread(queue, all_scopes)
|
|||||||
Dir.mkdir(dir)
|
Dir.mkdir(dir)
|
||||||
|
|
||||||
grammars = load_grammars(dir, source, all_scopes)
|
grammars = load_grammars(dir, source, all_scopes)
|
||||||
install_grammars(grammars) if $options[:install]
|
install_grammars(grammars, source) if $options[:install]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user