Sha256: 8819ca80c307d780c1bc4053a37cf1262d6e68e92fc3ac6726bc5ebf928c0760

Contents?: true

Size: 738 Bytes

Versions: 9

Compression:

Stored size: 738 Bytes

Contents

module ProconBypassMan
  class ButtonsSettingConfiguration
    class MetadataLoader
      EMPTY_VERSION = '0.0.0'

      # @param [String] setting_path
      # @return [MetadataLoader]
      def self.load(setting_path: )
        self.new(setting_path)
      end

      # @param [String] setting_path
      def initialize(setting_path)
        content = File.read(setting_path)
        if(matched = content.match(/metadata-required_pbm_version: ([\d.]+)/))
          @required_pbm_version = matched[1]
        end
      end

      # @return [String]
      def required_pbm_version
        return EMPTY_VERSION unless defined?(@required_pbm_version)
        return @required_pbm_version if @required_pbm_version
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
procon_bypass_man-0.3.12 lib/procon_bypass_man/buttons_setting_configuration/metadata_loader.rb
procon_bypass_man-0.3.11 lib/procon_bypass_man/buttons_setting_configuration/metadata_loader.rb
procon_bypass_man-0.3.10 lib/procon_bypass_man/buttons_setting_configuration/metadata_loader.rb
procon_bypass_man-0.3.9 lib/procon_bypass_man/buttons_setting_configuration/metadata_loader.rb
procon_bypass_man-0.3.8.1 lib/procon_bypass_man/buttons_setting_configuration/metadata_loader.rb
procon_bypass_man-0.3.8 lib/procon_bypass_man/buttons_setting_configuration/metadata_loader.rb
procon_bypass_man-0.3.7 lib/procon_bypass_man/buttons_setting_configuration/metadata_loader.rb
procon_bypass_man-0.3.6 lib/procon_bypass_man/buttons_setting_configuration/metadata_loader.rb
procon_bypass_man-0.3.5 lib/procon_bypass_man/buttons_setting_configuration/metadata_loader.rb