Module: RegexpPropertyValues

Defined in:
lib/regexp_property_values.rb,
lib/regexp_property_values/value.rb,
lib/regexp_property_values/updater.rb,
lib/regexp_property_values/version.rb,
lib/regexp_property_values/value/ext_adapter.rb,
lib/regexp_property_values/value/ruby_fallback.rb,
lib/regexp_property_values/value/shared_methods.rb

Defined Under Namespace

Modules: Updater Classes: Value

Constant Summary collapse

Error =
Class.new(StandardError)
VALUES_PATH =
File.join(__dir__, 'values')
ALIASES_PATH =
File.join(__dir__, 'aliases')
VERSION =
'1.0.0'

Class Method Summary collapse

Class Method Details

.[](name) ⇒ Object



16
17
18
# File 'lib/regexp_property_values.rb', line 16

def self.[](name)
  Value.new(name)
end

.alias_hashObject



28
29
30
31
32
# File 'lib/regexp_property_values.rb', line 28

def self.alias_hash
  @alias_hash ||= File.readlines(ALIASES_PATH).map do |line|
    line.chomp.split(';').map { |name| Value.new(name) }
  end.to_h
end

.allObject



24
25
26
# File 'lib/regexp_property_values.rb', line 24

def self.all
  @all ||= File.readlines(VALUES_PATH).map { |line| Value.new(line.chomp) }
end

.all_for_current_rubyObject



20
21
22
# File 'lib/regexp_property_values.rb', line 20

def self.all_for_current_ruby
  @all_for_current_ruby ||= all.select(&:supported_by_current_ruby?)
end

.updateObject



34
35
36
# File 'lib/regexp_property_values.rb', line 34

def self.update
  Updater.call
end