fix: Migrate build script to ruby

This commit is contained in:
Adam Stankiewicz
2020-08-23 23:35:05 +02:00
parent 114a93bb7c
commit 23defeb610
4 changed files with 1109 additions and 7 deletions

View File

@@ -38,7 +38,7 @@ mkdir -p ~/.vim/pack/default/start
git clone https://github.com/sheerun/vim-polyglot ~/.vim/pack/default/start/vim-polyglot
```
NOTE: Not all features of listed language packs are available. We strip them from functionality slowing vim startup in general (for example we ignore `plugins` folder that is loaded regardless of file type, use `ftplugin` instead).
NOTE: Not all features of individual language packs are available. We strip them from functionality slowing vim startup (for example we ignore `plugins` folder that is loaded regardless of file type, instead we prefer `ftplugin` which is loaded lazily).
If you need full functionality of any plugin, please use it directly with your plugin manager.
@@ -205,7 +205,7 @@ If you need full functionality of any plugin, please use it directly with your p
## Updating
You can either wait for new patch release with updates or run the `./build` script by yourself.
You can either wait for new patch release with updates or run the `scripts/build` script by yourself.
## Troubleshooting
@@ -218,13 +218,13 @@ Individual language packs can be disabled by setting `g:polyglot_disabled` as fo
let g:polyglot_disabled = ['css']
```
Note that disabling languages won't make in general your vim startup any faster / slower (only for specific file type). Vim-polyglot is selection of language plugins that are loaded only on demand.
Please note that disabling a language won't make in your vim startup any faster / slower (only for specific this specific filetype). All plugins are loaded lazily, on demand.
## Contributing
Language packs are periodically updated using automated `build` script.
Language packs are periodically updated using automated `scripts/build` script.
Feel free to add your language to `packages.yaml`, and send pull-request. Please don't run `./build` and include that in your PR, send just changes to `packages.yaml` and `build` script if really necessary.
Feel free to add your language to `packages.yaml`, and send pull-request. Please don't run `scripts/build` and include that in your PR, send just changes to `packages.yaml` and `build` script if really necessary. You can run `scripts/test` to run rough tests.
## License

View File

@@ -5,7 +5,7 @@ require 'open3'
require 'yaml'
require 'fileutils'
Dir.chdir(__dir__)
Dir.chdir(File.dirname(__dir__))
PACKAGES = YAML.load_stream(File.read('packages.yaml'))
@@ -66,7 +66,7 @@ def each_hash(data, &block)
end
def patterns_to_vim_patterns(patterns)
stdin, stdout, stderr = Open3.popen3('vim', '-V', '--clean', '/dev/stdin', '-es', '-c', "echo expand('%:p:h') | source #{__dir__}/eregex.vim", '-c', "for line in range(0, line('$')) | call setline(line, ExtendedRegex2VimRegex(getline(line))) | endfor", '-c', ':wq! /dev/stdout', chdir: __dir__)
stdin, stdout, stderr = Open3.popen3('vim', '-V', '--clean', '/dev/stdin', '-es', '-c', "echo expand('%:p:h') | source #{__dir__}/scripts/eregex.vim", '-c', "for line in range(0, line('$')) | call setline(line, ExtendedRegex2VimRegex(getline(line))) | endfor", '-c', ':wq! /dev/stdout', chdir: __dir__)
stdin.write(patterns.join("\n"))
stdin.close
stdout.readlines

1102
scripts/eregex.vim Normal file

File diff suppressed because it is too large Load Diff

View File