From d4ee04322ce642c602269738e45f63b800d78cf7 Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 21 Jun 2016 15:59:27 -0700 Subject: fix ruby deprecation warnings --- lib/leap_cli/bootstrap.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/leap_cli/bootstrap.rb') diff --git a/lib/leap_cli/bootstrap.rb b/lib/leap_cli/bootstrap.rb index b7bc8e9..a6b1759 100644 --- a/lib/leap_cli/bootstrap.rb +++ b/lib/leap_cli/bootstrap.rb @@ -5,7 +5,6 @@ module LeapCli module Bootstrap - extend LeapCli::Log extend self # @@ -36,7 +35,7 @@ module LeapCli # called from leap executable. # def load_libraries(app) - if LeapCli.log_level >= 2 + if LeapCli.logger.log_level >= 2 log_version end load_commands(app) @@ -72,14 +71,14 @@ module LeapCli options = parse_logging_options(argv) verbose = (options[:verbose] || 1).to_i if verbose - LeapCli.set_log_level(verbose) + LeapCli.logger.log_level = verbose end if options[:log] - LeapCli.log_file = options[:log] - LeapCli::Util.log_raw(:log) { $0 + ' ' + argv.join(' ')} + LeapCli.logger.log_file = options[:log] + LeapCli.logger.log_raw(:log) { $0 + ' ' + argv.join(' ')} end unless options[:color].nil? - LeapCli.log_in_color = options[:color] + LeapCli.logger.log_in_color = options[:color] end end @@ -97,8 +96,8 @@ module LeapCli if !Path.platform || !File.directory?(Path.platform) bail! { log :missing, "platform directory '#{Path.platform}'" } end - if LeapCli.log_file.nil? && LeapCli.leapfile.log - LeapCli.log_file = LeapCli.leapfile.log + if LeapCli.logger.log_file.nil? && LeapCli.leapfile.log + LeapCli.logger.log_file = LeapCli.leapfile.log end elsif !leapfile_optional?(argv) puts -- cgit v1.2.3 From c7ebb220bc79d3a84e55745ed18d0d7b5baeacdd Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 21 Jun 2016 17:49:42 -0700 Subject: remove highline gem dependency --- lib/leap_cli/bootstrap.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/leap_cli/bootstrap.rb') diff --git a/lib/leap_cli/bootstrap.rb b/lib/leap_cli/bootstrap.rb index a6b1759..9ccb3dd 100644 --- a/lib/leap_cli/bootstrap.rb +++ b/lib/leap_cli/bootstrap.rb @@ -6,6 +6,7 @@ module LeapCli module Bootstrap extend self + extend LeapCli::LogCommand # # the argument leapfile_path is only used for tests -- cgit v1.2.3 From e8de57c6309daeb5e25e1b0973adb8214255077f Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 27 Jun 2016 14:09:11 -0700 Subject: remove capistrano, switch to sshkit --- lib/leap_cli/bootstrap.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/leap_cli/bootstrap.rb') diff --git a/lib/leap_cli/bootstrap.rb b/lib/leap_cli/bootstrap.rb index 9ccb3dd..bc43115 100644 --- a/lib/leap_cli/bootstrap.rb +++ b/lib/leap_cli/bootstrap.rb @@ -39,6 +39,7 @@ module LeapCli if LeapCli.logger.log_level >= 2 log_version end + add_platform_lib_to_path load_commands(app) load_macros end @@ -193,5 +194,15 @@ 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 end end -- cgit v1.2.3 From 64704deccddd9db46ea9ec4992207b8b2d51f1f8 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 29 Jun 2016 16:52:31 -0700 Subject: move everything we can to leap_platform/lib/leap_cli --- lib/leap_cli/bootstrap.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'lib/leap_cli/bootstrap.rb') diff --git a/lib/leap_cli/bootstrap.rb b/lib/leap_cli/bootstrap.rb index bc43115..f33aa42 100644 --- a/lib/leap_cli/bootstrap.rb +++ b/lib/leap_cli/bootstrap.rb @@ -40,6 +40,7 @@ module LeapCli log_version end add_platform_lib_to_path + load_platform_libraries load_commands(app) load_macros end @@ -104,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 @@ -204,5 +204,16 @@ module LeapCli $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 -- cgit v1.2.3 From a8efdb865dbea99e619c0353d707da39118e6e28 Mon Sep 17 00:00:00 2001 From: elijah Date: Sat, 9 Jul 2016 02:45:23 -0700 Subject: test: added test of quick start tutorial commands --- lib/leap_cli/bootstrap.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/leap_cli/bootstrap.rb') diff --git a/lib/leap_cli/bootstrap.rb b/lib/leap_cli/bootstrap.rb index f33aa42..75edf5b 100644 --- a/lib/leap_cli/bootstrap.rb +++ b/lib/leap_cli/bootstrap.rb @@ -159,7 +159,9 @@ module LeapCli # Yes, hacky. # def leapfile_optional?(argv) - if argv.include?('--version') + if TEST + return true + elsif argv.include?('--version') return true else without_flags = argv.select {|i| i !~ /^-/} -- cgit v1.2.3