diff options
| author | James Turnbull <james@lovedthanlost.net> | 2009-02-26 11:43:39 +1100 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-02-26 11:43:39 +1100 |
| commit | 5f73eb553fd083b558fb9553b0c07b6019d0ccee (patch) | |
| tree | 123ef2a9c7b8aa4e1cd52e6b98d0b3c53d626de6 /lib/puppet/file_serving | |
| parent | e40aea3c655e698d26c29370227b52c489e6db2b (diff) | |
| download | puppet-5f73eb553fd083b558fb9553b0c07b6019d0ccee.tar.gz puppet-5f73eb553fd083b558fb9553b0c07b6019d0ccee.tar.xz puppet-5f73eb553fd083b558fb9553b0c07b6019d0ccee.zip | |
Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with semicolons
Diffstat (limited to 'lib/puppet/file_serving')
| -rw-r--r-- | lib/puppet/file_serving/configuration/parser.rb | 14 | ||||
| -rw-r--r-- | lib/puppet/file_serving/metadata.rb | 10 |
2 files changed, 12 insertions, 12 deletions
diff --git a/lib/puppet/file_serving/configuration/parser.rb b/lib/puppet/file_serving/configuration/parser.rb index f36bef639..c86e00a62 100644 --- a/lib/puppet/file_serving/configuration/parser.rb +++ b/lib/puppet/file_serving/configuration/parser.rb @@ -20,20 +20,20 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile @count += 1 case line - when /^\s*#/: next # skip comments - when /^\s*$/: next # skip blank lines - when /\[([-\w]+)\]/: + when /^\s*#/; next # skip comments + when /^\s*$/; next # skip blank lines + when /\[([-\w]+)\]/ mount = newmount($1) - when /^\s*(\w+)\s+(.+)$/: + when /^\s*(\w+)\s+(.+)$/ var = $1 value = $2 raise(ArgumentError, "Fileserver configuration file does not use '=' as a separator") if value =~ /^=/ case var - when "path": + when "path" path(mount, value) - when "allow": + when "allow" allow(mount, value) - when "deny": + when "deny" deny(mount, value) else raise ArgumentError.new("Invalid argument '%s'" % var, diff --git a/lib/puppet/file_serving/metadata.rb b/lib/puppet/file_serving/metadata.rb index 1fc2b40ab..335dad497 100644 --- a/lib/puppet/file_serving/metadata.rb +++ b/lib/puppet/file_serving/metadata.rb @@ -29,8 +29,8 @@ class Puppet::FileServing::Metadata < Puppet::FileServing::Base } case ftype - when "file", "directory": desc << checksum - when "link": desc << @destination + when "file", "directory"; desc << checksum + when "link"; desc << @destination else raise ArgumentError, "Cannot manage files of type %s" % ftype end @@ -59,12 +59,12 @@ class Puppet::FileServing::Metadata < Puppet::FileServing::Base @mode = stat.mode & 007777 case stat.ftype - when "file": + when "file" @checksum = ("{%s}" % @checksum_type) + send("%s_file" % @checksum_type, real_path).to_s - when "directory": # Always just timestamp the directory. + when "directory" # Always just timestamp the directory. @checksum_type = "ctime" @checksum = ("{%s}" % @checksum_type) + send("%s_file" % @checksum_type, path).to_s - when "link": + when "link" @destination = File.readlink(real_path) else raise ArgumentError, "Cannot manage files of type %s" % stat.ftype |
