Sha256: 339a7a00c8dfd13f54e3965a07af44f637e1e78bc9f17afb2fdd8f032047a06b

Contents?: true

Size: 837 Bytes

Versions: 32

Compression:

Stored size: 837 Bytes

Contents

module Cuboid::OptionGroups

# @author Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
class Report < Cuboid::OptionGroup

    # @return    [String]
    #   Directory or file path where to store the scan report.
    attr_accessor :path

    def initialize
        @default_path = self.path = default_path
    end

    def path=( path )
        return @path = @default_path if !path

        if path.end_with?( '/' ) && !File.exist?( path )
            raise ArgumentError,
                  "Snapshot location does not exist: #{path}"
        end

        path = File.expand_path( path )
        if File.directory? path
            path += '/' if !path.end_with? '/'
        end

        @path = path
    end

    def default_path
        Paths.config['reports']
    end

    def defaults
        { path: default_path }
    end

end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
cuboid-0.1.5 lib/cuboid/option_groups/report.rb
cuboid-0.1.4 lib/cuboid/option_groups/report.rb
cuboid-0.1.3 lib/cuboid/option_groups/report.rb
cuboid-0.1.2 lib/cuboid/option_groups/report.rb
cuboid-0.1.1 lib/cuboid/option_groups/report.rb
cuboid-0.1.0 lib/cuboid/option_groups/report.rb
cuboid-0.0.5 lib/cuboid/option_groups/report.rb
cuboid-0.0.4 lib/cuboid/option_groups/report.rb
cuboid-0.0.3 lib/cuboid/option_groups/report.rb
cuboid-0.0.3alpha lib/cuboid/option_groups/report.rb
cuboid-0.0.2alpha lib/cuboid/option_groups/report.rb
cuboid-0.0.1alpha lib/cuboid/option_groups/report.rb