Module: Rays::Extension
- Defined in:
- lib/rays/extension.rb
Class Method Summary collapse
- .ext_dir ⇒ Object
- .inc_dir ⇒ Object
- .lib_dir ⇒ Object
- .lib_name ⇒ Object
- .name(downcase = false) ⇒ Object
- .root_dir(path = '') ⇒ Object
- .version ⇒ Object
Class Method Details
.ext_dir ⇒ Object
30 31 32 |
# File 'lib/rays/extension.rb', line 30 def ext_dir() root_dir 'ext' end |
.inc_dir ⇒ Object
22 23 24 |
# File 'lib/rays/extension.rb', line 22 def inc_dir() root_dir 'include' end |
.lib_dir ⇒ Object
26 27 28 |
# File 'lib/rays/extension.rb', line 26 def lib_dir() root_dir 'lib' end |
.lib_name ⇒ Object
34 35 36 |
# File 'lib/rays/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/rays/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/rays/extension.rb', line 18 def root_dir(path = '') File. "../../#{path}", __dir__ end |
.version ⇒ Object
14 15 16 |
# File 'lib/rays/extension.rb', line 14 def version() File.read(root_dir 'VERSION')[/[\d\.]+/] end |