Hello,
I'm pretty sure I'm just daft... but how do I leverage your gem from other locations?
This seems to work:
$ cd ~
$ git clone https://github.com/biow0lf/eve_online.git
$ cd eve_online
$ bundle exec bin/setup
Resolving dependencies...
Using rake 12.0.0
Using abstract_type 0.0.7
Using concurrent-ruby 1.0.5
Using i18n 0.8.1
Using minitest 5.10.2
Using thread_safe 0.3.6
Using ice_nine 0.11.2
Using equalizer 0.0.11
Using ast 2.3.0
Using awesome_print 1.7.0
Using bundler 1.14.0
Using docile 1.1.5
Using json 2.1.0
Using simplecov-html 0.10.0
Using coderay 1.1.1
Using diff-lcs 1.2.5
Using multipart-post 2.0.0
Using memoist 0.15.0
Using nori 2.6.0
Using method_source 0.8.2
Using mini_portile2 2.1.0
Using procto 0.0.3
Using parallel 1.11.2
Using regexp_parser 0.3.6
Using rspec-support 3.5.0
Using powerpack 0.1.1
Using slop 3.6.0
Using rb-readline 0.5.4
Using ruby-progressbar 1.8.1
Using unicode-display_width 1.2.1
Using rainbow 2.2.2
Using tzinfo 1.2.3
Using memoizable 0.4.2
Using parser 2.3.3.1
Using simplecov 0.13.0
Using faraday 0.12.1
Using nokogiri 1.7.2
Using rspec-core 3.5.4
Using rspec-expectations 3.5.0
Using rspec-mocks 3.5.0
Using pry 0.10.4
Using activesupport 5.1.0
Using adamantium 0.2.0
Using rubocop 0.48.1
Using codeclimate-test-reporter 1.0.8
Using rspec-its 1.2.0
Using rspec 3.5.0
Using eve_online 0.11.0 from source at `.`
Using anima 0.3.0
Using concord 0.1.5
Using morpher 0.2.6
Using unparser 0.2.5
Using mutant 0.8.12
Using mutant-rspec 0.8.11
Bundle complete! 14 Gemfile dependencies, 54 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
$ bundle exec bin/console
[1] pry(main)> EveOnline::XML::ServerStatus.new.online_players
=> 21467
(I'm including the full list of gems installed, I had initially done a # ... snip
but the only real difference I can find between running the test script in the root of eve_online
gem and running it with a dedicated gemfile)
And when I'm in the root of the gem the same seems to work:
$ pwd
/home/maraaaa/eve_online
$ cat > test.rb<<EOF
#!/usr/bin/env ruby
require 'eve_online'
puts EveOnline::XML::ServerStatus.new.online_players
EOF
But when I try to include it from my own project, I get a uninitialized constant EveOnline::XML::ServerStatus
error.
$ cd ~
$ mkdir eve_online_test
$ cd eve_online_test
$ cat > Gemfile <<EOF
source 'https://rubygems.org'
gem 'eve_online'
gem 'nokogiri'
EOF
$ cat > test.rb <<EOF
#!/usr/bin/env ruby
require 'bundler/setup'
require 'eve_online'
status = EveOnline::XML::ServerStatus.new
EOF
$ chmod +x test.rb
$ bundle
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Using concurrent-ruby 1.0.5
Using i18n 0.8.1
Using minitest 5.10.2
Using thread_safe 0.3.6
Using multipart-post 2.0.0
Using json 2.1.0
Using memoist 0.15.0
Using nori 2.6.0
Using mini_portile2 2.1.0
Using bundler 1.14.0
Using tzinfo 1.2.3
Using faraday 0.12.1
Using nokogiri 1.7.2
Using activesupport 5.1.0
Using eve_online 0.11.0
Bundle complete! 2 Gemfile dependencies, 15 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
$ bundle exec ./test.rb
bundler: failed to load command: ./test.rb (./test.rb)
NameError: uninitialized constant EveOnline::XML::ServerStatus
/home/maraaaa/eve_online_test/test.rb:6:in `<top (required)>'
I'm sort of a Ruby newbie, (ha! that rhymes!) so I'm sure I'm missing something obvious... but I am at this point stumped.
For sure the gem is being loaded:
$ cat > test2.rb <<EOF
#!/usr/bin/env ruby
require 'bundler/setup'
require 'eve_online'
puts Gem.loaded_specs.keys.grep 'eve_online'
EOF
and as far as I can tell eve_online/lib/eve_online.rb
requires
all of the sub modules.
What am I missing?
Off topic...
Are you open to pull requests? We're looking to do some work with the ESI API that your library doesn't yet cover. And rather than reinvent the wheel looks like you've got a good framework to enable further ESI endpoints.
Thanks!
@maraaaa
Gory details:
- OS: CentOS 7.3.1611
- Ruby Version: ruby 2.3.1p112
- Bundler version: 1.14.0