Sha256: 7cac0758651078555944726f05b3c9316d1b2e74bc7f4783add522dc76c160a1

Contents?: true

Size: 576 Bytes

Versions: 21

Compression:

Stored size: 576 Bytes

Contents

module Dradis
  module Plugins
    # Helper methods for plugin Thor tasks
    module ThorHelper
      attr_accessor :task_options, :logger

      def detect_and_set_project_scope
        task_options[:project_id] = Project.new.id
      end

      def task_options
        @task_options ||= { logger: logger }
      end

      def logger
        @logger ||= default_logger
      end


      private
      def default_logger
        STDOUT.sync   = true
        logger        = Logger.new(STDOUT)
        logger.level  = Logger::DEBUG
        logger
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
dradis-plugins-4.7.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-4.6.1 lib/dradis/plugins/thor_helper.rb
dradis-plugins-4.5.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-4.4.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-4.3.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-4.2.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-4.1.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-4.0.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-3.22.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-3.21.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-3.20.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-3.19.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-3.18.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-3.17.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-3.16.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-3.15.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-3.14.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-3.13.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-3.12.0 lib/dradis/plugins/thor_helper.rb
dradis-plugins-3.11.0 lib/dradis/plugins/thor_helper.rb