GithubHelp home page GithubHelp logo

manpages's Issues

Find man pages and copy them

After a gem is installed, we need to find out if it has a man page (example in gem-man) and
copy the file to BIN_DIR/../share/man . We also need to create the directory structure inside of the share/man to match the section number of that man page ( share/man/man1 ... ) .

Uninstall man pages

If a gem is uninstalled, remove the symlink if it is the version that is deleted now

Do not overwrite man files

If a man file already exists, check if you need to overwrite it. We only overwrite symlinks that are already present and point to the gem directory.

Can't see man pages after installation

$ ruby --version
ruby 2.3.2p217 (2016-11-15 revision 56796) [x86_64-linux]

$ gem --version
2.6.8

$ gem list

*** LOCAL GEMS ***

bigdecimal (default: 1.2.8)
io-console (default: 0.4.5)
json (default: 1.8.3)
psych (default: 2.1.0)
rdoc (default: 4.2.1)

$ gem install manpages
Fetching: manpages-0.5.2.gem (100%)
Successfully installed manpages-0.5.2
1 gem installed

$ gem install gem-man
Fetching: gem-man-0.3.0.gem (100%)
Successfully installed gem-man-0.3.0
1 gem installed

$ man gem-man
No existe entrada de manual para gem-man

$ # mmmm, maybe it's not done on installation and I need to generate them?

$ gem manpages --update-all
Installing man pages for gem-man 0.3.0

$ # Nice, it looks like something good was done

$ man gem-man
No existe entrada de manual para gem-man

$ # But still can't see man pages, maybe it's something with my "man setup"?

Can't set it up in ruby 2.3.2

I wanted to try this gem, but couldn't get it working.

$ ruby-install ruby 2.3.2
# ... lots of output
>>> Successfully installed ruby 2.3.2 into /home/deivid/.rubies/ruby-2.3.2

$ source ~/.profile

$ chruby 2.3.2

$ ruby --version
ruby 2.3.2p217 (2016-11-15 revision 56796) [x86_64-linux]

$ gem install manpages && gem manpages --update-all
Error loading RubyGems plugin "/home/deivid/.gem/ruby/2.3.2/gems/manpages-0.5.1/lib/rubygems_plugin.rb": cannot load such file -- rubygems/gem/specification (LoadError)
Successfully installed manpages-0.5.1
1 gem installed
Error loading RubyGems plugin "/home/deivid/.gem/ruby/2.3.2/gems/manpages-0.5.1/lib/rubygems_plugin.rb": cannot load such file -- rubygems/gem/specification (LoadError)
ERROR:  While executing gem ... (Gem::CommandLineError)
    Unknown command manpages

Maybe it needs a more recent rubygems?

$ gem --version
Error loading RubyGems plugin "/home/deivid/.gem/ruby/2.3.2/gems/manpages-0.5.1/lib/rubygems_plugin.rb": cannot load such file -- rubygems/gem/specification (LoadError)
2.5.2

$ gem update --system
Error loading RubyGems plugin "/home/deivid/.gem/ruby/2.3.2/gems/manpages-0.5.1/lib/rubygems_plugin.rb": cannot load such file -- rubygems/gem/specification (LoadError)
Updating rubygems-update
Fetching: rubygems-update-2.6.8.gem (100%)
Successfully installed rubygems-update-2.6.8
Installing RubyGems 2.6.8
Error loading RubyGems plugin "/home/deivid/.gem/ruby/2.3.2/gems/manpages-0.5.1/lib/rubygems_plugin.rb": cannot load such file -- rubygems/gem/specification (LoadError)
RubyGems 2.6.8 installed
# ... ChangeLog here

$ gem uninstall manpages
Error loading RubyGems plugin "/home/deivid/.gem/ruby/2.3.2/gems/manpages-0.5.1/lib/rubygems_plugin.rb": cannot load such file -- rubygems/gem/specification (LoadError)
Successfully uninstalled manpages-0.5.1

$ gem --version
2.6.8

$ gem install manpages && gem manpages --update-all
Fetching: manpages-0.5.1.gem (100%)
Successfully installed manpages-0.5.1
1 gem installed
Error loading RubyGems plugin "/home/deivid/.gem/ruby/2.3.2/gems/manpages-0.5.1/lib/rubygems_plugin.rb": cannot load such file -- rubygems/gem/specification (LoadError)
ERROR:  While executing gem ... (Gem::CommandLineError)
    Unknown command manpages

Same thing... :(

My gem env

RubyGems Environment:
  - RUBYGEMS VERSION: 2.6.8
  - RUBY VERSION: 2.3.2 (2016-11-15 patchlevel 217) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/deivid/.gem/ruby/2.3.2
  - USER INSTALLATION DIRECTORY: /home/deivid/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /home/deivid/.rubies/ruby-2.3.2/bin/ruby
  - EXECUTABLE DIRECTORY: /home/deivid/.gem/ruby/2.3.2/bin
  - SPEC CACHE DIRECTORY: /home/deivid/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /home/deivid/.rubies/ruby-2.3.2/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/deivid/.gem/ruby/2.3.2
     - /home/deivid/.rubies/ruby-2.3.2/lib/ruby/gems/2.3.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/deivid/.gem/ruby/2.3.2/bin
     - /home/deivid/.rubies/ruby-2.3.2/lib/ruby/gems/2.3.0/bin
     - /home/deivid/.rubies/ruby-2.3.2/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games
     - /usr/local/games
     - /home/deivid/.cabal/bin
     - /usr/local/texlive/2015/bin/x86_64-linux
     - /home/deivid/.local/bin

Thanks!

Add rbenv hook

For rbenv we need to change the MANPATH environment variable and make it point to the correct directory. This is done using hooks in rbenv. Sadly rbenv does not override the
cd command. Because of that we only have the execute hook that will let us change the dir after/before a command is executed. Meaning the man page will be found after the command was run first.

File.expand_path

hi!

You should be able to replace the File.join on line 8 and File.absolute_path(File.join(...)) on line 16 with File.expand_path

E.g.,

  target_dir = File.expand_path(installer.bin_dir, "../share/man")

and

  target_dir = File.expand_path(bin_dir, "../share/man")

Add rvm hook

For rvm we need to add a hook at each version change to manipulate the MANPATH environment variable to point to the correct version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.