Sha256: bafbb56d20af9d2254cf64c3fcec1a6654a294bdaa186ac948e7b0905a5152b9

Contents?: true

Size: 724 Bytes

Versions: 9

Compression:

Stored size: 724 Bytes

Contents

# frozen_string_literal: true

module Dopstick
  module Generator
    module Gem
      class Options < Generator::Options
        def bin?
          !@options[:bin].empty?
        end

        def active_record?
          @options[:active_record]
        end

        def namespace_names
          @namespace_names ||= @options[:namespace].split("::")
        end

        def namespace_size
          @namespace_size ||= namespace_names.size
        end

        def oldest_ruby_version
          version = ruby_versions
                    .map {|v| ::Gem::Version.new(v) }
                    .min
                    .canonical_segments

          [*version, 0].take(3).join(".")
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dopstick-0.0.12 lib/dopstick/generator/gem/options.rb
dopstick-0.0.11 lib/dopstick/generator/gem/options.rb
dopstick-0.0.10 lib/dopstick/generator/gem/options.rb
dopstick-0.0.9 lib/dopstick/generator/gem/options.rb
dopstick-0.0.8 lib/dopstick/generator/gem/options.rb
dopstick-0.0.7 lib/dopstick/generator/gem/options.rb
dopstick-0.0.6 lib/dopstick/generator/gem/options.rb
dopstick-0.0.5 lib/dopstick/generator/gem/options.rb
dopstick-0.0.4 lib/dopstick/generator/gem/options.rb