lyp 0.2.3 → 0.3.0

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: 0526bbb1656a6c6908733533c3bba2328fe7ae6e
4
- data.tar.gz: c3bb37df62281ff3dcb02d06dffa6fbb9ad0bd93
3
+ metadata.gz: f42faeca80592cbc261208384e53d7205bcfa058
4
+ data.tar.gz: d4e7574bda07418c782076aad5c01c8b7f0f6008
5
5
  SHA512:
6
- metadata.gz: c276e9128136b033690feca8346fc5012ef6d2a8a4f3394eb59a67d75f141b8a0ac00ee9224c9386669bfa63395221fd6bb24b5e1466045101dbefb142508c29
7
- data.tar.gz: 1e613e28b8b5c03e5fcf22dff77e51d82f90b03d227f570bf7e76ffd089e30ff843a0a2b72ebc7de7e1f9602a06197271da5f47ca09d246fabef7b22942e57d4
6
+ metadata.gz: 9cc74befb159bc7d74d0059137c506bdc7fb5720b8ac74f113b5e8ae7cdc1a3e40218d45b5ebb841d0ee59dd78aa9a51ba9b00aacadaa5600484606bc963dcc3
7
+ data.tar.gz: b7eaf8be84f505f8dc242d91b45f3bc6a1d8b74fec5756f0f67a2d79c2dfefbf77401fed49e923d6e9059c02053c4ffab5b01d413ca108bca555e239625c4079
data/README.md CHANGED
@@ -14,6 +14,7 @@ __No hassle Lilypond installation__: With lyp you can also install any version o
14
14
  - [System requirements](#system-requirements)
15
15
  - [Installing lyp as a Ruby gem](#installing-lyp-as-a-ruby-gem)
16
16
  - [Installing lyp as a standalone release](#installing-lyp-as-a-standalone-release)
17
+ - [Manually installing releases](manually-installing-releases)
17
18
  - [Uninstalling lyp](#uninstalling-lyp)
18
19
  - [How lyp works](#how-lyp-works)
19
20
  - [Working with packages](#working-with-packages)
@@ -41,30 +42,20 @@ __No hassle Lilypond installation__: With lyp you can also install any version o
41
42
 
42
43
  ### System requirements
43
44
 
44
- Lyp is tested to work on Linux, Mac OSX and Windows 7+.
45
-
46
- **Note**: Windows users will currently need to install lyp as a Ruby gem, and will also need to have git installed in order to be able to install packages.
45
+ Lyp is tested to work on Linux, Mac OS X and Windows 7+.
47
46
 
48
47
  ### Installing lyp as a Ruby gem
49
48
 
50
49
  If you have a recent (>=1.9.3) version of Ruby on your machine, you can install lyp as a gem.
51
50
 
52
51
  ```bash
53
- # Linux/OSX only
52
+ # Linux/Mac OS X:
54
53
  $ gem install lyp
55
- $ lyp install self
56
- ```
57
-
58
- The `lyp install self` command is needed in order to setup the `~/.lyp` working directory and add the lyp binaries directory to your `PATH` (see below), by adding a line of code to your shell profile file.
59
-
60
- Windows users should install the lyp-win gem:
61
54
 
62
- ```bash
55
+ # Windows:
63
56
  > gem install lyp-win
64
57
  ```
65
58
 
66
- On Windows, there's no need to run the `lyp install self` command.
67
-
68
59
  ### Installing lyp as a standalone release
69
60
 
70
61
  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)):
@@ -79,6 +70,17 @@ or with Wget:
79
70
  $ wget -qO- https://git.io/getlyp | bash
80
71
  ```
81
72
 
73
+ Windows users can simply download the latest Windows [release](https://github.com/noteflakes/lyp/releases), unzip it and run `lyp install self`:
74
+
75
+ ```bash
76
+ > unzip lyp-0.2.3-win32.zip
77
+ > lyp-0.2.3-win32/bin/lyp install self
78
+ ```
79
+
80
+ ### Manually installing releases
81
+
82
+ (This section is for Linux / Mac OS X users.)
83
+
82
84
  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`:
83
85
 
84
86
  ```bash
@@ -88,8 +90,6 @@ $ tar -xzf lyp-0.2.1-linux-x86_64.tar.gz
88
90
  $ lyp-0.2.1-linux-x86_64/lyp install self
89
91
  ```
90
92
 
91
- https://github.com/noteflakes/lyp/releases/download/v0.2.1/lyp-0.2.1-linux-x86_64.tar.gz
92
-
93
93
  **Note**: using the standalone release of lyp requires having git on your machine.
94
94
 
95
95
  ### Uninstalling lyp
@@ -18,7 +18,7 @@ download() {
18
18
  }
19
19
 
20
20
  WORKDIR="/tmp/lyp-release-installer"
21
- LYP_VERSION="0.2.3"
21
+ LYP_VERSION="0.3.0"
22
22
  URL_BASE="https://github.com/noteflakes/lyp/releases/download/v$LYP_VERSION"
23
23
 
24
24
  PLATFORM=`uname -sp`
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ $LOAD_PATH.unshift File.expand_path("../lib", File.dirname(__FILE__))
4
+
3
5
  require 'lyp/version'
4
6
  require 'lyp'
5
7
 
data/bin/lyp CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "lyp"
4
- require "lyp/cli"
3
+ $LOAD_PATH.unshift File.expand_path("../lib", File.dirname(__FILE__))
5
4
 
5
+ require 'lyp'
6
+ require 'lyp/cli'
@@ -46,7 +46,7 @@ You can uninstall lyp at any time by running 'lyp uninstall self'.
46
46
  EOF
47
47
 
48
48
  def test_installed_status!
49
- unless installed?
49
+ unless !is_gem? && installed?
50
50
  STDERR.puts INSTALL_MSG
51
51
  end
52
52
  end
@@ -95,36 +95,34 @@ EOF
95
95
  end
96
96
 
97
97
  def setup_files
98
- bin_dir = File.expand_path(File.dirname($0))
99
-
100
- if is_gem?(bin_dir)
101
- setup_gem_files(bin_dir)
98
+ if is_gem?
99
+ setup_gem_files
102
100
  else
103
- setup_release_files(bin_dir)
101
+ setup_release_files
104
102
  end
105
103
  end
106
104
 
107
105
  RELEASE_BIN_PATH = "lib/app/bin"
106
+ SELF_DIR = File.expand_path(File.dirname($0))
108
107
 
109
- def is_gem?(bin_dir)
110
- bin_dir !~ /#{RELEASE_BIN_PATH}$/
108
+ def is_gem?
109
+ SELF_DIR !~ /#{RELEASE_BIN_PATH}$/
111
110
  end
112
111
 
113
- def setup_gem_files(bin_dir)
114
-
112
+ def setup_gem_files
115
113
  FileUtils.rm_rf(Lyp::LYP_BIN_DIRECTORY)
116
114
  FileUtils.mkdir_p(Lyp::LYP_BIN_DIRECTORY)
117
115
 
118
116
  %w{lyp lilypond}.each do |fn|
119
- FileUtils.ln_sf("#{bin_dir}/#{fn}", "#{Lyp::LYP_BIN_DIRECTORY}/#{fn}")
117
+ FileUtils.ln_sf("#{SELF_DIR}/#{fn}", "#{Lyp::LYP_BIN_DIRECTORY}/#{fn}")
120
118
  end
121
119
  end
122
120
 
123
- def setup_release_files(bin_dir)
121
+ def setup_release_files
124
122
  FileUtils.rm_rf(Lyp::LYP_BIN_DIRECTORY)
125
123
  FileUtils.mkdir_p(Lyp::LYP_BIN_DIRECTORY)
126
124
 
127
- release_dir = File.expand_path(File.join(bin_dir, '../../../'))
125
+ release_dir = File.expand_path(File.join(SELF_DIR, '../../../'))
128
126
 
129
127
  puts "Copying Ruby runtime & gems..."
130
128
  lib_dir = File.join(release_dir, 'lib')
@@ -1,3 +1,3 @@
1
1
  module Lyp
2
- VERSION = "0.2.3"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -99,10 +99,35 @@ module Lyp::System
99
99
  true
100
100
  end
101
101
 
102
+ # - Copy the entire directory to ~/.lyp
103
+ # - Create wrappers in Windows/System32 that call ~/.lyp/bin
102
104
  def install!
103
- puts "\ninstall self curently not supported on Windows.\n\n"
105
+ return if is_gem?
106
+
107
+ puts "\nInstalling lyp...\n\n"
108
+ copy_package_files
109
+ create_wrapper_batch_files
110
+ end
111
+
112
+ def copy_package_files
113
+ package_root = File.expand_path('../../../..', File.dirname(__FILE__))
114
+ FileUtils.rm_rf("#{Lyp::LYP_DIRECTORY}/lib")
115
+ FileUtils.rm_rf("#{Lyp::LYP_DIRECTORY}/bin")
116
+ FileUtils.cp_r("#{package_root}/lib", "#{Lyp::LYP_DIRECTORY}/lib")
117
+ FileUtils.cp_r("#{package_root}/bin", "#{Lyp::LYP_DIRECTORY}/bin")
104
118
  end
105
119
 
120
+ def create_wrapper_batch_files
121
+ system32_dir = File.join(ENV["SystemRoot"], "System32")
122
+ bin_dir = "#{Lyp::LYP_DIRECTORY}/bin"
123
+
124
+ %w{lyp lilypond}.each do |name|
125
+ File.open("#{system32_dir}/#{name}.bat", "w+") do |f|
126
+ f << "@#{bin_dir}\\#{name}.bat %*"
127
+ end
128
+ end
129
+ end
130
+
106
131
  def uninstall!
107
132
  puts "\nuninstall self curently not supported on Windows.\n\n"
108
133
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lyp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-02 00:00:00.000000000 Z
11
+ date: 2016-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -97,8 +97,6 @@ files:
97
97
  - bin/install_release.sh
98
98
  - bin/lilypond
99
99
  - bin/lyp
100
- - bin/release_wrapper_lilypond.sh
101
- - bin/release_wrapper_lyp.sh
102
100
  - lib/lyp.rb
103
101
  - lib/lyp/base.rb
104
102
  - lib/lyp/cli.rb
@@ -1,13 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- # Figure out where this script is located.
5
- SELFDIR="`dirname \"$0\"`"
6
- ROOTDIR="`cd \"$SELFDIR/..\" && pwd`"
7
-
8
- # Tell Bundler where the Gemfile and gems are.
9
- export BUNDLE_GEMFILE="$ROOTDIR/lib/vendor/Gemfile"
10
- unset BUNDLE_IGNORE_CONFIG
11
-
12
- # Run the actual app using the bundled Ruby interpreter, with Bundler activated.
13
- exec "$ROOTDIR/lib/ruby/bin/ruby" -rbundler/setup -rreadline -I$ROOTDIR/lib/app/lib "$ROOTDIR/lib/app/bin/lilypond" "$@"
@@ -1,13 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- # Figure out where this script is located.
5
- SELFDIR="`dirname \"$0\"`"
6
- ROOTDIR="`cd \"$SELFDIR/..\" && pwd`"
7
-
8
- # Tell Bundler where the Gemfile and gems are.
9
- export BUNDLE_GEMFILE="$ROOTDIR/lib/vendor/Gemfile"
10
- unset BUNDLE_IGNORE_CONFIG
11
-
12
- # Run the actual app using the bundled Ruby interpreter, with Bundler activated.
13
- exec "$ROOTDIR/lib/ruby/bin/ruby" -rbundler/setup -rreadline -I$ROOTDIR/lib/app/lib "$ROOTDIR/lib/app/bin/lyp" "$@"