Module: Akaer::ApplicationMethods::General
- Extended by:
- ActiveSupport::Concern
- Included in:
- Akaer::Application
- Defined in:
- lib/akaer/application.rb
Overview
General methods.
Instance Method Summary (collapse)
-
- (Boolean) is_osx?
Checks if we are running on MacOS X.
-
- (Boolean) manage(type, address)
Adds or removes an alias from the interface.
Instance Method Details
- (Boolean) is_osx?
Checks if we are running on MacOS X.
System services are only available on that platform.
20 21 22 |
# File 'lib/akaer/application.rb', line 20 def is_osx? !(::RbConfig::CONFIG['host_os'] =~ /^darwin/).nil? end |
- (Boolean) manage(type, address)
Adds or removes an alias from the interface.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/akaer/application.rb', line 29 def manage(type, address) locale = i18n config = self.config quiet = config.quiet rv, command, prefix = setup_management(type, address) # Now execute if rv then if !config.dry_run then execute_manage(command, prefix, type, address, config, quiet) else log_management(:dry_run, prefix, type, locale.remove, locale.add, address, config, quiet) end end rv end |