adelevie / parse-ruby-client

A simple Ruby client for the parse.com REST API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

name error

sai43 opened this issue · comments

NameError - uninitialized class variable @@client in Parse:
parse-ruby-client (0.3.0) lib/parse/client.rb:127:in client' parse-ruby-client (0.3.0) lib/parse/user.rb:16:inauthenticate'
app/controllers/sessions_controller.rb:8:in `create'

@sai43 You need to Parse.init(API_KEY,SECRET), as per the readme.

thanks @Xavdidtheshadow

The new documentation promotes using Parse.create instead of Parse.init but, I get the above error if I use .create. Am I missing something?

Parse.init :application_id => "app_id",
:api_key => "api_key"

@mintuhouse The gem version that's released is out of sync with the docs right now

I am using the master.
When I use.init, I get a depreciation warning and .create throws this error.
Using init for now.

@mintuhouse you have to pass the client object to authenticate.

client = Parse.create(YOUR OPTIONS)
Parse::User.authenticate(username, password, client)

@rhymes Is it a good practice to initialize $parse_client global variable in an initializer and use it across the app or should I be creating a new Parse.create client everytime I need to interact with parse?

@mintuhouse I think both are correct. The first is definitely not thread safe, the second one is.

@Xavdidtheshadow @adelevie I think I'd like to have the commit bit if you agree. I want to address this issue clearly in the documentation. Will keep on using pull requests for big changes so we can discuss them together.

fine by me! i don't have access to settings but i'm sure @adelevie will be happy to give you commit access. thanks for doing so much for this!

@rhymes you have commit access. Use it wisely :)

This is really great that parse-ruby-client is picking up a nice second wind thanks to you all. I'm generally going to rule by consensus, and prefer not to rule at all. I'd like to get gem push access to at least one person other than myself. @rhymes and/or @Xavdidtheshadow, are you interested?

@adelevie sure, i'll take it. Don't plan on pushing often, but it'll be nice to be able to operate autonomously

Is there a way to deploy to Rubygems from some server?

how do you mean? normally it's done by gem push THING.gem

I wish I could cut and push a gem from a web interface.