Sha256: a371733672f27c45c5b414d856242463483a490857b41be1741da58349bffcb9

Contents?: true

Size: 782 Bytes

Versions: 103

Compression:

Stored size: 782 Bytes

Contents

module MinimumViableProduct
  module Iteration
    CONFIG_FILE = File.join(Rails.root, '.iteration')

    class << self
      def write(json)
        _file = File.open( CONFIG_FILE, "w+" )
        _file.write(JSON.pretty_generate(json))
        _file.close

        @config = json
      end

      def read
        @config ||= begin
                      JSON.parse( IO.read(CONFIG_FILE), symbolize_names: false )
                    rescue
                      write({'version' => '0.0.1'})
                    end
      end

      def bump!(bump)
        config = read
        config['version'] = Semantic::Version.new(config['version']).increment!(bump.downcase.to_sym).to_s
        write(config)
      end

      def version
        read["version"]
      end
    end
  end
end

Version data entries

103 entries across 102 versions & 3 rubygems

Version Path
minimum_viable_product-0.0.26 config/initializers/iteration.rb
minimum_viable_product-0.0.25 config/initializers/iteration.rb
minimum_viable_product-0.0.24 config/initializers/iteration.rb
minimum_viable_product-0.0.23 config/initializers/iteration.rb
minimum_viable_product-0.0.22 config/initializers/iteration.rb
minimum_viable_product-0.0.21 config/initializers/iteration.rb
minimum_viable_product-0.0.20 config/initializers/iteration.rb
minimum_viable_product-0.0.19 config/initializers/iteration.rb
minimum_viable_product-0.0.18 config/initializers/iteration.rb
minimum_viable_product-0.0.17 config/initializers/iteration.rb
minimum_viable_product-0.0.16 config/initializers/iteration.rb
minimum_viable_product-0.0.15 config/initializers/iteration.rb
minimum_viable_product-0.0.14 config/initializers/iteration.rb
minimum_viable_product-0.0.13 config/initializers/iteration.rb
minimum_viable_product-0.0.11 test/dummy/node_modules/minimum_viable_product/config/initializers/iteration.rb
minimum_viable_product-0.0.11 config/initializers/iteration.rb
minimum_viable_product-0.0.10 config/initializers/iteration.rb
minimum_viable_product-0.0.9 config/initializers/iteration.rb
minimum_viable_product-0.0.8 config/initializers/iteration.rb
minimum-viable-product-0.0.7 config/initializers/iteration.rb