diff options
| author | Zack Hobson | 2013-11-21 15:57:17 -0800 | 
|---|---|---|
| committer | Zack Hobson | 2013-11-21 15:57:17 -0800 | 
| commit | c32bdade26fbf53587e9f8ccc67c5f22c6d45b80 (patch) | |
| tree | 296876acf2addbb6e29dafc9e57826c74734de5d /lib | |
| parent | 88fbc92940d628b4b7d9a7b37826beecd43b3f22 (diff) | |
| download | hcl-c32bdade26fbf53587e9f8ccc67c5f22c6d45b80.tar.bz2 | |
app: add option to force auth refresh
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/hcl/app.rb | 10 | ||||
| -rw-r--r-- | lib/hcl/timesheet_resource.rb | 2 | 
2 files changed, 6 insertions, 6 deletions
| diff --git a/lib/hcl/app.rb b/lib/hcl/app.rb index 4ff63d5..ac1b992 100644 --- a/lib/hcl/app.rb +++ b/lib/hcl/app.rb @@ -15,8 +15,8 @@ module HCl      OLD_SETTINGS_FILE = "#{ENV['HOME']}/.hcl_settings"      OLD_CONFIG_FILE = "#{ENV['HOME']}/.hcl_config" -    def configure -      FileUtils.mkdir_p(File.join(ENV['HOME'], ".hcl")) +    def initialize +      FileUtils.mkdir_p(HCL_DIR)        read_config        read_settings        self @@ -24,7 +24,7 @@ module HCl      # Run the given command and arguments.      def self.command *args -      new.configure.process_args(*args).run +      new.process_args(*args).run      end      # Return true if the string is a known command, false otherwise. @@ -37,6 +37,7 @@ module HCl      # Start the application.      def run +      request_config if @options[:reauth]        begin          if @command            if command? @command @@ -71,7 +72,7 @@ module HCl      end      def process_args *args -      Trollop::options(args) do +      @options = Trollop::options(args) do          stop_on Commands.instance_methods          version "HCl version #{VERSION}"          banner <<-EOM @@ -119,6 +120,7 @@ Examples:  Options:  EOM +        opt :reauth, "Force refresh of auth details"        end        @command = args.shift        @args = args diff --git a/lib/hcl/timesheet_resource.rb b/lib/hcl/timesheet_resource.rb index 7ab99ec..69eeb75 100644 --- a/lib/hcl/timesheet_resource.rb +++ b/lib/hcl/timesheet_resource.rb @@ -24,8 +24,6 @@ module HCl          self.password = opts['password']          self.subdomain = opts['subdomain']          self.ssl = opts['ssl'] -      else -        yield self        end      end | 
