Module: Reflex::Extension

Defined in:
lib/reflex/extension.rb

Class Method Summary collapse

Class Method Details

.ext_dirObject



30
31
32
# File 'lib/reflex/extension.rb', line 30

def ext_dir()
  root_dir 'ext'
end

.inc_dirObject



22
23
24
# File 'lib/reflex/extension.rb', line 22

def inc_dir()
  root_dir 'include'
end

.lib_dirObject



26
27
28
# File 'lib/reflex/extension.rb', line 26

def lib_dir()
  root_dir 'lib'
end

.lib_nameObject



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

def lib_name()
  "#{name true}.dll" if /mswin|ming|cygwin/.match? RUBY_PLATFORM
end

.name(downcase = false) ⇒ Object



8
9
10
11
12
# File 'lib/reflex/extension.rb', line 8

def name(downcase = false)
  super().split('::')[-2].then {|s|
    downcase ? s.gsub(/([a-z])([A-Z])/) {"#{$1}-#{$2}"}.downcase : s
  }
end

.root_dir(path = '') ⇒ Object



18
19
20
# File 'lib/reflex/extension.rb', line 18

def root_dir(path = '')
  File.expand_path "../../#{path}", __dir__
end

.versionObject



14
15
16
# File 'lib/reflex/extension.rb', line 14

def version()
  File.read(root_dir 'VERSION')[/[\d\.]+/]
end