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 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 = "~/Downloads/#{package}.dmg"
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("curl -L #{url} -o #{dmg_file}")
42
- run_cmd("hdid #{dmg_file}")
43
- run_cmd "sudo cp -r '/Volumes/#{volume_dir}/#{package}.app' #{destination}"
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("sudo chmod 755 #{destination}/#{package}.app/Contents/MacOS/#{package}")
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
@@ -21,6 +21,7 @@ macirssi:
21
21
 
22
22
  picasa:
23
23
  package: Picasa
24
+ volume_dir: Picasa 3.8.9
24
25
  url: http://dl.google.com/photos/picasamac38.dmg
25
26
 
26
27
  adium:
data/lib/dmg/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dmg
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
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