diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-01-16 22:29:23 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2013-01-16 22:29:23 +0100 |
commit | b1a39eda9fb6567cbad72d3d1cbec1d97287759b (patch) | |
tree | 01d739fb635cc948369587765fa1badde5a08b89 /lib | |
parent | 8b1bf6ea29a358332a0c90f07f9aa789b0a5645c (diff) | |
download | zorglub-b1a39eda9fb6567cbad72d3d1cbec1d97287759b.zip zorglub-b1a39eda9fb6567cbad72d3d1cbec1d97287759b.tar.gz |
coding style
Diffstat (limited to 'lib')
-rw-r--r-- | lib/zorglub/node.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb index e204326..37f812c 100644 --- a/lib/zorglub/node.rb +++ b/lib/zorglub/node.rb @@ -97,7 +97,7 @@ module Zorglub end # def ext - @options[:ext]||'' + @options[:ext] || '' end # # class level basic node functions @@ -167,7 +167,7 @@ module Zorglub attr_reader :cli_vals # def cli_val sym, *args - vals = @cli_vals[sym] ||=[] + vals = @cli_vals[sym] ||= [] unless args.empty? vals.concat args vals.uniq! @@ -178,7 +178,7 @@ module Zorglub end # def cli_val sym, *args - vals = @cli_vals[sym] ||=[] + vals = @cli_vals[sym] ||= [] unless args.empty? vals.concat args vals.uniq! @@ -217,15 +217,15 @@ module Zorglub class << self # def inherited sub - sub.engine! engine||(self==Zorglub::Node ? UNDEFINED : nil ) - sub.layout! layout||(self==Zorglub::Node ? UNDEFINED : nil ) + sub.engine! ( engine || (self==Zorglub::Node ? UNDEFINED : nil ) ) + sub.layout! ( layout || (self==Zorglub::Node ? UNDEFINED : nil ) ) sub.instance_variable_set :@cli_vals, {} @cli_vals.each do |s,v| sub.cli_val s, *v end end # def call env meth, *args = env['PATH_INFO'].sub(/^\//,'').split(/\//) - meth||= 'index' + meth ||= 'index' puts "=> #{meth}(#{args.join ','})" if app.opt :debug node = self.new env, {:method=>meth,:args=>args} return error_404 node if not node.respond_to? meth @@ -270,7 +270,7 @@ module Zorglub catch(:stop_realize) { feed! response.write @content - response.header['Content-Type'] = @mime||'text/html' + response.header['Content-Type'] = ( @mime || 'text/html' ) response.finish response } |