localport 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -100,7 +100,7 @@ module LocalPort
100
100
  paths.each do |path|
101
101
  bins = Dir[sanitize(path) + "/bin/*", sanitize(path) + "/sbin/*"]
102
102
  symlinks(bins).each {|bin, link|
103
- File.symlink(bin, link) unless File.exist? link
103
+ create_symlink_safely(bin, link)
104
104
  }
105
105
  end
106
106
  end
@@ -188,8 +188,8 @@ module LocalPort
188
188
  def create_symlink(app, ver)
189
189
  srcs = config.installed[app][ver]
190
190
  srcs.each do |src|
191
- new = src.gsub(/-?#{ver}/, '')
192
- File.symlink(src, new) unless File.exist? new
191
+ link = src.gsub(/-?#{ver}/, '')
192
+ create_symlink_safely(src, link)
193
193
  end
194
194
  end
195
195
 
@@ -202,6 +202,14 @@ module LocalPort
202
202
  }
203
203
  end
204
204
 
205
+ def create_symlink_safely(src, target)
206
+ begin
207
+ File.symlink(src, target) unless File.exist? target
208
+ rescue => e
209
+ puts "[#{target}] is maybe broken."
210
+ end
211
+ end
212
+
205
213
  def sanitize(path)
206
214
  # pathの最後から'/'を取り除く
207
215
  raise ArgumentError, "#{path} does not exist." unless File.exist? path
data/localport.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "localport"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["yoppi"]
12
- s.date = "2012-06-29"
12
+ s.date = "2012-11-01"
13
13
  s.description = "localport is a local application management system"
14
14
  s.email = "y.hirokazu@gmail.com"
15
15
  s.executables = ["localport"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: localport
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-29 00:00:00.000000000 Z
12
+ date: 2012-11-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: highline
@@ -127,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
127
  version: '0'
128
128
  segments:
129
129
  - 0
130
- hash: -1437586738279535089
130
+ hash: 3927948051710791612
131
131
  required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  none: false
133
133
  requirements: