lyp-win 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 534ac9d88a77c484848182c3e3afaf7e7218b6a7
4
- data.tar.gz: b1174d32d32e5cea1188e8bdb541ee6abdeb5625
3
+ metadata.gz: 4bdde7892b2da60d4c3c57e0f4f7bc2c64138f31
4
+ data.tar.gz: 632d9e270522c741b6d415d6e988fe80b621251c
5
5
  SHA512:
6
- metadata.gz: f3f7f1f4138f391723cc5b79f045101c99aa189b365a535ed7065b8e99e2950eb00fa18c498ccc78bd95f60f8aa6ddc6c783cede0e60c7756a7cbd779875e8db
7
- data.tar.gz: a9c51b25bf4975211790f3b300f6e6e4e6166fc3e5319c632f5fdbeeb6a3bcb1771c7eb7b7b809c6fc5ddc2b818af02e684b1d1d6cbe1dcb5572ca5c1022cbe6
6
+ metadata.gz: 3c87eaf0dde371904971772628fc971914cda3bbc4401809b7eed00fd8747c8e2100946767f6962f407111fe42578e0ee7f40100943eba5d23432561861fe4bf
7
+ data.tar.gz: 27b720a6fc0c1db76f859e8ba7178749e66d8cde097f21f6d28d519cad49769a265afb5b53a1c63af3ad2a151a5292ae89075431df86d36321ed0e199993633d
data/README.md CHANGED
@@ -7,765 +7,15 @@
7
7
 
8
8
  # lyp - The Lilypond Swiss Army Knife
9
9
 
10
- Use lyp to install and manage packages for [Lilypond](http://lilypond.org/), install and manage multiple versions of Lilypond on your machine, and improve your Lilypond workflow.
10
+ lyp is an open-source tool that takes the pain out of working with [Lilypond](http://lilypond.org/).
11
11
 
12
- __Code reuse__: lyp lets you install packages that act as Lilypond code libraries and can be used to enhance your Lilypond files with additional functionality. Packages can depend on other packages. Lyp resolves both direct and transitive package dependencies, and automatically selects the correct version to use for each package.
12
+ __Use packages__: Install [packages](http://lyp.noteflakes.com/lyp/#/?id=working-with-packages) to enhance your Lilypond files with additional functionality. Add [specialized tweaks](http://lyp.noteflakes.com/lyp/#/packages?id=tweaking) or even [change the music font](http://lyp.noteflakes.com/lyp/#/packages?id=fonts).
13
13
 
14
- __No hassle Lilypond installation__: With lyp you can also install any version of Lilypond on your machine with a single command, without having to visit the Lilypond website, clicking a link and then copying files around. In addition, lyp lets you switch between multiple versions of Lilypond and always keep your machine up to date with the latest version.
14
+ __No hassle Lilypond installation__: with lyp you can [install Lilypond](http://lyp.noteflakes.com/lyp/#/?id=installing-and-using-lilypond) with a single easy command, no need to click links, or unzip and copy files around.
15
15
 
16
- __Tools for power users__: with lyp you can [benchmark](#lyp-benchmark) and compare the performance of multiple versions of Lilypond, [flatten](#lyp-flatten) include files, automatically recompile [modified source files](#lyp-watch), and [automatically install](#lyp-compile) package dependencies or any required version of Lilypond.
16
+ __Even more tools for power users__: watch and automatically [recompile](http://lyp.noteflakes.com/lyp/#/?id=lyp-watch) changed source files, [flatten](http://lyp.noteflakes.com/lyp/#/?id=lyp-flatten) include files, and [automatically install](http://lyp.noteflakes.com/lyp/#/?id=lyp-compile) package dependencies or any required version of Lilypond.
17
17
 
18
- ## Table of contents
19
-
20
- - [Installation](#installation)
21
- - [System requirements](#system-requirements)
22
- - [Installing lyp as a Ruby gem](#installing-lyp-as-a-ruby-gem)
23
- - [Installing lyp as a standalone release](#installing-lyp-as-a-standalone-release)
24
- - [Manually installing releases](manually-installing-releases)
25
- - [Uninstalling lyp](#uninstalling-lyp)
26
- - [How lyp works](#how-lyp-works)
27
- - [Working with packages](#working-with-packages)
28
- - [What is a package?](#what-is-a-package)
29
- - [Installing packages](#installing-packages)
30
- - [Automatic package installation](#automatic-package-installation)
31
- - [Package references](#package-references)
32
- - [Version specifiers](#version-specifiers)
33
- - [Using packages](#using-packages)
34
- - [Developing packages](#developing-packages)
35
- - [The package interface](#the-package-interface)
36
- - [Including files](#including-files)
37
- - [Scheme interface](#scheme-interface)
38
- - [Including fonts](#including-fonts)
39
- - [Extending lyp](#extending-lyp)
40
- - [Testing packages](#testing-packages)
41
- - [Publishing packages](#publishing-packages)
42
- - [Installing and Using Lilypond](#installing-and-using-lilypond)
43
- - [Installing/uninstalling a version of Lilypond](#installinguninstalling-a-version-of-lilypond)
44
- - [Showing the list of installed Lilypond versions](#showing-the-list-of-installed-lilypond-versions)
45
- - [Showing available Lilypond versions](#Showing-available-lilypond-versions)
46
- - [Switching between Lilypond versions](#switching-between-lilypond-versions)
47
- - [Running Lilypond](#running-lilypond)
48
- - [Command Reference](#command-reference)
49
- - [lyp accelerate](#lyp-accelerate) - rewrite gem binaries for faster execution
50
- - [lyp benchmark](#lyp-benchmark) - benchmark installed versions of Lilypnd
51
- - [lyp cleanup](#lyp-cleanup) - cleanup temporary files
52
- - [lyp compile](#lyp-compile) - compile Lilypond source files
53
- - [lyp deps](#lyp-deps) - show dependencies for a given source file
54
- - [lyp exec](#lyp-exec) - execute a Lilypond script
55
- - [lyp flatten](#lyp-flatten) - flatten a Lilypond project by inlining includes
56
- - [lyp install](#lyp-install) - install package or Lilypond
57
- - [lyp list](#lyp-list) - list installed packages or Lilyponds
58
- - [lyp resolve](#lyp-resolve) - resolve and install dependencies for a given source file
59
- - [lyp search](#lyp-search) - search for packages or Lilyponds
60
- - [lyp test](#lyp-test) - run Lilypond test files
61
- - [lyp uninstall](#lyp-uninstall) - uninstall packages or Lilyponds
62
- - [lyp update](#lyp-update) - update packages
63
- - [lyp use](#lyp-use) - switch between installed Lilyponds
64
- - [lyp version](#lyp-version) - show lyp version
65
- - [lyp watch](#lyp-watch) - watch files and directories and recompile on change
66
- - [lyp which](#lyp-which) - show location of packages or Lilyponds
67
- - [Contributing](#contributing)
68
-
69
- ## Installation
70
-
71
- ### System requirements
72
-
73
- Lyp is tested to work on Linux, macOS and Windows 7+.
74
-
75
- ### Installing lyp as a Ruby gem
76
-
77
- _Note_: A recent version of Ruby (2.0.0 or later) is included in macOS 10.9.0 or later.
78
-
79
- If you have a recent (>=1.9.3) version of Ruby on your machine, you can install lyp as a gem.
80
-
81
- ```bash
82
- # Linux/macOS:
83
- $ gem install lyp
84
-
85
- # Windows:
86
- > gem install lyp-win
87
- ```
88
-
89
- ### Installing lyp as a standalone release
90
-
91
- If you don't have Ruby on your machine you can install lyp as a stand alone package using the install script ([view source](https://git.io/getlyp)):
92
-
93
- ```bash
94
- $ curl -sSL https://git.io/getlyp | bash
95
- ```
96
-
97
- or with Wget:
98
-
99
- ```bash
100
- $ wget -qO- https://git.io/getlyp | bash
101
- ```
102
-
103
- Windows users can simply download the latest Windows [release](https://github.com/noteflakes/lyp/releases), unzip it and run `lyp install self`:
104
-
105
- ```bash
106
- > unzip lyp-0.2.3-win32.zip
107
- > lyp-0.2.3-win32/bin/lyp install self
108
- ```
109
-
110
- ### Manually installing releases
111
-
112
- (This section is for Linux / macOS users.)
113
-
114
- If you feel uneasy about piping curl output to bash, you can install lyp yourself by downloading a [release](https://github.com/noteflakes/lyp/releases), untarring it, and running `lyp install self`:
115
-
116
- ```bash
117
- $ cd /Downloads
118
- # assuming linux-64 platform
119
- $ tar -xzf lyp-0.2.1-linux-x86_64.tar.gz
120
- $ lyp-0.2.1-linux-x86_64/lyp install self
121
- ```
122
-
123
- **Note**: using the standalone release of lyp requires having git on your machine.
124
-
125
- ### Uninstalling lyp
126
-
127
- In order to remove lyp from your system use the `uninstall self` command:
128
-
129
- ```bash
130
- $ lyp uninstall self
131
- ```
132
-
133
- This command will undo the changes made to your shell profile file, and remove any binaries from `~/.lyp/bin`.
134
-
135
- In order to completely remove all files in `~/.lyp` you can simply delete the directory:
136
-
137
- ```bash
138
- $ rm -rf ~/.lyp
139
- ```
140
-
141
- ## How lyp works
142
-
143
- Lyp sets up a working directory in `~/.lyp` where it keeps its binaries, installed packages, and installed versions of Lilypond. Lyp provides a wrapper script for Lilypond, which does the following:
144
-
145
- - Select the correct version of Lilypond to use (see [below](#installing-and-using-lilypond)).
146
- - Scan the given Lilypond file for any dependencies (specified using `\require`), and also recursively scan any include files for dependencies
147
- - Resolve the dependency tree and calculate the correct versions to use for each required package.
148
- - Create a wrapper Lilypond file that loads the packages.
149
- - Invoke the selected version of Lilypond.
150
-
151
- For more information on running Lilypond see the section on [Running Lilypond](#running-lilypond).
152
-
153
- ## Working with Packages
154
-
155
- A package is a library of Lilypond code, containing one or more Lilypond files, that provide commonly-used functionality for users. A package can be a library of scheme code to extend Lilypond, as in [OpenLilyLib](https://github.com/openlilylib/); or a stylesheet which contains music fonts and additional Lilypond code to change the look of the music: font, spacing, line widths, sizes, etc.
156
-
157
- The difference between merely copying and including a Lilypond file in your music, and using a Lilypond package is that you can easily share your music file with anyone and let them compile your music without having to download and copy additional code. lyp takes care of installing and resolving any dependencies in your Lilypond files, so that you can compile your Lilypond files anywhere without schlepping around a bunch of include files. Also, because packages are versioned, repeatable compilation using external code becomes trivial.
158
-
159
- ### What is a package?
160
-
161
- In lyp, a package is a directory that should contain at least a single Lilypond file named `package.ly` in its root directory. A package could contain additional Lilypond and scheme files referenced in the main package file (using relative `\include`s). A package could also depend on other packages by using the `\require` command (see [below](#using-packages)).
162
-
163
- Lyp packages are expected to be published as git repositories. The package is then versioned using git tags. A package can be referenced either using its git URL, a registered canonical name (if it's registered in the [lyp package index](https://github.com/lyp-packages/index)), or alternatively as a local path (which is really meant for package development more than anything else).
164
-
165
- Packages can also include test files, examples that demonstrate proper usage, ruby source code for enhancing lyp itself, or alternative font files for creating a custom look for Lilypond scores.
166
-
167
- ### Installing packages
168
-
169
- In order to install a package, use the `lyp install` command:
170
-
171
- ```bash
172
- # install latest version of package dummy
173
- $ lyp install dummy
174
-
175
- # install version 0.2.0
176
- $ lyp install github.com/ciconia/mypack@0.2.0
177
-
178
- # install version 0.1.0 or higher
179
- $ lyp install "mypack>=0.1.0"
180
-
181
- # install from local path (see section below on developing packages)
182
- $ lyp install mypack@dev:~/repo/mypack
183
- ```
184
-
185
- To uninstall the package, use the `lyp uninstall` command:
186
-
187
- ```bash
188
- # uninstall version 0.1.0
189
- $ lyp uninstall dummy@0.1.0
190
-
191
- # uninstall all versions of dummy
192
- $ lyp uninstall -a dummy
193
- ```
194
-
195
- To list currently installed packages use `lyp list` command:
196
-
197
- ```bash
198
- # list all installed packages
199
- $ lyp list
200
-
201
- # list all installed packages matching the pattern 'font'
202
- $ lyp list font
203
- ```
204
-
205
- To list packages available on the lyp package index use the `lyp search` command:
206
-
207
- ```bash
208
- # list all packages in index
209
- lyp search
210
-
211
- # list available packages matching pattern 'stylesheet'
212
- lyp search stylesheet
213
- ```
214
-
215
- ### Automatic package installation
216
-
217
- An easier way to install packages is by using the `lyp resolve` command, which installs all packages required for a given input file. Suppose a Lilypond called `test.ly` with the following content:
218
-
219
- ```lilypond
220
- \version "2.19.35"
221
- \require "assert"
222
-
223
- #(assert-eq? 1 1)
224
- #(assert:summary)
225
- ```
226
-
227
- To install the `assert` package required in the file we run:
228
-
229
- ```bash
230
- $ lyp resolve test.ly
231
-
232
- Cloning https://github.com/lyp-packages/assert.git...
233
-
234
- Installed assert@0.2.0
235
- ```
236
-
237
- Package dependencies for a given input file can be shown using the `lyp deps` command:
238
-
239
- ```bash
240
- $ lyp deps test.ly
241
-
242
- assert => 0.2.0
243
- ```
244
-
245
- ### Package references
246
-
247
- A package is normally referenced by its git URL. Lyp lets you provide either fully- or partially qualified URLs. A package hosted on github can be also referenced by the user/repository pair. The following are all equivalent:
248
-
249
- ```bash
250
- # Fully-qualified URLs
251
- $ lyp install https://github.com/lyp-packages/package-template.git
252
- $ lyp install https://github.com/lyp-packages/package-template
253
-
254
- # Partially-qualified URL
255
- $ lyp install github.com/lyp-packages/package-template
256
-
257
- # Github repository id
258
- $ lyp install noteflakes/lyp-package-template
259
- ```
260
-
261
- In addition, lyp also provides an [index of publically available package](https://github.com/lyp-packages/index), which maps a package name to its URL (see also below). Using the index, packages are referenced by their published name instead of by their git URL:
262
-
263
- ```bash
264
- $ lyp install dummy
265
- ```
266
-
267
- To get a list of all available packages on the index, use the `lyp search` command.
268
-
269
- ### Version specifiers
270
-
271
- When installing packages defining package dependencies, it is advisable to specify the desired version to use. Using definitive versions lets you ensure that your third-party dependencies do not change unexpectedly and do not break your code.
272
-
273
- Versions can either be specified as specific version numbers, as version constraints or as descriptive names.
274
-
275
- Versions are specified using the ampersand character:
276
-
277
- ```
278
- package@0.1.0
279
- package@stable
280
- ```
281
-
282
- Version constraints specify a range of versions to use. Lyp currently supports two types of constraints:
283
-
284
- - Optimistic constraint: `package>=0.1.0`, which means any version equal to or higher than 0.1.0.
285
- - Pessimistic constraint: `package~>0.1.0`, which means any version equal or higher than 0.1.0, and lower than 0.2.0. This type of constraint is useful for packages which follow the semantic versioning standard.
286
-
287
- Version specifiers could be used when installing, listing and requiring packages, and also for specifying versions of Lilypond (see [below](#installing-and-using-lilypond)). For example:
288
-
289
- ```bash
290
- $ lyp install "dummy~>0.2.0"
291
- ```
292
-
293
- **Note**: when using version constraints you should put the package specifier in quotes for bash properly parse the command.
294
-
295
- ### Using packages
296
-
297
- To include a package in your Lilypond code, use the `\require` command:
298
-
299
- ```lilypond
300
- \require "dummy"
301
- \require "github.com/lulu/mypack>=0.4.0"
302
- ```
303
-
304
- **Note**: once you use `\require` in your code, you will have to compile it using the Lilypond wrapper provided by lyp. It will not pass compilation using plain Lilypond.
305
-
306
- Once the package requirements are defined, you can either install packages manually using [`lyp install`](#installing-packages), or automatically using [`lyp resolve`](#automatic-package-installation) as described above.
307
-
308
- ## Developing packages
309
-
310
- To create a Lilypond package:
311
-
312
- - Create a git repository.
313
- - Add a `package.ly` file, which is the main entry point for your package.
314
- - Optionally add additional Lilypond files or package dependencies.
315
- - Test & debug your code (see [below](#testing-packages)).
316
- - Publish your package (see [below](#publishing-packages)).
317
-
318
- To test your package with an actual input file, you can install it from a local path (for more on testing see [below](#testing-packages)). Suppose your package is at ~/repo/mypack:
319
-
320
- ```bash
321
- $ lyp install mypack@dev:~/repo/mypack
322
- ```
323
-
324
- This will create a `mypack@dev` package referencing your local files, which you can then reference normally from an input file using the `\require` command:
325
-
326
- ```lilypond
327
- \require "mypack@dev"
328
- ```
329
-
330
- If the input file is residing inside your package (for example, [test files](#testing-packages)), you can require your package by specifying a relative path. Suppose the input file is at `mypack/test/mypack_test.ly`:
331
-
332
- ```lilypond
333
- \require "mypack:.."
334
- ```
335
-
336
- ### The package interface
337
-
338
- In order to facilitate writing complex packages, lyp defines a few variables and functions:
339
-
340
- - `lyp:current-package-dir` - the absolute directory path for the current package (at the time the package is loaded)
341
- - `lyp:input-filename` - the absolute path for the user's file being compiled
342
- - `lyp:input-dirname` - the absolute directory path for the user's file being compiled
343
-
344
- ### Including files
345
-
346
- Lyp provides the `\pinclude` and `\pincludeOnce` commands for including files residing in the current package using relative paths. The `\pincludeOnce` commands loads a given file only once:
347
-
348
- ```lilypond
349
- \pincludeOnce "inc/init.ily"
350
- \pinclude "inc/template.ily"
351
- ```
352
-
353
- Lyp also defines a `lyp:load` scheme function for loading scheme files using relative paths without adding directories to the `%load-path`:
354
-
355
- ```lilypond
356
- #(if (not (defined? 'mypack:init))(lyp:load "scm/init.scm"))
357
- ```
358
-
359
- Loading scheme files that way is a better technique than adding directories to `%load-path`, because this way one avoids possible name clashes, which may lead to unexpected behavior.
360
-
361
- ### Conditional includes
362
-
363
- Files can also be included conditionally by evaluating a scheme expression using the `\pcondInclude` and `\pcondIncludeOnce` commands:
364
-
365
- ```lilypond
366
- % include edition-specific tweaks
367
- \pcondInclude #(eq? edition 'urtext) "urtext_tweaks.ly"
368
- ```
369
-
370
- ### Scheme interface
371
-
372
- Lyp provides to loaded packages a small API to facilitate handling relative paths and loading of Lilypond include files and scheme files. The API is documented on the [lyp wiki](https://github.com/noteflakes/lyp/wiki/Package-Scheme-Interface).
373
-
374
- ### Including fonts
375
-
376
- Lyp also supports automatic installation of fonts, based on work by [Abraham Lee](https://github.com/tisimst). When a package is installed, lyp will copy any font files residing in the `fonts` directory into the corresponding `otf` and `svg` directories of all installed versions of Lilypond.
377
-
378
- **Note**: fonts will be only installed in versions of Lilypond starting from than 2.18.2. Lyp automatically patches any version newer than 2.19.12 in order to support custom fonts.
379
-
380
- ### Extending lyp
381
-
382
- A package can also be used to extend or override lyp's stock functionality or add more features and commands. Extensions are written in Ruby in a file named `ext.rb` placed in the package's main directory. An extension can be used to either perform a certain action when the package is installed, or be loaded each time lyp is invoked.
383
-
384
- When a package is installed, lyp executes the code in `ext.rb`. To make the extension run each time lyp is invoked, the extension should include the following line:
385
-
386
- ```ruby
387
- Lyp.install_extension(__FILE__)
388
- ```
389
-
390
- More commands can be added to lyp's command line interface by adding methods to the `Lyp::CLI` class using the [Thor](https://github.com/erikhuda/thor/wiki/Method-Options) API. For example:
391
-
392
- ```ruby
393
- class Lyp::CLI
394
- desc "count", "show package count"
395
- def count
396
- packages = Lyp::Package.list_lyp_index("")
397
- puts "#{packages.size} packages installed"
398
- end
399
- end
400
- ```
401
-
402
- The implementation of the stock lyp commands can be be found in [`lib/lyp/cli.rb`](./lib/lyp/cli.rb).
403
-
404
- ### Testing Packages
405
-
406
- Packages can be tested by using the `lyp test` command, which will compile any file found inside the package directory ending in `_test.ly`:
407
-
408
- ```bash
409
- $ cd mypack
410
- $ lyp test .
411
- ```
412
-
413
- A test file can either be a simple Lilypond file which includes the package files and results in a Lilypond score, or a Lilypond file that performs unit tests on scheme code.
414
-
415
- For more information on testing, see the [lyp-assert](https://github.com/lyp-packages/assert) package, which is meant to be used for unit testing Lilypond code, and serves as an example of how to test a package.
416
-
417
- ### Publishing packages
418
-
419
- In order for your package to be available to all users, you'll need to first push your code to a publically accessible git repository (for example on github). Users will then be able to install your package by using the git URL of the public repository.
420
-
421
- You can also add your package to the lyp [public package index](https://github.com/lyp-packages/index), by cloning it, editing [index.yaml](https://github.com/lyp-packages/index/blob/master/index.yaml), and creating a pull request.
422
-
423
- ## Installing and Using Lilypond
424
-
425
- ### Installing/uninstalling a version of Lilypond
426
-
427
- When installing Lilypond, the specific version to download can be specified in different ways:
428
-
429
- ```bash
430
- # latest stable version
431
- $ lyp install lilypond
432
-
433
- # latest stable version
434
- $ lyp install lilypond@stable
435
-
436
- # latest stable version
437
- $ lyp install lilypond@unstable
438
-
439
- # latest version
440
- $ lyp install lilypond@latest
441
-
442
- # version 2.18.1
443
- $ lyp install lilypond@2.18.1
444
-
445
- # highest version higher than 2.19.27
446
- $ lyp install "lilypond>=2.19.27"
447
-
448
- # highest 2.18 version higher than 2.18.1
449
- $ lyp install "lilypond~>2.18.1"
450
- ```
451
-
452
- To uninstall a version Lilypond use `lyp uninstall`
453
-
454
- ```bash
455
- $ lyp uninstall lilypond@2.18.2
456
- ```
457
-
458
- ### Showing the list of installed Lilypond versions
459
-
460
- To display all installed versions of Lilypond, use the `list` command:
461
-
462
- ```bash
463
- $ lyp list lilypond
464
- ```
465
-
466
- The output will look as follows:
467
-
468
- ```
469
- Lilypond versions:
470
-
471
- => 2.18.2
472
- 2.19.12
473
- * 2.19.35
474
-
475
- # => - current
476
- # =* - current && default
477
- # * - default
478
- ```
479
-
480
- (For current, default settings see [below](#switching-between-lilypond-versions))
481
-
482
- This will also list any versions of Lilypond found on the user's `$PATH` outside of the `~/.lyp` directory (these versions will be marked as 'system' versions).
483
-
484
- ### Showing available Lilypond versions
485
-
486
- You can also list available versions of Lilypond by using the `search` command:
487
-
488
- ```bash
489
- # display all available versions of Lilypond
490
- $ lyp search lilypond
491
-
492
- # display all available versions higher than 2.19
493
- $ lyp search "lilypond>=2.19"
494
-
495
- # display all available stable versions
496
- $ lyp search "lilypond@stable"
497
- ````
498
-
499
- The output will look as follows:
500
-
501
- ```
502
- Available versions of lilypond@stable:
503
-
504
- 2.8.8
505
- 2.10.0
506
- 2.10.33
507
- 2.12.0
508
- 2.12.3
509
- 2.14.0
510
- 2.14.2
511
- 2.16.0
512
- 2.16.1
513
- 2.16.2
514
- 2.18.0
515
- 2.18.1
516
- * 2.18.2
517
-
518
- * Currently installed
519
- ```
520
-
521
- ### Switching between Lilypond versions
522
-
523
- To switch between versions use the `lyp use`. The same version specifiers could be used as for the `lyp install` command:
524
-
525
- ```bash
526
- $ lyp use lilypond@2.18.2 # the 'lilypond' identifier is optional
527
-
528
- # use latest stable/unstable versions
529
- $ lyp use stable
530
- $ lyp use unstable
531
- ```
532
-
533
- **Note**: The setting of the current Lilypond version to use will be maintained for the current shell session.
534
-
535
- In order to switch the default version of Lilypond to use, add the `--default` switch:
536
-
537
- ```bash
538
- $ lyp use --default 2.19.35
539
- ```
540
-
541
- The version used can be further controlled using the `--use` and `--env` options passed to `lilypond` (see [below](#running-lilypond)).
542
-
543
- As discussed [above](#showing-the-list-of-installed-lilypond-versions), the `lyp list lilypond` command displays the current and default settings. You can also display the path to the currently selected version by running `lyp which lilypond`:
544
-
545
- ```bash
546
- $ lyp which lilypond
547
- /Users/sharon/.lyp/lilyponds/2.18.2/bin/lilypond
548
- ```
549
-
550
- ### Running Lilypond
551
-
552
- Once one or more versions of Lilypond are installed, the Lilypond command may be used normally to compile Lilypond files. Lyp adds a few extra options:
553
-
554
- - `--auto-install-deps`, `-A` - automatically install any missing dependencies.
555
-
556
- - `--cropped`, `-c` - produce a cropped score (requires setting margins to 0).
557
-
558
- - `--env`, `-E` - use a version set by the `$LILYPOND_VERSION` environment variable:
559
-
560
- ```bash
561
- $ LILYPOND_VERSION=2.18.2 lilypond --env ...
562
- ```
563
-
564
- - `--force-version`, `-F` - use the Lilypond version specified in the user file.
565
-
566
- - `--install`, `-n` - install the specified version of Lilypond if not present. This option works only in conjunction with `--env` or `--use`:
567
-
568
- ```bash
569
- $ lilypond -u2.19.35 -n ...
570
- ```
571
-
572
- - `--open`, `-O` - open target file after compilation.
573
-
574
- - `--raw`, `-R` - do not pre-process input file (no scanning for dependencies, no wrapping).
575
-
576
- ```bash
577
- $ lilypond --raw ...
578
- ```
579
-
580
- - `--require`, `--r` - require a package:
581
-
582
- ```bash
583
- $ lilypond -rassert mytest.ly
584
- ```
585
-
586
- - `--snippet`, `-S` - produce a cropped PNG image at 600dpi
587
-
588
- - `--use`, `-u` - use a specific version of Lilypond:
589
-
590
- ```bash
591
- $ lilypond --use=2.19.12 myfile.ly
592
-
593
- # version constraints can also be used:
594
- $ lilypond --use=">=2.19.12" myfile.ly
595
- $ lilypond --ustable myfile.ly
596
- $ lilypond --ulatest myfile.ly
597
- ```
598
-
599
- ## Command Reference
600
-
601
- ### lyp accelerate
602
-
603
- Synopsis: `lyp accelerate`
604
-
605
- Rewrites gem binaries for faster execution. When lyp is installed as a gem, the Rubygems system creates wrapper script files for `lyp` and `lilypond` which incur a performance penalty that adds up to 200msecs per invocation. Use this command to rewrite the gem binaries so as to improve their running time.
606
-
607
- ### lyp benchmark
608
-
609
- Synopsis: `lyp benchmark FILE`
610
-
611
- Benchmarks the running time of all installed versions of Lilypond using the given source file. This command accepts all Lilypond command line switches.
612
-
613
- ### lyp cleanup
614
-
615
- Synopsis: `lyp cleanup`
616
-
617
- Cleanup temporary files. lyp keeps a bunch of temporary directories and files under the system temporary directory, usually at `/tmp/lyp`. These include wrapper files, git repositories for installed packages, Lilypond archive files etc. These will normally be cleaned up by the OS after a period of time, but you can use this command to delete the entire content of this directory if you need the disk space.
618
-
619
- ### lyp compile
620
-
621
- Synopsis: `lyp compile ... FILE`
622
-
623
- Shorthand: `lyp c`
624
-
625
- Compiles Lilypond source files. This command is synonymous to running `lilypond`. You can pass along any switches accepted by Lilypond. In addition, lyp adds a few options to provide additional functionality:
626
-
627
- - `--auto-install-deps`/`-a`: install any missing dependencies
628
- - `--cropped`/`-c`: crop output (requires setting 0 margins)
629
- - `--env`/`-E`: use the Lilypond version specified in the `LILYPOND_VERSION` environment variable:
630
-
631
- ```bash
632
- $ LILYPOND_VERSION=2.19.50 lyp c mysuperscore.ly
633
- ```
634
-
635
- - `--force-version`/`-F`: use Lilypond version specified in user file
636
- - `--install`/`-n`: install version of Lilypond if not found (if the required version was overriden using any of `--env`, `--force-version` or `--use`)
637
- - `--open`/`-O`: open output file after compilation
638
- - `--raw`/`-R`: run Lilypond "raw" (no pre-processing of dependencies)
639
- - `--require=PACKAGE`/`-rPACKAGE`: preload the specified package
640
-
641
- ```bash
642
- $ lyp -rassert mytests.ly
643
- ```
644
-
645
- - `--snippet`/`-S`: produce png cropped images at 600dpi (equivalent to `--cropped --png -dresolution=600`)
646
- - `--use=VERSION`/`-uVERSION`: use the given version of Lilypond:
647
-
648
- ```bash
649
- $ lyp c -u2.19.53 myfile.ly
650
- # automatically install given version of Lilypond
651
- $ lyp c -nu2.19.53 myfile.ly
652
- ```
653
-
654
- ### lyp deps
655
-
656
- Synopsis: `lyp deps FILE`
657
-
658
- Shows dependencies for a given source file.
659
-
660
- ### lyp exec
661
-
662
- Synopsis: `lyp exec SCRIPT ...`
663
-
664
- Shorthand: `lyp x`
665
-
666
- Runs a Lilypond script (using the currently selected version of Lilypond).
667
-
668
- ### lyp flatten
669
-
670
- Synopsis: `lyp flatten SOURCE [DEST]`
671
-
672
- Flattens the given input file at `SOURCE` and all included files into a single file to be written to `DEST`. If `DEST` is not specified, the file is written to `STDOUT`.
673
-
674
- ### lyp install
675
-
676
- Synopsis: `lyp install PACKAGE|lilypond@VERSION`
677
-
678
- Shorthand: `lyp i`
679
-
680
- Installs a package or a Lilypond. See [installing packages](#installing-packages) and [installing versions of Lilypond](#installing-and-using-lilypond) above.
681
-
682
- ### lyp list
683
-
684
- Synopsis: `lyp list [PACKAGE|lilypond]`
685
-
686
- Shorthand: `lyp l`
687
-
688
- Lists installed packages or Lilyponds.
689
-
690
- ### lyp resolve
691
-
692
- Synopsis: `lyp resolve FILE``
693
-
694
- Resolves and optionally installs all dependencies for a given source file. To install required dependencies use the `--all`/`-a` switch:
695
-
696
- ```bash
697
- $ lyp resolve -a myfile.ly
698
- ```
699
-
700
- ### lyp search
701
-
702
- Synopsis: `lyp search PACKAGE|lilypond``
703
-
704
- Shorthand: `lyp s`
705
-
706
- Searches for packages or versions of Lilypond.
707
-
708
- ### lyp test
709
-
710
- Synopsis: `lyp test DIRECTORY`
711
-
712
- Shorthand: `lyp t`
713
-
714
- Runs Lilypond tests by compiling all files in the given directory matching the pattern `*-test.ly`.
715
-
716
- ### lyp uninstall
717
-
718
- Synopsis: `lyp uninstall PACKAGE|lilypond@VERSION`
719
-
720
- Shorthand: `lyp u`
721
-
722
- Uninstalls a package or a Lilypond.
723
-
724
- ### lyp update
725
-
726
- Synopsis: `lyp update PACKAGE`
727
-
728
- Updates an installed package to its latest available version.
729
-
730
- ### lyp use
731
-
732
- Synopsis: `lyp use VERSION``
733
-
734
- Shorthand: `lyp U`
735
-
736
- Switches to a different version of Lilypond. To set the default version, use the `--default` switch:
737
-
738
- ```bash
739
- $ lyp use --default 2.19.52
740
- ```
741
-
742
- ### lyp version
743
-
744
- Synopsis: `lyp version``
745
-
746
- Shorthand: `lyp -v``
747
-
748
- Displays the version of lyp.
749
-
750
- ### lyp watch
751
-
752
- Synopsis: `lyp watch DIRECTORY|FILE...``
753
-
754
- Shorthand: `lyp w`
755
-
756
- Watches one or more directories or files and recompiles any files that have been modified. To watch a directory of include files and always recompile the same project file, use the `--target`/`-t` switch:
757
-
758
- ```bash
759
- $ lyp watch bwv35 --target bwv35/score.ly
760
- ```
761
-
762
- This command accepts all Lilypond command line switches.
763
-
764
- ### lyp which
765
-
766
- Synopsis: `lyp which PACKAGE|lilypond`
767
-
768
- Shows the location of the given package or the currently selected Lilypond.
18
+ For more information, see the lyp [documentation](http://lyp.noteflakes.com/).
769
19
 
770
20
  ## Contributing
771
21
 
@@ -422,6 +422,7 @@ class Lyp::CLI < Thor
422
422
  end
423
423
 
424
424
  def self.run
425
+ trap("INT") {puts; exit}
425
426
  start(ARGV)
426
427
  rescue => e
427
428
  puts e.message
@@ -466,13 +466,24 @@ module Lyp::Lilypond
466
466
  end
467
467
  end
468
468
 
469
- def install_version(version, opts)
469
+ def install_version(version, opts, retry_count = 0)
470
470
  platform = detect_lilypond_platform
471
471
  url = lilypond_install_url(platform, version, opts)
472
472
  fn = temp_install_filename(url)
473
-
474
- download_lilypond(url, fn, opts) unless File.file?(fn)
475
- install_lilypond_files(fn, platform, version, opts)
473
+ install_filename_exists = File.file?(fn)
474
+
475
+ download_lilypond(url, fn, opts) unless install_filename_exists
476
+ begin
477
+ install_lilypond_files(fn, platform, version, opts)
478
+ rescue => e
479
+ retry_count += 1
480
+ if install_filename_exists && (retry_count < 3)
481
+ puts "Failed to extract existing archive, retrying download..."
482
+ FileUtils.rm(fn)
483
+ return install_version(version, opts, retry_count)
484
+ end
485
+ raise e
486
+ end
476
487
 
477
488
  patch_font_scm(version)
478
489
  copy_fonts_from_all_packages(version, opts)
@@ -1,3 +1,3 @@
1
1
  module Lyp
2
- VERSION = "1.3.3"
2
+ VERSION = "1.3.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lyp-win
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-03 00:00:00.000000000 Z
11
+ date: 2017-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient