Class: Quandl::Command::Tasks::Info
- Inherits:
-
Quandl::Command::Task
- Object
- Quandl::Command::Task
- Quandl::Command::Tasks::Info
- Defined in:
- lib/quandl/command/tasks/info.rb
Constant Summary
Constants included from Quandl::Command::Task::Updatable
Quandl::Command::Task::Updatable::VERSION_URL
Instance Method Summary collapse
- #execute ⇒ Object
- #package_info ⇒ Object
- #quandl_package_versions ⇒ Object
- #title(name) ⇒ Object
- #toolbelt_info ⇒ Object
- #user_info ⇒ Object
Methods included from Quandl::Command::Task::Inputable
#args_or_stdin, #each_line_in_background, #file_or_stdin
Methods included from Quandl::Command::Task::Reportable
#ask_to_send_crash_reports, #call
Methods included from Quandl::Command::Task::Clientable
Methods included from Quandl::Command::Task::Updatable
#check_for_update, #check_for_update_once_daily
Methods included from Quandl::Command::Task::Threading
#await_thread_pool_lock!, #background_job, #exiting?, #force_load_json_support, #mutex, #obtain_thread_pool_lock, #release_thread_pool_lock, #shutdown_thread_pool_on_sigint, #thread_pool, #thread_pool_locked?, #thread_pool_locks, #threads, #threads?
Methods included from Quandl::Command::Task::Presentation
Methods included from Quandl::Command::Task::Logging
#configure_logger, #debug, #error, #fatal, #info, #initialize_logger, #log_request_time, #logger, #start_request_timer, #stderr_logger, #summarize, #summarize_hash, #table
Methods included from Quandl::Command::Task::Commandable
Methods included from Quandl::Command::Task::Validations
Methods included from Quandl::Command::Task::Callbacks
Methods included from Quandl::Command::Task::Configurable
#ask_for_confirmation!, #config, #confirmed?, #declared_params, #force_yes?, #page, #trace?, #verbose?
Instance Method Details
#execute ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/quandl/command/tasks/info.rb', line 6 def execute info title "Quandl Toolbelt" info current_user.info info toolbelt_info debug "path: #{Quandl::Command.root}" debug title "Package Versions" debug package_info end |
#package_info ⇒ Object
36 37 38 |
# File 'lib/quandl/command/tasks/info.rb', line 36 def package_info quandl_package_versions.sort_by{|p| p[:package].to_s }.collect{|p| "#{ p[:package] } ( #{ p[:version] } )" }.join("\n") end |
#quandl_package_versions ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/quandl/command/tasks/info.rb', line 40 def quandl_package_versions Quandl.constants.collect do |c| package = "Quandl::#{c}".constantize version = "Quandl::#{c}::VERSION".constantize rescue nil { package: package, version: version } unless version.nil? end.compact end |
#title(name) ⇒ Object
16 17 18 19 |
# File 'lib/quandl/command/tasks/info.rb', line 16 def title(name) name = name.to_s "\n#{name}\n" + ( name.length.times.collect{'='}.join ) end |
#toolbelt_info ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/quandl/command/tasks/info.rb', line 28 def toolbelt_info [ "host: #{quandl_url}", "token: #{auth_token}", "version: #{Quandl::Command::VERSION}", ].join("\n") end |
#user_info ⇒ Object
21 22 23 24 25 26 |
# File 'lib/quandl/command/tasks/info.rb', line 21 def user_info [ "username: #{current_user.username}", "email: #{current_user.email}", ].join("\n") end |