diff options
author | elijah <elijah@riseup.net> | 2016-07-01 14:49:27 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2016-07-01 14:49:27 -0700 |
commit | 174dbf380fe1b0962a9e173caa6dd0a0f76a14e1 (patch) | |
tree | d2f1414652d2c0fbd1003347c2abf2be1ffff473 /lib/leap_cli/bootstrap.rb | |
parent | 2d277c7d2aa3ddfbe3c2c65f68d7290930934b70 (diff) | |
parent | f9284ff22da6eec685782dbc9aa4a4ded0efec29 (diff) |
Merge branch 'feature/newcli' into develop
Diffstat (limited to 'lib/leap_cli/bootstrap.rb')
-rw-r--r-- | lib/leap_cli/bootstrap.rb | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/lib/leap_cli/bootstrap.rb b/lib/leap_cli/bootstrap.rb index 9ccb3dd..f33aa42 100644 --- a/lib/leap_cli/bootstrap.rb +++ b/lib/leap_cli/bootstrap.rb @@ -39,6 +39,8 @@ module LeapCli if LeapCli.logger.log_level >= 2 log_version end + add_platform_lib_to_path + load_platform_libraries load_commands(app) load_macros end @@ -103,11 +105,10 @@ module LeapCli elsif !leapfile_optional?(argv) puts puts " =" - log :note, "There is no `Leapfile` in this directory, or any parent directory.\n"+ - " = "+ + log :NOTE, "There is no `Leapfile` in this directory, or any parent directory.\n"+ + " = "+ "Without this file, most commands will not be available." puts " =" - puts end end @@ -193,5 +194,26 @@ module LeapCli end end + # + # makes all the ruby libraries in the leap_platform/lib directory + # available for inclusion. + # + def add_platform_lib_to_path + if Path.platform + path = File.join(Path.platform, 'lib') + $LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path) + end + end + + # + # loads libraries that live in the platform and should + # always be available. + # + def load_platform_libraries + if Path.platform + require 'leap_cli/load_libraries' + end + end + end end |