oscardelben / firebase-ruby Goto Github PK
View Code? Open in Web Editor NEWRuby wrapper for Firebase
License: MIT License
Ruby wrapper for Firebase
License: MIT License
It would appear as if you created the gem will umask 0077.
If you install the gem as a system user:
sudo gem install firebase
The installation looks like:
bash-3.2$ ls -lR /usr/share/ruby/1.9/gems/1.9.1/gems/firebase-0.2.1/
total 64
-rw-r----- 1 root root 337 Apr 24 09:53 CHANGELOG
-rw-r----- 1 root root 342 Apr 24 09:53 Gemfile
-rw-r----- 1 root root 1424 Apr 24 09:53 Gemfile.lock
-rw-r----- 1 root root 1057 Apr 24 09:53 LICENSE.txt
-rw-r----- 1 root root 1476 Apr 24 09:53 README.md
-rw-r----- 1 root root 1289 Apr 24 09:53 Rakefile
-rw-r----- 1 root root 6 Apr 24 09:53 VERSION
-rw-r----- 1 root root 1871 Apr 24 09:53 firebase.gemspec
drwxrwxr-x 4 root root 136 Apr 24 09:53 lib
drwxrwxr-x 5 root root 170 Apr 24 09:53 spec
/usr/share/ruby/1.9/gems/1.9.1/gems/firebase-0.2.1//lib:
total 8
drwxrwxr-x 4 root root 136 Apr 24 09:53 firebase
-rw-r----- 1 root root 1528 Apr 24 09:53 firebase.rb
/usr/share/ruby/1.9/gems/1.9.1/gems/firebase-0.2.1//lib/firebase:
total 16
-rw-r----- 1 root root 1261 Apr 24 09:53 request.rb
-rw-r----- 1 root root 445 Apr 24 09:53 response.rb
/usr/share/ruby/1.9/gems/1.9.1/gems/firebase-0.2.1//spec:
total 24
-rw-r----- 1 root root 557 Apr 24 09:53 firebase_request_spec.rb
-rw-r----- 1 root root 2204 Apr 24 09:53 firebase_spec.rb
-rw-r----- 1 root root 356 Apr 24 09:53 spec_helper.rb
The net effect is that if someone other than root tries to use the gem they can't access the code.
It seems a more typical permission set if 0022. (i.e. -rw-r--r--)
Firebase added the ability to make multi location updates with one request. This would be awesome!
The blog post: https://www.firebase.com/blog/2015-09-24-atomic-writes-and-more.html
Does inputting your Firebase secret here allow your server to bypass any security rules that have been set?:
firebase = Firebase::Client.new(base_uri, secret_key)
I followed the instructions on the readme bit I get the following error when I try and run the ruby application:
(LoadError)ib/ruby/gems/1.9.1/gems/ffi-1.9.6-x86-mingw32/lib/ffi/library.rb:133:in block in ffi_lib': Could not open library 'libcurl': The specified module could not be found. . Could not open library 'libcurl.dll': The specified module could not be found. . Could not open library 'libcurl.so.4': The specified module could not be found. . Could not open library 'libcurl.so.4.dll': The specified module could not be found. from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.6-x86-mingw32/lib/ffi/library.rb:100:in
map'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.6-x86-mingw32/lib/ffi/library.rb:100:in ffi_lib' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ethon-0.7.1/lib/ethon/curls/settings.rb:6:in
module:Curl'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ethon-0.7.1/lib/ethon/curls/settings.rb:2:in <module:Ethon>' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ethon-0.7.1/lib/ethon/curls/settings.rb:1:in
<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in require' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in
require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/backports-3.6.0/lib/backports/tools.rb:343:in require_with_backports' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ethon-0.7.1/lib/ethon/curl.rb:27:in
module:Curl'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ethon-0.7.1/lib/ethon/curl.rb:13:in <module:Ethon>' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ethon-0.7.1/lib/ethon/curl.rb:8:in
<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in require' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in
require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/backports-3.6.0/lib/backports/tools.rb:343:in require_with_backports' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ethon-0.7.1/lib/ethon.rb:11:in
<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in require' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in
require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/backports-3.6.0/lib/backports/tools.rb:343:in require_with_backports' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/typhoeus-0.6.9/lib/typhoeus.rb:2:in
<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in require' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in
require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/backports-3.6.0/lib/backports/tools.rb:343:in require_with_backports' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/firebase-0.2.2/lib/firebase/request.rb:1:in
<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in require' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in
require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/backports-3.6.0/lib/backports/tools.rb:343:in require_with_backports' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/firebase-0.2.2/lib/firebase.rb:4:in
class:Client'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/firebase-0.2.2/lib/firebase.rb:2:in <module:Firebase>' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/firebase-0.2.2/lib/firebase.rb:1:in
<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:128:in require' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:128:in
rescue in require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:39:in require' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/backports-3.6.0/lib/backports/tools.rb:343:in
require_with_backports'
from D:/sandboxes/odin-dashboard/jobs/beer_run.rb:1:in <top (required)>' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in
require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in require' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/backports-3.6.0/lib/backports/tools.rb:343:in
require_with_backports'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/dashing-1.3.4/lib/dashing/app.rb:157:in block in require_glob' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/dashing-1.3.4/lib/dashing/app.rb:156:in
each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/dashing-1.3.4/lib/dashing/app.rb:156:in require_glob' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/dashing-1.3.4/lib/dashing/app.rb:167:in
<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in require' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in
require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/dashing-1.3.4/lib/dashing.rb:3:in <top (required)>' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:128:in
require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:128:in rescue in require' from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:39:in
require'
from D:/sandboxes/odin-dashboard/config.ru:1:in block in <main>' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in
instance_eval'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in initialize' from D:/sandboxes/odin-dashboard/config.ru:in
new'
from D:/sandboxes/odin-dashboard/config.ru:in <main>' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in
eval'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in new_from_string' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:40:in
parse_file'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:277:in build_app_and_options_from_config' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:199:in
app'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:314:in wrapped_app' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:250:in
start'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:141:in start' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/bin/rackup:4:in
<top (required)>'
from C:/Ruby193/bin/rackup:23:in load' from C:/Ruby193/bin/rackup:23:in
It looks like the ffi library was a dependency of this firebase gem.
Is there support for transaction in this library? Not seeing it... Plans?
I'm a newbie to Firebase. As per your example in the README file the push works as expected. In order to get the data from Firebase I find myself doing this:
This doesn't seem very efficient. What am I missing? Using the get method in your README would be very beneficial for newbies.
How do I use firebase across methods and not locally as shown in the examples? @firebase, see paste...
http://bpaste.net/show/501b6a67c8d4
Multiple back to back calls to Firebase.push causes a crash in rails 4.
Logs are as follows =>
ETHON: started MULTI
ETHON: performed EASY url= response_code=200 return_code=ok total_time=1.126498
ETHON: performed EASY url= response_code=200 return_code=got_nothing total_time=1.3479619999999999
/gems/ruby-2.0.0-p247/gems/ethon-0.6.1/lib/ethon/multi/operations.rb:171: [BUG] Segmentation fault
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0]
Hi, wanted to use firebase for my rails project -- I saw #53 and it seems many features on google's firebase docs lack support from this client. Something trivial like incrementing a counter in the database requires multiple http requests? Any idea if an official ruby sdk is in the works?
Hello,
It seems that Firebase has upgraded the way to initialize a firebase client
https://firebase.google.com/docs/admin/setup
We have to import a json file generated by Firebase, instead of tap a secret key.
Any upgrade planned for firebase-ruby to adapt with this ?
Thanks for this library !
Hello - any reason not to bump up version to 0.2.4 and release?
Firebase::ServerValue::TIMESTAMP
is very handy. Good to have it in a released version!
the PUSH in the FirebaseJS library creates an array object and pushes onto that. Why doesn't the Ruby -REST API do the same, it rather creates an object, that I cannot run filters on in Angular.
Hi, I'm having an issue with Firebase::Client segfaulting when I try and make any request from a Rails console (Rails 4.1.4).
I'm running on OSX 10.9.3, Ruby version: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
. I'm using the latest HEAD from Github.
I'm not sure if this is a bug in the firebase-ruby or the ethon
gem.
I'm using the rails-pry
gem but this doesn't seem to be the issue. Things I've tried:
bundle exec irb
: client works finebundle exec pry
client works finerails console
with pry-rails: segfaultrails console
without pry-rails: segfaultHere's the output:
ETHON: Libcurl initialized
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/ethon-0.7.1/lib/ethon/easy/operations.rb:23: [BUG] Segmentation fault at 0x00000000000110
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
-- Control frame information -----------------------------------------------
c:0050 p:---- s:0207 e:000206 CFUNC :easy_perform
c:0049 p:0016 s:0203 e:000202 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/ethon-0.7.1/lib/ethon/easy/operations.rb:23
c:0048 p:0024 s:0200 e:000199 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/typhoeus-0.6.9/lib/typhoeus/request/operations.rb:16
c:0047 p:0052 s:0196 e:000195 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/typhoeus-0.6.9/lib/typhoeus/request/cacheable.rb:18
c:0046 p:0036 s:0192 e:000191 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/typhoeus-0.6.9/lib/typhoeus/request/block_connection.rb:31
c:0045 p:0034 s:0189 e:000188 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/typhoeus-0.6.9/lib/typhoeus/request/stubbable.rb:23
c:0044 p:0022 s:0185 e:000184 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/typhoeus-0.6.9/lib/typhoeus/request/before.rb:26
c:0043 p:0049 s:0182 e:000181 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/firebase-ruby-94fd0c9dcfc8/lib/firebase/request.rb:49
c:0042 p:0014 s:0173 e:000172 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/firebase-ruby-94fd0c9dcfc8/lib/firebase/request.rb:16
c:0041 p:0020 s:0168 e:000167 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/firebase-ruby-94fd0c9dcfc8/lib/firebase.rb:29
c:0040 p:0008 s:0163 e:000162 EVAL (pry):4 [FINISH]
c:0039 p:---- s:0161 e:000160 CFUNC :eval
c:0038 p:0069 s:0155 e:000154 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:328
c:0037 p:0052 s:0149 e:000148 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:278
c:0036 p:0033 s:0143 e:000142 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:254
c:0035 p:0027 s:0138 e:000137 BLOCK /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:234 [FINISH]
c:0034 p:---- s:0136 e:000135 CFUNC :loop
c:0033 p:0007 s:0133 e:000132 BLOCK /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:232 [FINISH]
c:0032 p:---- s:0131 e:000130 CFUNC :catch
c:0031 p:0009 s:0127 e:000126 BLOCK /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:231 [FINISH]
c:0030 p:---- s:0125 e:000124 CFUNC :catch
c:0029 p:0046 s:0121 e:000120 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:230
c:0028 p:0234 s:0115 e:000114 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_class.rb:169
c:0027 p:0158 s:0108 e:000107 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/console.rb:90
c:0026 p:0011 s:0105 e:000104 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/console.rb:9
c:0025 p:0092 s:0101 e:000100 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:69
c:0024 p:0033 s:0097 e:000096 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40
c:0023 p:0116 s:0093 e:000092 TOP /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands.rb:17 [FINISH]
c:0022 p:---- s:0089 e:000088 CFUNC :require
c:0021 p:0010 s:0085 e:000084 BLOCK /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247
c:0020 p:0054 s:0083 e:000082 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232
c:0019 p:0015 s:0078 e:000077 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247
c:0018 p:0056 s:0073 e:000072 TOP <redacted>/bin/rails:8 [FINISH]
c:0017 p:---- s:0071 e:000070 CFUNC :load
c:0016 p:0012 s:0066 e:000065 BLOCK /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241
c:0015 p:0054 s:0064 e:000063 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232
c:0014 p:0019 s:0059 e:000058 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241
c:0013 p:0049 s:0053 e:000052 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/commands/rails.rb:6
c:0012 p:0020 s:0050 e:000049 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/command_wrapper.rb:38
c:0011 p:0132 s:0047 e:000046 BLOCK /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:180 [FINISH]
c:0010 p:---- s:0045 e:000044 CFUNC :fork
c:0009 p:0198 s:0042 e:000041 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:153
c:0008 p:0065 s:0029 e:000028 BLOCK /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:128 [FINISH]
c:0007 p:---- s:0027 e:000026 CFUNC :loop
c:0006 p:0023 s:0024 e:000023 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:122
c:0005 p:0128 s:0021 E:001af0 TOP /Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application/boot.rb:18 [FINISH]
c:0004 p:---- s:0018 e:000017 CFUNC :require
c:0003 p:0115 s:0014 e:000013 METHOD /Users/luke/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55
c:0002 p:0007 s:0004 E:0003b8 EVAL -e:1 [FINISH]
c:0001 p:0000 s:0002 E:000108 TOP [FINISH]
-e:1:in `<main>'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `<top (required)>'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `run'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:153:in `serve'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:153:in `fork'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:180:in `block in serve'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/command_wrapper.rb:38:in `call'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/commands/rails.rb:6:in `call'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `load'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `block in load'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `load'
<redacted>/bin/rails:8:in `<top (required)>'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `block in require'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:69:in `console'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/console.rb:9:in `start'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/console.rb:90:in `start'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_class.rb:169:in `start'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:230:in `repl'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:230:in `catch'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:231:in `block in repl'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:231:in `catch'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:232:in `block (2 levels) in repl'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:232:in `loop'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:234:in `block (3 levels) in repl'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:254:in `rep'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:278:in `re'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:328:in `evaluate_ruby'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:328:in `eval'
(pry):4:in `__pry__'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/firebase-ruby-94fd0c9dcfc8/lib/firebase.rb:29:in `get'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/firebase-ruby-94fd0c9dcfc8/lib/firebase/request.rb:16:in `get'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/bundler/gems/firebase-ruby-94fd0c9dcfc8/lib/firebase/request.rb:49:in `process'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/typhoeus-0.6.9/lib/typhoeus/request/before.rb:26:in `run'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/typhoeus-0.6.9/lib/typhoeus/request/stubbable.rb:23:in `run'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/typhoeus-0.6.9/lib/typhoeus/request/block_connection.rb:31:in `run'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/typhoeus-0.6.9/lib/typhoeus/request/cacheable.rb:18:in `run'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/typhoeus-0.6.9/lib/typhoeus/request/operations.rb:16:in `run'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/ethon-0.7.1/lib/ethon/easy/operations.rb:23:in `perform'
/Users/luke/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/ethon-0.7.1/lib/ethon/easy/operations.rb:23:in `easy_perform'
-- C level backtrace information -------------------------------------------
0 ruby 0x000000010b0c2b56 rb_vm_bugreport + 134
1 ruby 0x000000010af79133 report_bug + 307
2 ruby 0x000000010af78ff4 rb_bug + 180
3 ruby 0x000000010b045cf9 sigsegv + 153
4 libsystem_platform.dylib 0x00007fff8a1965aa _sigtramp + 26
5 libdispatch.dylib 0x00007fff90968fac _dispatch_async_f_slow + 87
6 ??? 0x00007f97a5327640 0x0 + 140289288336960
Hi, I'm trying to push multiple objects using one requests but I couldn't fin a way to do this using this gem. See this SO question for reference, it's in JS but the problem is the same. It looks like it is possible to push multiple objects at once using JS, so I think should be possible using this gem.
What I want is to start from something like this:
|> container
|> -Km4sgiVoeXVx4ZLKe9a # parent_id
|> div
Then I push multiple objects. Something like firebase.push("container/#{parent_id}/div", array)
, with an array like [{ a_key: A}, { a_key: B}, { a_key: C}]
(currently this assigns the array index as ID).
Desired output:
|> container
|> -Km4sgiVoeXVx4ZLKe9a # parent_id
|> div
|> -Km8IlUaZfgrrUB5tXQt # <= This is one of the objects I want to create
|> a_key: A
|> -Km8NBTEsaM1ElVBHNfH # <= Another created object
|> a_key: B
|> -Km8NDYxTc0ldb_XV7Ti # <= Another created object
|> a_key: C
Can I accomplish this using this gem? Is there another way to do this with just one request? Thanks!
The Realtime Database just added support for conditional requests (AKA transactions) via the REST API. It'd be great if firebase-ruby supported that.
The docs for this are here: https://firebase.google.com/docs/reference/rest/database/#section-conditional-requests
/cc @caseycrogers
@oscardelben, I made some fairly serious changes, and exposed the underlying HTTP client. I think it warrants a gem cut, as people are asking for the ability to set timeout values.
The HTTPClient library default timeout is not set and it keeps on waiting forever when network issues happen. please add a timeout parameter which can be passed down
https://github.com/oscardelben/firebase-ruby/blob/master/lib/firebase/request.rb#L7
Hi, I'm currently getting sporadic timeouts when trying to use Firebase.set from either a controller or model. Pushes seem to be fine however for some reason. Everything was working perfectly on Cedar-10. Anyone else experience this?
I'm running into an issue when creating a new instance of Firebase
with our Firebase URL. I see that the addressable
gem has had reported issues (bblimke/webmock#489) with this but I'm not sure if anyone has run into this before. Even the example from the README returns this same error.
The example below I ran in rails console. Ruby 2.2.2, Rails 4.1.5, firebase-ruby 0.2.4.
base_uri = 'https://foobarbaz.firebaseio.com/'
firebase = Firebase::Client.new(base_uri)
Addressable::URI::InvalidURIError: Invalid scheme format.
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/addressable-2.3.6/lib/addressable/uri.rb:864:in `scheme='
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/addressable-2.3.6/lib/addressable/uri.rb:794:in `block in initialize'
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/addressable-2.3.6/lib/addressable/uri.rb:2238:in `call'
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/addressable-2.3.6/lib/addressable/uri.rb:2238:in `defer_validation'
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/addressable-2.3.6/lib/addressable/uri.rb:791:in `initialize'
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/addressable-2.3.6/lib/addressable/uri.rb:134:in `new'
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/addressable-2.3.6/lib/addressable/uri.rb:134:in `parse'
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/httpclient-2.4.0/lib/httpclient/util.rb:132:in `urify'
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/httpclient-2.4.0/lib/httpclient.rb:451:in `proxy='
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/httpclient-2.4.0/lib/httpclient.rb:397:in `initialize'
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/firebase-0.2.4/lib/firebase/request.rb:7:in `new'
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/firebase-0.2.4/lib/firebase/request.rb:7:in `initialize'
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/firebase-0.2.4/lib/firebase.rb:15:in `new'
from /Users/rmontgomery429/.rvm/gems/ruby-2.2.2/gems/firebase-0.2.4/lib/firebase.rb:15:in `initialize'
from (irb):8:in `new'
Am I doing it wrong? What am I missing here?
really, it's in the link:
https://stackoverflow.com/q/23527824/262852
up vote 1 down vote The solution is to use the priority field in firebase, however, the documentation for the Ruby wrapper is incorrect. The docs suggest using response = firebase.push("todos", { :name => 'Pick the milk', :priority => 1 }) The priority field is actually '.priority' and it's expecting a symbol so you'll need to use something like this instead: response = firebase.push("todos", { :name => 'Pick the milk', :".priority" => 1 })
I am using firebase 0.2.2. Although things are working, the time between push and child-added operations take 2 seconds. This is not realtime right?
I am using firebase 0.2.2 because of this #41
[DEBUG pid: 10145: 15-05-08 17:42:40 ] ETHON: Libcurl initialized
[DEBUG pid: 10145: 15-05-08 17:42:40 ] ETHON: started MULTI
[DEBUG pid: 10145: 15-05-08 17:42:42 ] ETHON: performed EASY effective_url=https://xxxxxxxxx.firebaseio.com/xxxx/xxxxx.json response_code=200 total_time=1.483105 return_code=ok
[DEBUG pid: 10145: 15-05-08 17:42:42 ] ETHON: performed MULTI
i just installed the firebase gem (gemfile contains gem 'firebase') ran bundle install and restarted my server. Using irb i'm able to run the test/demo command and see the results written to my database but using in a controller or a helper:
Firebase.base_uri = 'https://<your-firebase>.firebaseio.com/'
with my firebase url
yields:
uninitialized constant Controller::Firebase
i'm using ruby 2.0.0 and rails 4.0.1, a similar error occures if I try the same demo require command
# irb
irb(main):001:0> require 'firebase'
=> true
irb(main):002:0> Firebase.base_uri = 'https://####.firebaseio.com'
=> "https://####.firebaseio.com"
irb(main):003:0> Firebase.push("todos", { :name => 'Pick the milk', :priority => 1 })
=> #<Firebase::Request:0x007fe3c9e367c8 @response=#<Typhoeus::Response:0x007fe3c9e36f70 @options={:httpauth_avail=>0, :total_time=>0.384823, :starttransfer_time=>0.384796, :appconnect_time=>0.284113, :pretransfer_time=>0.284122, :connect_time=>0.181752, :namelookup_time=>0.133148, :effective_url=>"https://####.firebaseio.com/todos.json", :primary_ip=>"75.126.166.164", :response_code=>200, :redirect_count=>0, :return_code=>:ok, :response_headers=>"HTTP/1.1 200 OK\r\nContent-Length: 31\r\nContent-Type: application/json; charset=utf-8\r\nCache-Control: no-cache\r\n\r\n", :response_body=>"{\"name\":\"-J8hS7EzM88BkD9JOGrY\"}", :debug_info=>#<Ethon::Easy::DebugInfo:0x007fe3c9e88a50 @messages=[]>}, @request=#<Typhoeus::Request:0x007fe3c9e89e78 @base_url="https://####.firebaseio.com/todos.json", @original_options={:body=>"{\"name\":\"Pick the milk\",\"priority\":1}", :method=>:post}, @options={:body=>"{\"name\":\"Pick the milk\",\"priority\":1}", :method=>:post, :headers=>{"User-Agent"=>"Typhoeus - https://github.com/typhoeus/typhoeus"}}, @hydra=#<Typhoeus::Hydra:0x007fe3c9e8bdb8 @options={}, @max_concurrency=200, @multi=#<Ethon::Multi:0x007fe3c9e8bcc8 @timeout=#<FFI::MemoryPointer address=0x007fe3ca1feee0 size=8>, @timeval=#<Ethon::Curl::Timeval:0x007fe3c9e8b980>, @fd_read=#<Ethon::Curl::FDSet:0x007fe3c9e8b7c8>, @fd_write=#<Ethon::Curl::FDSet:0x007fe3c9e8b6b0>, @fd_excep=#<Ethon::Curl::FDSet:0x007fe3c9e8b5c0>, @max_fd=#<FFI::MemoryPointer address=0x007fe3ca049210 size=4>, @easy_handles=[], @handle=#<FFI::AutoPointer address=0x007fe3ca042850>, @running_count=0>, @queued_requests=[], @memory={}>, @response=#<Typhoeus::Response:0x007fe3c9e36f70 ...>, @on_complete=[], @on_success=[]>>>
I'm getting a lot of HTTPClient::ConnectTimeoutError
errors. Usually it happens when I try to fetch small items from my Firebase database. I get 5 errors like this a day or so.
Any guess on why I'm getting these and how would I get less of them?
Hello, whenever i try to parse some data it parses whole body , i mean with indexes like { "0" : { ...
i really don't want that indexes , so what can i do.
here is how i try to parse data :
response = @firebase.get('Statistic',:orderBy => '"Programa"',:equalTo => '"'+programa+'"',:limitToFirst => 10) Stat.getStatisticObjects(response.body)
NOTE : i tried raw body, in json it returns with that kind of indexes too, so it's still impossible form e to use data. thanks in advance.
For example,
# DELETE
parent_ref = Firebase::Client.new('https://my-firebase-db.firebaseio.com/parent')
parent_ref.delete('/child')
... this will make a delete request to 'https://my-firebase-db.firebaseio.com/child', rather than 'https://my-firebase-db.firebaseio.com/parent/child'. This is because of the way the Addressable gem, used by httpclient, concatenates a base url with a path.
Is this what is intended? I found it quite surprising.
Is there a way to authenticate? There's the firebase_token_generator gem at https://github.com/firebase/firebase-token-generator-ruby and I was curious as to how this can be used with that. Any ideas?
base_uri = 'https://fir-api-test1.firebaseio.com/'
firebase = Firebase::Client.new(base_uri)
response = firebase.push("articles", { :title => 'Pick the milk', :content => 1 })
puts "===#{response.success?}==="
puts "===#{response.code }==="
puts "===#{response.body}==="
puts "===#{response.raw_body}==="
in console
===false===
===401===
==={"error"=>"Permission denied"}===
==={
"error" : "Permission denied"
}
===
I'm running the firebase-ruby gem on Rails, which is running on Heroku. I initialize a global instance like so - #29 - but after some time I get this error when I try to update or set something on Firebase:
Errno::ECONNRESET (Connection reset by peer - SSL_connect):
app/controllers/v1/user_controller.rb:39:in `update_email'
And this is the code that fails:
$firebase.update("users/#{@user_id}", { email: @email, email_verified: nil })
What could be the issue here?
This library will not work with any version of httpclient
because the options parsing changed at some point. I'd say worth putting in a version dependency requirement in the gemspec. Maybe try >= 2.8
.
I think it will require a version past this commit
Any chance of getting set
, get
, push
and delete
as instance methods? I've come across a situation where I want to work with multiple Firebases, so having an object for each would be great.
Wonder if this could be tied in with OpalRb so that if you add this gem to a rails app that has the Opal gem it would facilitate Firebase access there as well. Or similarly simply require this in Opal for access therein when not associated with an underlying ruby base?
I don't see any support for image/media upload in gem docs.. neither in firebase rest API docs ..
is there any way i can achieve that ? upload media to firebase storage ?
I am getting this syntax error when doing a require 'firebase'
localhost ~/firebase $ irb
1.8.7-p374 :001 > require 'rubygems'
=> true
1.8.7-p374 :002 > require 'firebase'
SyntaxError: /usr/local/rvm/gems/ruby-1.8.7-p374/gems/firebase-0.2.3/lib/firebase/request.rb:7: syntax error, unexpected ':', expecting ')'
@client = HTTPClient.new(base_url: base_uri)
^
/usr/local/rvm/gems/ruby-1.8.7-p374/gems/firebase-0.2.3/lib/firebase/request.rb:34: syntax error, unexpected ':', expecting ')'
...(method, "#{path}.json", body: body, query: query_options, f...
^
/usr/local/rvm/gems/ruby-1.8.7-p374/gems/firebase-0.2.3/lib/firebase/request.rb:34: syntax error, unexpected ':', expecting '='
...ath}.json", body: body, query: query_options, follow_redirec...
^
/usr/local/rvm/gems/ruby-1.8.7-p374/gems/firebase-0.2.3/lib/firebase/request.rb:34: syntax error, unexpected ':', expecting '='
...uery_options, follow_redirect: true)
^
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:55:in `gem_original_require'
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p374/gems/firebase-0.2.3/lib/firebase.rb:2
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:135:in `gem_original_require'
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:135:in `require'
from (irb):2
Basic sinatra application crashes with the output using firebase-ruby:
Trace/BPT trap: 5
Anyone else having similar issues?
Wondering if there is a way to contact FirebaseAuth using FirebaseRuby and if this project is still being maintained?
Thanks!
Is there any way you can listen for changes made in your Firebase database with this gem? So when a new user signs up using their iPhone and that user gets saved in the database, then the I would now it in my Ruby app using this gem?
How can I call the .numChildren()
method
base_uri = 'https://demo.firebaseio.com/demo/
firebase = Firebase::Client.new(base_uri)
@currentVisitors = firebase.get("currentVisitors")
I'd like to return the number of children in currentVisitors
which is nested in firebaseio.com/demo/currentVisitors
Is there a limit to how many items I can retrieve from Firebase?
Have an interesting bug which I'm having some trouble figuring out and I thought you might have some ideas.
If I run my firebase updates directly from the main process, I don't have any problems. I see the updates go through one after the other. However, when I send my updates as part of a sidekiq process, not all the data seems to get sent into firebase.
I can see the outgoing data looks fine, but it's like firebase doesn't like the simultaneous requests coming in at the same time and chokes.
Do you know if your gem is threadsafe? I'm 99.9% sure it isn't the gem but something at their end.
Since upgrading to the latest version i.e. 0.2 from 0.1 all requests fail with the following error Could not parse auth token
.
To confirm, all requests previously worked and the data has security access open to all read/write on my example.
Is there an additional auth related step I potentially am missing?
$ gem install firebase
ERROR: Could not find a valid gem 'firebase' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/latest_specs.4.8.gz)
$ gem 'firebase', '~> 0.2.6'
ERROR: While executing gem ... (Gem::CommandLineError)
Unknown command firebase,
Hi,
I am try to initialize Firebase instance but I am getting below exception everytime
*** URI::InvalidURIError Exception: bad URI(is not URI?): {:base_url=>"https://myfirebaseapp.firebaseio.com/", :default_header=>{"Content-Type"=>"application/json"}}
Please suggest me some way how can I move out with this API
Hi, I have a Gemfile with:
gem 'firebase'
after bundle install, when I type:
require 'firebase'
I get:
irb(main):001:0> require 'firebase'
LoadError: cannot load such file -- firebase
This process works for other gems....am I missing something?
Although the documentation is not clear, these values need to have .to_json
(or equivalent) applied to their values, otherwise you get an API error while querying a collection.
Is it possible to provide a key when pushing data without Firebase generating it's own?
My firebase data looks like the following:
"receipts" : {
"123abc123" : {
"receiptid" : "fdsjfkdasfk4444r3",
"storeid" : "123abc",
"storename" : "Anita's Cheetahs",
"timestampcreated" : 1487514076000,
"total" : 9.99,
"userid" : "45YBt78mEUOSKaHuCuuTi6IBFq02"
},
"1487458237544842829" : {
"receiptid" : "1487458237544842829",
"storeid" : "123abc",
"storename" : "moe's grocery",
"timestampcreated" : 1487514076000,
"total" : 0.99,
"userid" : "yXYZa"
}
}
I trying to retrieve all receipts with a userid
equal to "yXYZa".
My ruby code looks like the following:
base_uri = 'https://*******-3e9e2.firebaseio.com/'
secret_key = "*********"
firebase = Firebase::Client.new(base_uri, secret_key)
response = firebase.get("receipts", {"userid" => "yXYZa"})
However, the response I'm getting is returning every object in receipts
.
Is my data too nested (ie. a unique ID for each object) for firebase-rails get method to work?
Hi.
There is an issue with firebase urls that causing redirect.
When the client gets redirect header for specified url it return empty body instead of fetch data from the new url that Firebase service return in the header.
This basic behavior supported in HTTParty gem.
Typhoeus is pathologically slow for me.
curl 0.000000 0.000000 0.040000 ( 0.359838)
firebase gem 0.010000 0.010000 0.020000 (120.477957)
patron 0.010000 0.000000 0.010000 ( 0.421187)
https://gist.github.com/aj0strow/699012f8014793190585
It doesn't seem like the gem does parallel requests anyway. Switch libcurl wrappers?
I'm getting an error "Function 'select' not found" in Windows 7 64 bits.
Any idea what's causing the problem?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.