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.2.11 lib/cuboid/option_groups/report.rb
cuboid-0.2.10 lib/cuboid/option_groups/report.rb
cuboid-0.2.9 lib/cuboid/option_groups/report.rb
cuboid-0.2.8 lib/cuboid/option_groups/report.rb
cuboid-0.2.7 lib/cuboid/option_groups/report.rb
cuboid-0.2.6 lib/cuboid/option_groups/report.rb
cuboid-0.2.5 lib/cuboid/option_groups/report.rb
cuboid-0.2.4.2 lib/cuboid/option_groups/report.rb
cuboid-0.2.4.1 lib/cuboid/option_groups/report.rb
cuboid-0.2.4 lib/cuboid/option_groups/report.rb
cuboid-0.2.3 lib/cuboid/option_groups/report.rb
cuboid-0.2.2 lib/cuboid/option_groups/report.rb
cuboid-0.2.1 lib/cuboid/option_groups/report.rb
cuboid-0.2 lib/cuboid/option_groups/report.rb
cuboid-0.1.9.1 lib/cuboid/option_groups/report.rb
cuboid-0.1.9 lib/cuboid/option_groups/report.rb
cuboid-0.1.8 lib/cuboid/option_groups/report.rb
cuboid-0.1.7 lib/cuboid/option_groups/report.rb
cuboid-0.1.6.1 lib/cuboid/option_groups/report.rb
cuboid-0.1.6 lib/cuboid/option_groups/report.rb