quick_blox 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38af5a3d2524456d964136e1a98345c63e92db3b
4
- data.tar.gz: f02c1fc9dee70edd4c7d51cd9edd950dd177df7f
3
+ metadata.gz: 9ae1efb8e955de0db91594760b4333d628379241
4
+ data.tar.gz: 8adc29fc1c7a94375499987bf02fb7a581ddea66
5
5
  SHA512:
6
- metadata.gz: f1956f1b19c8d2080b31a87a60bd61ee397ef07d6a2bd64daf82bcd742974495923f53aba3f6abe16af5fb8b4579639790979a59a2d6d99034d89af6f302fd13
7
- data.tar.gz: f866173640e8bdfb738e392aab2e75c2fdd4c5124c3bdde46399bb9f52e1e1463aeb1bd031b887ced80122a4afba8a6130cde4e23f45dec1bcbafad83b4e3524
6
+ metadata.gz: 317bc0abe534ca919ec692027ec5e623de5a78993671e88739e8892e0633f5108cf078646c56bbdea0a93595f0cabda4254b62dff277f2fb6987e0b4d7bae06f
7
+ data.tar.gz: c99585a08eebb37ad77509e230e087604e297921ac9054f4eaaa42a282806625143e67f6be402df3af1b61c7dec711ff6db6fb8b59a6da6afd53d582f5dc3174
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # QuickBlox
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/quick_blox`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Quickblox ruby interface.
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,13 +20,49 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ #### Configuration
26
24
 
27
- ## Development
25
+ ```ruby
26
+ QuickBlox.configure do |config|
27
+ config.host = ENV['QUICKBLOX_HOST']
28
+ config.application_id = ENV['QUICKBLOX_APPLICATION_ID']
29
+ config.auth_key = ENV['QUICKBLOX_AUTH_KEY']
30
+ config.auth_secret = ENV['QUICKBLOX_AUTH_SECRET']
31
+ end
32
+ ```
28
33
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
34
+ #### Session
35
+
36
+ ```ruby
37
+ session = QuickBlox::Session.new
38
+
39
+ #<QuickBlox::Session:0x007f3078130b28 @_id="586df8dda0eb474700000018", @application_id=51120, @created_at="2017-01-05T07:42:21Z", @device_id=0, @nonce=1483176794, @token="bcc14b44d428cdab14a0614a1b3d9603b700c7b0", @ts=1483602140, @updated_at="2017-01-05T07:42:21Z", @user_id=0, @id=22488>
30
40
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
41
+
42
+ session.info
43
+ session.destroy
44
+ ```
45
+
46
+ #### Users
47
+
48
+ ```ruby
49
+
50
+ user = QuickBlox::User.create session, login: 'test_user', password: 'secretpassword'
51
+ #<QuickBlox::User:0x00000006c02d48 @id=22433881, @owner_id=64395, @full_name=nil, @email=nil, @login="test_user", @phone=nil, @website=nil, @created_at="2017-01-05T07:46:22Z", @updated_at="2017-01-05T07:46:22Z", @last_request_at=nil, @external_user_id=nil, @facebook_id=nil, @twitter_id=nil, @blob_id=nil, @custom_data=nil, @twitter_digits_id=nil, @user_tags=nil>
52
+
53
+ user = QuickBlox::User.show session, user.id
54
+
55
+ session.info
56
+ session.destroy
57
+ ```
58
+
59
+ #### User Session
60
+
61
+ ```ruby
62
+
63
+ user_session = QuickBlox::UserSession.new session, login: 'test_user', password: 'secretpassword' # upgrade to user session
64
+ user_session.destroy # downgrade to application session
65
+ ```
32
66
 
33
67
  ## Contributing
34
68
 
@@ -77,6 +77,7 @@ module QuickBlox
77
77
  when 200
78
78
 
79
79
  else
80
+ response = JSON.parse(response)
80
81
  raise QuickBlox::Exceptions::Response, response['errors']
81
82
  end
82
83
  }
@@ -1,3 +1,3 @@
1
1
  module QuickBlox
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quick_blox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mykhaylo Skubenych
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-03 00:00:00.000000000 Z
11
+ date: 2017-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client