Module: SmalrubyEditor
- Defined in:
- lib/smalruby_editor.rb,
lib/smalruby_editor/version.rb
Constant Summary collapse
- VERSION =
'0.1.19'
Class Method Summary collapse
- .create_home_directory(home_dir = nil) ⇒ Object
-
.osx? ⇒ Boolean
Mac OS Xかどうかを返す.
-
.raspberrypi? ⇒ Boolean
Raspberry Piかどうかを返す.
-
.windows? ⇒ Boolean
Windowsかどうかを返す.
Class Method Details
.create_home_directory(home_dir = nil) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/smalruby_editor.rb', line 5 def create_home_directory(home_dir = nil) if home_dir.blank? path = ENV['SMALRUBY_EDITOR_HOME'] || '~/.smalruby-editor' home_dir = Pathname(path). end create_under_home_directories(home_dir) create_database_yml(home_dir) home_dir end |
.osx? ⇒ Boolean
Mac OS Xかどうかを返す
29 30 31 32 33 34 35 36 37 |
# File 'lib/smalruby_editor.rb', line 29 def osx? if Rails.env != 'test' && (ENV['SMALRUBY_EDITOR_OSX_MODE'] || File.exist?(Rails.root.join('tmp', 'osx'))) true else /darwin/ =~ RbConfig::CONFIG['arch'] end end |
.raspberrypi? ⇒ Boolean
Raspberry Piかどうかを返す
17 18 19 20 21 22 23 24 25 |
# File 'lib/smalruby_editor.rb', line 17 def raspberrypi? if Rails.env != 'test' && (ENV['SMALRUBY_EDITOR_RASPBERRYPI_MODE'] || File.exist?(Rails.root.join('tmp', 'raspberrypi'))) true else RbConfig::CONFIG['arch'] == 'armv6l-linux-eabihf' end end |
.windows? ⇒ Boolean
Windowsかどうかを返す
41 42 43 44 45 46 47 48 49 |
# File 'lib/smalruby_editor.rb', line 41 def windows? if Rails.env != 'test' && (ENV['SMALRUBY_EDITOR_WINDOWS_MODE'] || File.exist?(Rails.root.join('tmp', 'windows'))) true else /windows|mingw|cygwin/i.match(RbConfig::CONFIG['arch']) end end |