Skip to content

Commit

Permalink
binding ruby: Store permission information
Browse files Browse the repository at this point in the history
Milter::Manager::MilterGreylistConfigParser#parse parses configuration
file generally, and it should not drop any information of spec etc.
  • Loading branch information
okkez committed Jun 28, 2013
1 parent e01175e commit 18b7471
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions binding/ruby/lib/milter/manager/milter-greylist-config-parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ def initialize
end

def socket
@variables["socket"]
if @variables["socket"].is_a?(Array)
@variables["socket"].first
else
@variables["socket"]
end
end

def parse(conf_file)
Expand All @@ -41,8 +45,8 @@ def parse(conf_file)
@data_acls << $POSTMATCH
when /\A\s*([\w_]+)\s+"(.+?)"\s*\z/
@variables[$1] = $2
when /\A\s*([\w_]+)\s+"(.+?)"\s*\d+\z/
@variables[$1] = $2
when /\A\s*([\w_]+)\s+"(.+?)"\s*(\d+)\z/
@variables[$1] = [$2, $3.to_i]
when /\A\s*([\w_]+)\s+/
@variables[$1] = $POSTMATCH
end
Expand Down

0 comments on commit 18b7471

Please sign in to comment.