Module: Reight::Extension

Defined in:
lib/reight/extension.rb

Class Method Summary collapse

Class Method Details

.name(downcase = false) ⇒ Object



9
10
11
12
13
# File 'lib/reight/extension.rb', line 9

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



19
20
21
# File 'lib/reight/extension.rb', line 19

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

.versionObject



15
16
17
# File 'lib/reight/extension.rb', line 15

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