StefanoMartin / ArangoRB

A Gem for ArangoDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arango::Replication (NameError)

jdar opened this issue · comments

~/src/sample
❯ vi Gemfile

~/src/sample
❯ bundle
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Using connection_pool 2.2.2
Using multi_xml 0.6.0
Using httparty 0.14.0
Using oj 3.6.13
Using arangorb 2.0.0
Using awesome_print 1.8.0
Using bundler 1.17.3
Using byebug 11.0.0
Using coderay 1.1.2
Using diff-lcs 1.3
Using method_source 0.9.2
Using pry 0.12.2
Using pry-byebug 3.7.0
Using rspec-support 3.8.0
Using rspec-core 3.8.0
Using rspec-expectations 3.8.2
Using rspec-mocks 3.8.0
Using rspec 3.8.0
Bundle complete! 7 Gemfile dependencies, 18 gems now installed.
Use bundle info [gemname] to see where a bundled gem is installed.

~/src/sample
❯ be ruby examples/replication_year.rb
Traceback (most recent call last):
1: from examples/replication_year.rb:12:in <main>' /usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/Database.rb:303:in replication': uninitialized constant Arango::Replication (NameError)

(where be is bundle exec)

❯ be ruby -v examples/replication_year.rb
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18]
/usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi/cookie.rb:2: warning: loading in progress, circular require considered harmful - /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi/util.rb
from examples/replication_year.rb:5:in <main>' from examples/replication_year.rb:5:in require'
from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/arangorb.rb:1:in <top (required)>' from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/arangorb.rb:1:in require'
from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/httparty-0.14.0/lib/httparty.rb:9:in <top (required)>' from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/httparty-0.14.0/lib/httparty.rb:9:in require'
from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/erb.rb:15:in <top (required)>' from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/erb.rb:15:in require'
from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi/util.rb:2:in <top (required)>' from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi/util.rb:2:in require'
from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi.rb:294:in <top (required)>' from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi.rb:294:in require'
from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi/cookie.rb:2:in <top (required)>' from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi/cookie.rb:2:in require'
/usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi.rb:295: warning: loading in progress, circular require considered harmful - /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi/util.rb
from examples/replication_year.rb:5:in <main>' from examples/replication_year.rb:5:in require'
from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/arangorb.rb:1:in <top (required)>' from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/arangorb.rb:1:in require'
from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/httparty-0.14.0/lib/httparty.rb:9:in <top (required)>' from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/httparty-0.14.0/lib/httparty.rb:9:in require'
from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/erb.rb:15:in <top (required)>' from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/erb.rb:15:in require'
from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi/util.rb:2:in <top (required)>' from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi/util.rb:2:in require'
from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi.rb:295:in <top (required)>' from /usr/local/var/rbenv/versions/2.5.3/lib/ruby/2.5.0/cgi.rb:295:in require'
/usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/helpers/Return.rb:5: warning: statement not reached
/usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/Server.rb:123: warning: assigned but unused variable - hash
/usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/Server.rb:234: warning: assigned but unused variable - body
/usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/Server.rb:458: warning: statement not reached
/usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/Collection.rb:377: warning: shadowing outer local variable - result
/usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/Collection.rb:403: warning: shadowing outer local variable - result
/usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/Collection.rb:517: warning: method redefined; discarding old documentByName
/usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/Collection.rb:485: warning: previous definition of documentByName was here
/usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/Foxx.rb:115: warning: assigned but unused variable - query
/usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/Server.rb:25: warning: instance variable @async not initialized
/usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/Server.rb:25: warning: instance variable @async not initialized
Traceback (most recent call last):
1: from examples/replication_year.rb:12:in <main>' /usr/local/var/rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/arangorb-2.0.0/lib/Database.rb:303:in replication': uninitialized constant Arango::Replication (NameError)

Thank you for your concern @jdar.

As you have noticed that examples is a work in progress that needs huge testing. However thank you to your input I was able to find some bugs on replication.

I push a hotfix on Github. If you want to test it, please clone this repository on your pc and do the following steps.

gem uninstall arangorb
gem build ArangoRB.gemspec
gem install arangorb-2.0.1.gem

If you find other bugs, please contact me again.
I will push this hotfix on rubygems next week if no other bug are found.
I leave this issue open at the moment.

I published the gem. I close this issue, feel free to reopen if you find any issue.