lib/sshp/alias.rb in sshp-0.0.1 vs lib/sshp/alias.rb in sshp-0.0.2
- old
+ new
@@ -6,11 +6,11 @@
all[name] = args
save
end
def self.all
- @all ||= YAML.load File.open filename, "r"
+ @all ||= YAML.load(File.open filename, "r")["aliases"]
rescue Errno::ENOENT
@all = {}
end
private
@@ -18,10 +18,10 @@
def self.filename
File.join Dir.home, ".sshp"
end
def self.save
- File.open(filename, "w") { |f| f.write all.to_yaml }
+ File.open(filename, "w") { |f| f.write ({ "aliases" => all }).to_yaml }
end
end
end