meskyanichi/backup — Issue #204: Expand path in archive.rb / local.rb
Author: maxmeyer
Created: 2011-10-24 12:19:36+00:00
State: open

Hi there,

what about changing

```ruby @path = path.sub(/^\~\//, "#{ENV['HOME']}/")```

to

```ruby @path = File.expand_path(path)```

at https://github.com/meskyanichi/backup/blob/develop/lib/backup/storage/local.rb#L73 ?

And

```ruby
##
# Adds new paths to the @paths instance variable array
def add(path)
@paths << path
end

##
# Adds new paths to the @excludes instance variable array
def exclude(path)
@excludes << path
end
```

```ruby
##
# Adds new paths to the @paths instance variable array
def add(path)
@paths << File.expand_path(path)
end

##
# Adds new paths to the @excludes instance variable array
def exclude(path)
@excludes << File.expand_path(path)
end
```
at https://github.com/meskyanichi/backup/blob/develop/lib/backup/archive.rb#L36 . I'm not quite sure what to do with relative paths in the configuration file.

/deg