appify 0.2.2
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 +7 -0
- data/lib/appify.rb +75 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 191234351d21f0887b13cb259e8cad9416de3675
|
4
|
+
data.tar.gz: f34f8ad88ecae5c6d6754a7b3ed41dba102a190b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9bb3b21730195fe9c0a1f21395aed7d90c40a356cc52f6c51c17185c5730ce054541209c993aaedbcbeb540a70827cf8152ed7269b010163ce17036c6b44bd57
|
7
|
+
data.tar.gz: 1dab5bfd39f856fa0691a133707bc67bffe3dbd5f9bff972dafa3be89232d40d8de07b50e265ec5b27f25d189772cdf6c770412f1b8abb92462fe4541ad2f742
|
data/lib/appify.rb
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
## Appify <https://rubygems.org/gems/appify>
|
2
|
+
#
|
3
|
+
# Inspired (and ported, somewhat, from) Adam Backstrom's appify.sh
|
4
|
+
# (http://git.abackstrom.com/appify.git)
|
5
|
+
#
|
6
|
+
# See gemspec for authors and other info.
|
7
|
+
# Released in the Public Domain.
|
8
|
+
#
|
9
|
+
# If such release isn't possible in your legislation,
|
10
|
+
# this is licensed under the Unlicense: http://unlicense.org
|
11
|
+
#
|
12
|
+
|
13
|
+
require 'pathname'
|
14
|
+
|
15
|
+
module Appify
|
16
|
+
class App
|
17
|
+
def initialize
|
18
|
+
end
|
19
|
+
|
20
|
+
def run; @run; end
|
21
|
+
def run=(cont)
|
22
|
+
raise Appify::FileTooShortError.new if cont.length < 28
|
23
|
+
@run = cont
|
24
|
+
end
|
25
|
+
def runfile=(file)
|
26
|
+
file = Pathname.new(file) unless file.is_a? Pathname
|
27
|
+
raise Appify::FileTooShortError.new if file.size < 28
|
28
|
+
@run = file.read
|
29
|
+
end
|
30
|
+
|
31
|
+
def write(path)
|
32
|
+
path = Pathname.new(path) unless path.is_a? Pathname
|
33
|
+
path.rmtree if path.exist?
|
34
|
+
path.mkpath
|
35
|
+
|
36
|
+
runfl = path.join "Contents", "MacOS", "run.sh"
|
37
|
+
infop = path.join "Contents", "Info.plist"
|
38
|
+
resrc = path.join "Contents", "Resources"
|
39
|
+
runfl.dirname.mkpath
|
40
|
+
resrc.mkpath
|
41
|
+
|
42
|
+
IO.write infop, Appify.info
|
43
|
+
IO.write runfl, @run
|
44
|
+
runfl.chmod 0755
|
45
|
+
|
46
|
+
return path
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.info
|
51
|
+
<<-PLIST
|
52
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
53
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
54
|
+
<plist version="1.0">
|
55
|
+
<dict>
|
56
|
+
<key>CFBundleExecutable</key>
|
57
|
+
<string>run.sh</string>
|
58
|
+
<key>CFBundleIconFile</key>
|
59
|
+
<string></string>
|
60
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
61
|
+
<string>1.0</string>
|
62
|
+
<key>CFBundlePackageType</key>
|
63
|
+
<string>APPL</string>
|
64
|
+
<key>CFBundleSignature</key>
|
65
|
+
<string>????</string>
|
66
|
+
<key>CFBundleVersion</key>
|
67
|
+
<string>1.0</string>
|
68
|
+
</dict>
|
69
|
+
</plist>
|
70
|
+
PLIST
|
71
|
+
end
|
72
|
+
|
73
|
+
class FileTooShortError < RuntimeError
|
74
|
+
end
|
75
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: appify
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Félix Saparelli
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-02-19 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: 'Port of Adam Backstrom''s appify: turns shell scripts into Mac OS X
|
14
|
+
applications. Unmaintained'
|
15
|
+
email: gems@passcod.name
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/appify.rb
|
21
|
+
homepage: https://rubygems.org/gems/appify
|
22
|
+
licenses: []
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.0.3
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: Minimal utility to create OS X applications
|
44
|
+
test_files: []
|