Sha256: 758f376bef58c415fbb79442e8d0131317d710e91049d483176b560c960ab115

Contents?: true

Size: 782 Bytes

Versions: 5

Compression:

Stored size: 782 Bytes

Contents

require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec) do |task|
  task.rspec_opts = ['--color', '--format', 'documentation', '--require', 'spec_helper']
end

desc "Open an irb session preloaded with this library"
task :console do
  # Load all gems
  require 'rubygems'
  require 'bundler/setup'
  Bundler.require(:default)

  # Load the envs
  require 'dotenv'
  Dotenv.load!

  # Set up a global client
  def client
    @client ||= begin
        client = TeslaApi::Client.new(ENV['TESLA_EMAIL'])
        client.login!(ENV['TESLA_PASS'])
        client
    end
  end

  # Load IRB
  require 'irb'
  require 'irb/completion'

  IRB.conf[:PROMPT_MODE] = :SIMPLE
  IRB.conf[:AUTO_INDENT] = true

  ARGV.clear
  IRB.start
end

task default: :spec

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tesla_api-2.0.0 Rakefile
tesla_api-1.5.0 Rakefile
tesla_api-1.4.1 Rakefile
tesla_api-1.4.0 Rakefile
tesla_api-1.3.0 Rakefile