JAkk
JAkk

Reputation: 1326

Get path to Ruby gem

I'm actually writing my own Ruby gem. It is yet not packed and under development.

How can I get the path to the files within the Gem and how can I get the path from where the gem is called from?

Upvotes: 0

Views: 387

Answers (1)

Hauleth
Hauleth

Reputation: 23556

To get path where gem is:

File.expand_path(File.join(File.dirname(__FILE__), '..'))

Where gem is called from:

current_dir = Dir.pwd

Upvotes: 1

Related Questions