ivalkeen / guard-ctags-bundler

Guard gem for generating ctags for project files and gems from project's bundle.
https://github.com/ivalkeen/guard-ctags-bundler
MIT License
108 stars 24 forks source link

Ctags stdlib #11

Closed rizzatti closed 12 years ago

rizzatti commented 12 years ago

Ivan, I started using your gem a few days ago, and it's really nice to be able to have the ctags process automated.

One thing I noticed while using it was that some completions though would be weird, or not found at all, until I realised that there was part of the class hierarchy missing from ctags.

This is a simple attempt to fix it. Let me know if you think this would be worth integrating.

rizzatti commented 12 years ago

@ivalkeen I noticed now it actually came on top #10, but I can change it later. I'll wait for your input first.

ivalkeen commented 12 years ago

I like your idea, thank you. But I have some troubles with retrieving libdir. I managed to set up Travis CI and it shows that using this path RbConfig::CONFIG['libdir'] works in rubinius, but doesn't work in MRI and JRuby, because it all gems are stored under this path. I found, that for MRI and JRuby RbConfig::CONFIG['rubylibdir'] works fine, but I doesn't work in Rubinius. It seems that MRI and Rubinius have different folder structure. As far as MRI is more important for me, I'll leave rubylibdir for now. And let's think, how to make it work under all rubies.

rizzatti commented 12 years ago

@ivalkeen cool. I saw you setup Travis earlier, good thinking. I wasn't really concerned about the others, but that's one of the reasons I thought it should be an option, instead of running always. I thought I had it right with libdir, testing on MRI 1.8 and 1.9, but we might need to make the tests a bit more extensive.

ivalkeen commented 12 years ago

For me, even existing tests fail (with libdir), if I setup Guard or Guard-Ctags-Bundler gem globally. Because in my setup (I use rbenv), the path that is returned by libdir is /home/ivan/.rbenv/versions/1.9.3-p194/lib. And this path also contains ./ruby/gems folder with all globally installed gems, so tags from all globally installed gems go right to stdlib.tags and your test fails. But if I use rubylibdir, it returns /home/ivan/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1, which contains only stdlib files, so tests pass. But this doesn't work for rubinius. Could you check, if your setup works the same for libdir and rubylibdir?

rizzatti commented 12 years ago

Oh, I guess that's because I use rvm then. The gems stay inside another dir structure.

zeh@ablon:~ % gem env | grep 'GEM PATHS' -A 2  
- GEM PATHS:
     - /Users/zeh/.rvm/gems/ruby-1.9.3-p194
     - /Users/zeh/.rvm/gems/ruby-1.9.3-p194@global
zeh@ablon:~ % ruby -e "puts RbConfig::CONFIG['libdir']"
/Users/zeh/.rvm/rubies/ruby-1.9.3-p194/lib
ivalkeen commented 12 years ago

OK, so it is rbenv issue. And does my current version (with rubylibdir) work for you well?

rizzatti commented 12 years ago

@ivalkeen no, rvm is the one who is different. Checking again my dir structure, rubylibdir definitely looks like the right choice.

ivalkeen commented 12 years ago

Travis uses rvm too, and rubylibdir works there for MRI. Ok, let's leave rubylibdir, at least it works for MRI with both rbenv and rvm.

ivalkeen commented 12 years ago

@zehrizzatti does current master version work OK for you? If yes, I'll bump version and release new gem.

rizzatti commented 12 years ago

@ivalkeen yes, just checked it and everything seems ok.

ivalkeen commented 12 years ago

@zehrizzatti, thanks for your help! I added small hack for rubinius and released new version.