From e9de59b37bbd56a40f4597ecd74ac705742ce0dd Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Tue, 14 Apr 2015 00:36:24 +0000 Subject: [PATCH] Manage run control file path in Env --- lib/uh/wm/env.rb | 7 +++++-- spec/uh/wm/env_spec.rb | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/uh/wm/env.rb b/lib/uh/wm/env.rb index 029ab97..3c14d9b 100644 --- a/lib/uh/wm/env.rb +++ b/lib/uh/wm/env.rb @@ -1,6 +1,8 @@ module Uh module WM class Env + RC_PATH = '~/.uhwmrc.rb'.freeze + LOGGER_LEVEL = Logger::WARN LOGGER_LEVEL_VERBOSE = Logger::INFO LOGGER_LEVEL_DEBUG = Logger::DEBUG @@ -12,10 +14,11 @@ module Uh def_delegator :@output, :print attr_reader :output - attr_accessor :verbose, :debug, :layout_class + attr_accessor :verbose, :debug, :rc_path, :layout_class def initialize output - @output = output + @output = output + @rc_path = RC_PATH end def verbose? diff --git a/spec/uh/wm/env_spec.rb b/spec/uh/wm/env_spec.rb index 77cf3f3..e5280c6 100644 --- a/spec/uh/wm/env_spec.rb +++ b/spec/uh/wm/env_spec.rb @@ -13,6 +13,10 @@ module Uh expect(env).not_to be_debug end + it 'has the default rc path set' do + expect(env.rc_path).to eq '~/.uhwmrc.rb' + end + it 'has no layout_class set' do expect(env.layout_class).not_to be end