Fix constant resolution in layout CLI option

This commit is contained in:
Thibault Jouan 2015-04-18 19:53:23 +00:00
parent 68cec67402
commit 20cdec5fce
2 changed files with 5 additions and 1 deletions

View File

@ -9,3 +9,7 @@ Feature: layout CLI option
"""
When I run uhwm with option -v -r./layout -l MyLayout
Then the output must match /layout.+mylayout/i
Scenario: resolves layout class from the root namespace
When I run uhwm with option -v -l Layout
Then the output must contain "uninitialized constant Layout"

View File

@ -68,7 +68,7 @@ module Uh
log "Loaded `#{feature}' ruby feature"
end
opts.on '-l', '--layout LAYOUT', 'specify layout' do |layout|
@env.layout_class = self.class.const_get layout.to_sym
@env.layout_class = Object.const_get layout.to_sym
end
opts.on '-w', Workers.types, '--worker WORKER',
'specify worker' do |worker|