dmg 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +12 -0
- data/lib/dmg/pkg.rb +5 -5
- data/lib/dmg/pkgs.yml +1 -0
- data/lib/dmg/version.rb +1 -1
- metadata +4 -3
data/README.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# dmg - Package manager for .dmg files
|
2
|
+
|
3
|
+
## Usage
|
4
|
+
|
5
|
+
* dmg list: lists the dmgs available for install
|
6
|
+
* dmg install PACKAGE: install the dmg
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
dmg install chrome skype picasa
|
11
|
+
|
12
|
+
Would download and install chrome, skype and... picasa!
|
data/lib/dmg/pkg.rb
CHANGED
@@ -30,7 +30,7 @@ module DMG
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def install!
|
33
|
-
dmg_file = "
|
33
|
+
dmg_file = "#{ENV['HOME']}/Downloads/#{package}.dmg"
|
34
34
|
destination = '/Applications'
|
35
35
|
|
36
36
|
if "hdiutil info"[/image-path.*#{dmg_file}/]
|
@@ -38,11 +38,11 @@ module DMG
|
|
38
38
|
return
|
39
39
|
end
|
40
40
|
|
41
|
-
run_cmd
|
42
|
-
run_cmd
|
43
|
-
run_cmd "sudo cp -
|
41
|
+
run_cmd "curl -L #{url} -o '#{dmg_file}'" unless File.exist?(dmg_file)
|
42
|
+
run_cmd "hdid '#{dmg_file}'"
|
43
|
+
run_cmd "sudo cp -fr '/Volumes/#{volume_dir}/#{package}.app' '#{destination}'"
|
44
44
|
run_cmd "hdiutil detach '/Volumes/#{volume_dir}'"
|
45
|
-
run_cmd
|
45
|
+
run_cmd "sudo chmod 755 '#{destination}/#{package}.app/Contents/MacOS/#{package}'"
|
46
46
|
end
|
47
47
|
|
48
48
|
protected
|
data/lib/dmg/pkgs.yml
CHANGED
data/lib/dmg/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dmg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Philippe Creux
|
@@ -31,6 +31,7 @@ extra_rdoc_files: []
|
|
31
31
|
files:
|
32
32
|
- .gitignore
|
33
33
|
- Gemfile
|
34
|
+
- README.md
|
34
35
|
- Rakefile
|
35
36
|
- bin/dmg
|
36
37
|
- dmg.gemspec
|