christopheraue / ruby-uinput-keyboard

Ruby wrapper around uinput to create a virtual keyboard.
4 stars 0 forks source link

Maybe bundler should not be a runtime dependency. #2

Open zw963 opened 8 years ago

zw963 commented 8 years ago
./uinput-1.1.1/lib/uinput.rb:1:require 'bundler/setup'
./xkbcommon-0.1.0/test.rb:2:require 'bundler/setup'
./uinput-keyboard-0.3/lib/uinput/keyboard.rb:1:require 'bundler/setup'
./lib/uinput/device.rb:1:require 'bundler/setup'
./lib/uinput/keyboard.rb:1:require 'bundler/setup'
./lib/uinput.rb:1:require 'bundler/setup'

I think is gem is general use for all rubyist, not only for rails. rvm is not install bundler automatically, so when run those gem, will cause following error:

/home/zw963/.rvm/rubies/ruby-2.2.4/lib64/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- bundler/setup (LoadError)

remove those line should be save.

When in development, only need use Gemfile, bundler will manage all for us. require bundler/setup manually in code is no need at all.

christopheraue commented 8 years ago

bundler is independent from rails. require 'bundler/setup' sets up the load path for the bundle. Here it's done so the _linuxinput gem can be required.

But you are right, that it should probably be somewhere else (i.e. the script using the gem). It's also inconsistent right now. Bundler is included as development dependency but used in runtime code.

zw963 commented 8 years ago

bundler is independent from rails. require 'bundler/setup' sets up the load path for the bundle.

As i know, if you use Gemfile, you not need add any bundler/setup in your's rubycode except Gemfile.

It's also inconsistent right now. Bundler is included as development dependency but used in runtime code.

I think bundler is only need on development, in this case, you have code first, and need bundler to install all dependency, when I need one gem and don't care source code, i will install this will gem install GEMNAME, in this case, i think the dependency should be resolve by gemspec.

BTW: this issue is because I never use a (non-rails) ruby gems which add bundler as runtime dependency.

Thanks.