Sha256: 970c162d02ceaef862be5598fbbe259fa189f35adc43573de5ab36812ebb9d6f

Contents?: true

Size: 837 Bytes

Versions: 9

Compression:

Stored size: 837 Bytes

Contents

# -*- encoding : utf-8 -*-
require File.expand_path( '../../wagn', __FILE__ )

module Wagn
  module Version
    class << self
      
      def release
        @@version ||= File.read( File.expand_path '../../../VERSION', __FILE__ ).strip
      end
    
      def schema type=nil
        File.read( schema_stamp_path type ).strip
      end

      def schema_stamp_path type
        root_dir = ( type == :deck_cards ? Wagn.root : Wagn.gem_root )
        stamp_dir = ENV['SCHEMA_STAMP_PATH'] || File.join( root_dir, 'db' )
        
        File.join stamp_dir, "version#{ schema_suffix(type) }.txt"  
      end
      
      def schema_suffix type
        case type
        when :core_cards then '_core_cards' # was _cards before !!!
        when :deck_cards then '_deck_cards'
        else ''
        end
      end
      
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wagn-1.14.9 lib/wagn/version.rb
wagn-1.14.8 lib/wagn/version.rb
wagn-1.14.7 lib/wagn/version.rb
wagn-1.14.6 lib/wagn/version.rb
wagn-1.14.5 lib/wagn/version.rb
wagn-1.14.4 lib/wagn/version.rb
wagn-1.14.3 lib/wagn/version.rb
wagn-1.14.2 lib/wagn/version.rb
wagn-1.14.1 lib/wagn/version.rb