Sha256: fa3746ead68756ec01a3a665fcd728a2fba2a70c97c238ab40ff362ca8c355b8

Contents?: true

Size: 789 Bytes

Versions: 9

Compression:

Stored size: 789 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(email: 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

9 entries across 9 versions & 1 rubygems

Version Path
tesla_api-3.1.0 Rakefile
tesla_api-3.0.7 Rakefile
tesla_api-3.0.6 Rakefile
tesla_api-3.0.5 Rakefile
tesla_api-3.0.4 Rakefile
tesla_api-3.0.3 Rakefile
tesla_api-3.0.2 Rakefile
tesla_api-3.0.1 Rakefile
tesla_api-3.0.0 Rakefile