lyp-win 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e98a618ed6bc2fd2168aa288e5ab0f0228b04de9
4
- data.tar.gz: ce18add67cbbe485000918a16f97ab843d3aa46c
3
+ metadata.gz: c4216c898f07269d33f47f9ff0c7d5bad011614b
4
+ data.tar.gz: 1755ffdc43af54a1407762f147105c7efb1710b6
5
5
  SHA512:
6
- metadata.gz: a9b35eb5a49c493c8b198b1f1bcf202dd037b1ef4ae0c41c10d8d61bb7c1bb911b7a737e50211bdcdac034251360b4bfc5252b2c8e5ec38cf086d0de156b249d
7
- data.tar.gz: 5a490c2c2234b969f38a55206560a2c6283ca31070e03b8dbf052efa3f6603ecfefe30772b61d7105d278bf8022ac8cdc9957e914440429b7deda7dfd9ac7781
6
+ metadata.gz: 9589424fd91f83e2d031314a244e93398d7076cbec43d53607a17fc60db0e748f3b9e2cc7c693d4c5ac222714322558a16778e5568c4c70fb7aa2caa28fb3dd0
7
+ data.tar.gz: dc3963faed5f6dc407ac57d7885010d51c86573bf6c8334bcd9aeedf5905884ca23dd53c33423478cf07c95a2dea8d4a8d2688c0efcbd96fdc467e25756444a3
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`
data/bin/lilypond CHANGED
@@ -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'
data/lib/lyp/system.rb CHANGED
@@ -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')
data/lib/lyp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lyp
2
- VERSION = "0.2.3"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/lyp/windows.rb CHANGED
@@ -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-win
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
@@ -83,8 +83,6 @@ files:
83
83
  - bin/install_release.sh
84
84
  - bin/lilypond
85
85
  - bin/lyp
86
- - bin/release_wrapper_lilypond.sh
87
- - bin/release_wrapper_lyp.sh
88
86
  - lib/lyp.rb
89
87
  - lib/lyp/base.rb
90
88
  - 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" "$@"