I am using ruby version 2.0.0, I made some custom logo in a text file called logo.txt as follows:
_____
| |
|_____|
|
|
|
Now I created a gem named "custom" and placed this file under lib / logo.txt. Now I want to print this file in my script under a ruby stone, so I wrote this way.
file = File.open("lib/logo.txt")
contents = file.read
puts "#{contents}"
But the above code creates errors, for example:
/usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/custom-0.0.1/lib/custom/custom.rb:1551:in `initialize': No such file or directory - lib/logo.txt (Errno::ENOENT)
I include this logo.txt file in gemspec as shown below:
Gem::Specification.new do |s|
s.name = "custom"
s.version = VERSION
s.author = "Custom Wear"
s.email = "custom@custom.com"
s.homepage = "http://custom.com"
s.summary = "custom wera"
s.description = File.read(File.join(File.dirname(__FILE__), 'README'))
s.license = 'ALL RIGHTS RESERVED'
s.files = [""lib/custom.rb", "lib/custom/custom.rb", "lib/custom /version.rb","lib/logo.txt"]
s.test_files = Dir["spec*"]
s.executables = [ 'custom' ]
s.require_paths << 'lib/'
source
share