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
mvpkit-2.0.2 config/initializers/iteration.rb
mvpkit-2.0.1 config/initializers/iteration.rb
mvpkit-2.0.0 config/initializers/iteration.rb
mvpkit-1.1.2 config/initializers/iteration.rb
mvpkit-1.1.1 config/initializers/iteration.rb
mvpkit-1.1.0 config/initializers/iteration.rb
mvpkit-1.0.4 config/initializers/iteration.rb
mvpkit-1.0.3 config/initializers/iteration.rb
mvpkit-1.0.2 config/initializers/iteration.rb
mvpkit-1.0.1 config/initializers/iteration.rb
mvpkit-1.0.0 config/initializers/iteration.rb
mvpkit-0.8.1 config/initializers/iteration.rb
mvpkit-0.8.0 config/initializers/iteration.rb
minimum_viable_product-0.7.15 config/initializers/iteration.rb
minimum_viable_product-0.7.14 config/initializers/iteration.rb
minimum_viable_product-0.7.13 config/initializers/iteration.rb
minimum_viable_product-0.7.12 config/initializers/iteration.rb
minimum_viable_product-0.7.11 config/initializers/iteration.rb
minimum_viable_product-0.7.10 config/initializers/iteration.rb
minimum_viable_product-0.7.9 config/initializers/iteration.rb