sega 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +29 -7
- data/example/hello-sega/hello-sega.gemspec +1 -1
- data/lib/sega/installer.erb +7 -1
- data/lib/sega/version.rb +1 -1
- metadata +2 -4
- data/example/hello-sega/.gitignore +0 -9
- data/example/hello-sega/.travis.yml +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7f6e5ce243fa2dde3b387471babb374e9c84683
|
4
|
+
data.tar.gz: 8537c40a19d1f5d02314d59360da727c891fe8d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 303730eb835c13f9b2039bf3db55b6b7724de8b774df5f90f6c5d0463d79773d7d27f76b7f140ac4b2b7c2e97b420dc1ba2b5edbcdbe651d8bad748e975e217f
|
7
|
+
data.tar.gz: 65d6459f3d5eb970352f762e26d6a93fff3dbe514dd97b4c32603a18217c467df2d331d646ec0e2a471b6c156604046af3b5ddc00155a9d29b4206807ea52868
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,19 +1,30 @@
|
|
1
1
|
# SEGA - Self-Extracting Gem Archive
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/sega.svg)](https://badge.fury.io/rb/sega)
|
4
|
+
|
3
5
|
This is a tool that will help you create a self-extracting gem (cli) archive.
|
4
6
|
|
7
|
+
The executable archive will contain a small installer, the gem, and cached dependencies. The executable will unzip itself and place the bundled gem in a target directory (default: /usr/local/<project>) and create shim scripts for files specified in the gemspec bindir. The shim will use rbenv (if possible) so the proper ruby version is used and then run the gem cli within the context of bundler so that the proper dependencies are used.
|
8
|
+
|
5
9
|
Similar in concept to [traveling-ruby](https://github.com/phusion/traveling-ruby) or [orca](https://github.com/larsch/ocra) or [releasy](https://github.com/Spooner/releasy) but it makes some basic assumptions to simplify the package.
|
6
10
|
|
11
|
+
|
12
|
+
**Assumes:**
|
13
|
+
* target machine has **ruby** (preferably [rbenv](https://github.com/rbenv/rbenv))
|
14
|
+
* target machine has **[bundler](http://bundler.io/)**
|
15
|
+
|
16
|
+
|
7
17
|
For example:
|
8
18
|
|
9
19
|
```
|
10
|
-
# create new gem
|
20
|
+
# create new cli gem
|
11
21
|
# create exe/<whatever>
|
12
22
|
# git add -A
|
13
23
|
|
14
24
|
$ $EDITOR Gemfile
|
15
25
|
|
16
|
-
## Add
|
26
|
+
## Add these lines:
|
27
|
+
|
17
28
|
require 'sega/rake_task'
|
18
29
|
|
19
30
|
Sega::RakeTask.new() do |t|
|
@@ -23,23 +34,34 @@ end
|
|
23
34
|
|
24
35
|
|
25
36
|
$ bundle install
|
37
|
+
Resolving dependencies...
|
38
|
+
Using rake 10.5.0
|
39
|
+
Using bundler 1.10.6
|
40
|
+
Using hello-sega 0.1.0 from source at .
|
41
|
+
Using sega 0.1.2
|
42
|
+
Updating files in vendor/cache
|
43
|
+
Bundle complete! 4 Gemfile dependencies, 4 gems now installed.
|
44
|
+
Use `bundle show [gemname]` to see where a bundled gem is installed.
|
26
45
|
|
27
46
|
$ bundle exec rake sega:package
|
28
47
|
Using rake 10.5.0
|
29
48
|
Using bundler 1.10.6
|
30
49
|
Using hello-sega 0.1.0 from source at .
|
31
|
-
Using sega 0.1.
|
50
|
+
Using sega 0.1.2
|
32
51
|
Updating files in vendor/cache
|
33
52
|
Bundle complete! 4 Gemfile dependencies, 4 gems now installed.
|
34
53
|
Use `bundle show [gemname]` to see where a bundled gem is installed.
|
35
54
|
Updating files in vendor/cache
|
36
55
|
Created Self-Extracting Gem Archive: hello-sega.run
|
37
|
-
```
|
38
56
|
|
57
|
+
$ ./hello-sega.run
|
58
|
+
created target shim: /usr/local/bin/hello-sega
|
59
|
+
|
60
|
+
$ hello-sega
|
61
|
+
Hello SEGA!
|
62
|
+
```
|
63
|
+
See [Example Code](example/hello-sega)
|
39
64
|
|
40
|
-
Assumes:
|
41
|
-
* target machine has ruby (preferably [rbenv](https://github.com/rbenv/rbenv))
|
42
|
-
* target machine has [bundler](http://bundler.io/)
|
43
65
|
|
44
66
|
## Installation
|
45
67
|
|
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "hello-sega"
|
8
8
|
spec.version = Hello::Sega::VERSION
|
9
9
|
spec.authors = ["jdamick"]
|
10
|
-
spec.email = ["
|
10
|
+
spec.email = ["@jeffreydamick"]
|
11
11
|
|
12
12
|
spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
|
13
13
|
spec.description = %q{TODO: Write a longer description or delete this line.}
|
data/lib/sega/installer.erb
CHANGED
@@ -18,7 +18,13 @@ unless Gem::Dependency.new('ruby', REQUESTED_RUBY_VERSION).match?('ruby', RUBY_V
|
|
18
18
|
"Try rbenv: https://github.com/rbenv/rbenv#installation\n\n"
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
bundlers = Gem::Specification.find_all { |s| s.name =~ /bundler/ && Gem::Requirement.new(REQUESTED_BUNDLER_VERSION) =~ s.version }
|
22
|
+
if bundlers.empty?
|
23
|
+
raise "\n\n[ERROR] Bundler version needs to be atleast: #{REQUESTED_BUNDLER_VERSION}\n" +
|
24
|
+
"Try rbenv: https://github.com/rbenv/rbenv#installation\n\n"
|
25
|
+
end
|
26
|
+
|
27
|
+
BUNDLER_VER_ARG = "_#{bundlers.first.version.to_s}_"
|
22
28
|
bundle_cmd = "bundle #{BUNDLER_VER_ARG}"
|
23
29
|
|
24
30
|
`#{bundle_cmd} -v`
|
data/lib/sega/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sega
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jdamick
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -138,8 +138,6 @@ files:
|
|
138
138
|
- Rakefile
|
139
139
|
- bin/console
|
140
140
|
- bin/setup
|
141
|
-
- example/hello-sega/.gitignore
|
142
|
-
- example/hello-sega/.travis.yml
|
143
141
|
- example/hello-sega/Gemfile
|
144
142
|
- example/hello-sega/README.md
|
145
143
|
- example/hello-sega/Rakefile
|