motion-firebase 2.1.0 → 2.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: 3691ef599b9fdad62c09eb244c65e94ab633c610
4
- data.tar.gz: cf699742ced08989afc9757f0d00c500b4b1070f
3
+ metadata.gz: 462cf224fbc812e69ec3498d851a16bbaae89bdb
4
+ data.tar.gz: f130d9fb2a5c7305a12667d2b888bdf6a9b6ead5
5
5
  SHA512:
6
- metadata.gz: a06ad4faba724a00bf90147a7b8de55847615de8b5dc5e9c8db3d51e5f80e16e7ef08ea2e8edceb200ce14f2664c89155ebb83842a80bb459a41dc55075fd223
7
- data.tar.gz: 130b95aa9976e104bb3a10db1542cf9fe8f3408074044f89502acb53bcbb655176d93a815bc989c8619f95436a5ecc8d38675e4083e856cb920127d8438613fd
6
+ metadata.gz: 7f768c0dc015ff1c31a8d0791a68dddf160f29777dc973a19e82811da234c9b1f519251343de644010b49b080fef99cab61f6f31584029f3a515effe6f6ada0a
7
+ data.tar.gz: 04593e1ab7fbfa2c0f786047fb6c6cb4d79a5478f15bc9127a530836b180a478e4a6f2625aa5565840914ee4915eb00f7bc2f088923889012c0e517c5d6d3845
data/README.md CHANGED
@@ -138,9 +138,9 @@ SDK
138
138
  ##### Authenticating
139
139
 
140
140
  ```ruby
141
- firebase.auth(credential)
142
- firebase.auth(credential) { |error, data| 'completion block' }
143
- firebase.auth(credential,
141
+ firebase.auth(secret_key)
142
+ firebase.auth(secret_key) { |error, data| 'completion block' }
143
+ firebase.auth(secret_key,
144
144
  completion: proc { |error, data| 'completion block' },
145
145
  disconnect: proc { |error| 'completion block', },
146
146
  )
@@ -162,22 +162,34 @@ SDK
162
162
  ##### Transactions
163
163
 
164
164
  ```ruby
165
- firebase.run { |data| 'transaction block' }
166
- firebase.run(
167
- transaction: proc { |data| 'transaction block' },
165
+ firebase.transaction do |data|
166
+ current_value = data.value
167
+ current_value += 1
168
+ FTransactionResult.successWithValue(current_value)
169
+ end
170
+ firebase.transaction(local: false) do |data|
171
+ #...
172
+ end
173
+ firebase.transaction(
168
174
  completion: proc { |error, committed, snapshot| }
169
- )
170
- firebase.run(
175
+ ) do |data|
176
+ current_value = data.value
177
+ current_value += 1
178
+ FTransactionResult.successWithValue(current_value)
179
+ end
180
+ firebase.transaction(
171
181
  transaction: proc { |data| 'transaction block' },
172
182
  completion: proc { |error, committed, snapshot| }
173
183
  local: true || false,
174
184
  )
185
+ ```
175
186
 
176
187
  ##### Retrieving String Representation
177
188
 
178
189
  ```ruby
179
190
  firebase.to_s
180
191
  firebase.inspect
192
+ ```
181
193
 
182
194
  ##### Properties
183
195
 
@@ -185,31 +197,37 @@ SDK
185
197
  firebase.parent
186
198
  firebase.root
187
199
  firebase.name
200
+ ```
188
201
 
189
202
  ##### Global configuration and settings
190
203
 
191
204
  ```ruby
192
205
  Firebase.dispatch_queue=(queue)
193
206
  Firebase.sdkVersion
194
-
207
+ ```
195
208
 
196
209
  # FirebaseSimpleLogin Class Reference
197
210
 
211
+ require 'motion-firebase-auth'
212
+
198
213
  ##### Initializing a FirebaseSimpleLogin instance
199
214
 
200
215
  ```ruby
201
216
  ref = Firebase.new(url)
202
217
  auth = FirebaseSimpleLogin.new(ref)
218
+ ```
203
219
 
204
220
  ##### Checking current authentication status
205
221
 
206
222
  ```ruby
207
223
  auth.check { |error, user| }
224
+ ```
208
225
 
209
226
  ##### Removing any existing authentication
210
227
 
211
228
  ```ruby
212
229
  auth.logout
230
+ ```
213
231
 
214
232
  ##### Email/password authentication methods
215
233
 
@@ -222,6 +240,7 @@ For `update`, `credentials` should include `:email`, `:old_password` and
222
240
  auth.remove(email: 'hello@example.com', password: '12345') { |error, user| }
223
241
  auth.login(email: 'hello@example.com', password: '12345') { |error, user| }
224
242
  auth.update(email: 'hello@example.com', old_password: '12345', new_password: '54321') { |error, success| }
243
+ ```
225
244
 
226
245
  ##### Facebook authentication methods
227
246
 
@@ -229,6 +248,7 @@ For `update`, `credentials` should include `:email`, `:old_password` and
229
248
 
230
249
  ```ruby
231
250
  auth.login_to_facebook(app_id: '123abc', permissions: ['email']) { |error, user| }
251
+ ```
232
252
 
233
253
  ##### Twitter authentication methods
234
254
 
@@ -238,14 +258,17 @@ passed an array of usernames and should return an index or `NSNotFound`.
238
258
 
239
259
  ```ruby
240
260
  auth.login_to_twitter(app_id: '123abc', on_multiple: ->(usernames) { return 0 }) { |error, user| }
261
+ ```
241
262
 
242
263
  ##### Global configuration and settings
243
264
 
244
265
  ```ruby
245
266
  FirebaseSimpleLogin.sdkVersion
267
+ ```
246
268
 
247
269
  ##### Retrieving String Representation
248
270
 
249
271
  ```ruby
250
272
  firebase.to_s
251
273
  firebase.inspect
274
+ ```
@@ -69,6 +69,11 @@ class Firebase
69
69
  end
70
70
 
71
71
  def run(options={}, &transaction)
72
+ NSLog('The method ‘Firebase#run’ has been deprecated in favor of ‘Firebase#transaction’')
73
+ self.transaction(options, &transaction)
74
+ end
75
+
76
+ def transaction(options={}, &transaction)
72
77
  transaction = transaction || options[:transaction]
73
78
  completion_block = options[:completion]
74
79
  with_local_events = options[:local]
@@ -79,7 +84,11 @@ class Firebase
79
84
  runTransactionBlock(transaction)
80
85
  end
81
86
  else
82
- runTransactionBlock(transaction, andCompletionBlock: completion_block, withLocalEvents: with_local_events)
87
+ if completion_block
88
+ runTransactionBlock(transaction, andCompletionBlock: completion_block, withLocalEvents: with_local_events)
89
+ else
90
+ runTransactionBlock(transaction, withLocalEvents: with_local_events)
91
+ end
83
92
  end
84
93
  end
85
94
 
@@ -1,5 +1,5 @@
1
1
  module Motion
2
2
  module Firebase
3
- Version = '2.1.0'
3
+ Version = '2.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-firebase
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin T.A. Gray