examples/csv_export/app.rb in liftapp-client-0.0.1 vs examples/csv_export/app.rb in liftapp-client-0.0.2
- old
+ new
@@ -1,25 +1,25 @@
require 'sinatra'
require 'coffee-script'
-require_relative '../../lib/lift'
+require 'liftapp-client'
configure do
mime_type :plain, 'text/plain'
end
get '/' do
haml :index
end
post '/dashboard.json' do
- client = LiftAPI::Client.new(email: params[:email], password: params[:password])
+ client = Liftapp::Client.new(email: params[:email], password: params[:password])
content_type :json
client.dashboard.to_json
end
get '/checkins/:user/:habit' do
content_type :plain
- client = LiftAPI::Client.new(profile_hash: params[:user])
+ client = Liftapp::Client.new(profile_hash: params[:user])
data = client.checkin_data(params[:habit])
output = data[:checkins].map { |d| d.strftime('%Y-%m-%d') }
output.unshift data[:'habit-name']
output.join("\n")
end