fig 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/fig/environment.rb +1 -1
  2. data/lib/fig/os.rb +5 -8
  3. metadata +3 -3
@@ -114,7 +114,7 @@ module Fig
114
114
 
115
115
  # Replace @ symbol with the package's directory
116
116
  def expand_value(base_package, name, value)
117
- return value if base_package.nil?
117
+ return value unless base_package && base_package.package_name
118
118
  file = value.gsub(/\@/, base_package.directory)
119
119
  if @retrieve_vars.member?(name)
120
120
  target = File.join(@retrieve_vars[name].gsub(/\[package\]/, base_package.package_name), File.basename(file))
data/lib/fig/os.rb CHANGED
@@ -38,16 +38,13 @@ module Fig
38
38
  when "ftp"
39
39
  ftp = Net::FTP.new(uri.host)
40
40
  ftp.login
41
- dirs = []
42
- ftp.list("-1 " + uri.path) do |line|
43
- dirs << line
44
- end
41
+ ftp.chdir(uri.path)
45
42
  packages = []
46
- dirs.each do |dir|
47
- ftp.list("-1 #{uri.path}/#{dir}") do |line|
48
- packages << "#{dir}/#{line}"
49
- end
43
+ ftp.retrlines('LIST -R .') do |line|
44
+ parts = line.gsub(/\\/, '/').sub(/^\.\//, '').sub(/:$/, '').split('/')
45
+ packages << parts.join('/') if parts.size == 2
50
46
  end
47
+ ftp.close
51
48
  packages
52
49
  else
53
50
  raise "Protocol not supported: #{url}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Foemmel
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-27 00:00:00 -06:00
12
+ date: 2010-02-09 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -104,5 +104,5 @@ signing_key:
104
104
  specification_version: 3
105
105
  summary: Fig is a utility for configuring environments and managing dependencies across a team of developers..
106
106
  test_files:
107
- - spec/fig_spec.rb
108
107
  - spec/spec_helper.rb
108
+ - spec/fig_spec.rb