Sha256: 11911606cf91d3bc8ca7ee47657fde1fad5f24f071b2b2c163cdcefff674427f

Contents?: true

Size: 703 Bytes

Versions: 1

Compression:

Stored size: 703 Bytes

Contents

#!/usr/bin/env rake

require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new :spec
task default: :spec

desc 'Runs irb console and initializes the API'
task :console, :token do |_, args|
  require 'irb'
  require 'mavenlink'
  require 'awesome_print'

  token = ENV['TOKEN'] || args[:token]
  Mavenlink.oauth_token = token

  Mavenlink.logger = Mavenlink::Logger.new(STDOUT)
  Mavenlink.logger.level = Logger::DEBUG # Change to Logger::INFO not to display responses
  if token
    Mavenlink.logger.hint "Using #{token} token."
  else
    Mavenlink.logger.disappointment 'No token set! Please put TOKEN=xxxx into your .env file or set manually.'
  end

  AwesomePrint.irb!
  ARGV.clear
  IRB.start
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mavenlink-0.0.1 Rakefile