forked from timdorr/tesla-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
39 lines (31 loc) · 782 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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