Class: TeXzip::Project::FilePath
- Inherits:
-
Object
- Object
- TeXzip::Project::FilePath
- Defined in:
- lib/texzip/Project.rb
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #extname ⇒ Object
- #file ⇒ Object
- #hash ⇒ Object
-
#initialize(root_dir, file) ⇒ FilePath
constructor
A new instance of FilePath.
- #out_file=(file) ⇒ Object
- #output_path ⇒ Object
- #path ⇒ Object
- #set_output_directory(dir) ⇒ Object
- #set_plain_output_directory(dir) ⇒ Object
Constructor Details
#initialize(root_dir, file) ⇒ FilePath
Returns a new instance of FilePath.
20 21 22 23 24 25 |
# File 'lib/texzip/Project.rb', line 20 def initialize(root_dir, file) @root_dir = Pathname.new(root_dir). @file = Pathname.new(file) @file = @root_dir.join(file)..relative_path_from(@root_dir) @out_file = @file end |
Instance Method Details
#eql?(other) ⇒ Boolean
60 61 62 |
# File 'lib/texzip/Project.rb', line 60 def eql?(other) path.to_s.eql? other.path.to_s end |
#extname ⇒ Object
52 53 54 |
# File 'lib/texzip/Project.rb', line 52 def extname @file.extname end |
#file ⇒ Object
36 37 38 |
# File 'lib/texzip/Project.rb', line 36 def file @file end |
#hash ⇒ Object
56 57 58 |
# File 'lib/texzip/Project.rb', line 56 def hash path.to_s.hash end |
#out_file=(file) ⇒ Object
40 41 42 |
# File 'lib/texzip/Project.rb', line 40 def out_file=(file) @out_file = Pathname.new(file) end |
#output_path ⇒ Object
44 45 46 |
# File 'lib/texzip/Project.rb', line 44 def output_path @out_dir.join(@out_file). end |
#path ⇒ Object
48 49 50 |
# File 'lib/texzip/Project.rb', line 48 def path @root_dir.join(@file). end |
#set_output_directory(dir) ⇒ Object
27 28 29 |
# File 'lib/texzip/Project.rb', line 27 def set_output_directory(dir) @out_dir = Pathname.new(dir). end |
#set_plain_output_directory(dir) ⇒ Object
31 32 33 34 |
# File 'lib/texzip/Project.rb', line 31 def set_plain_output_directory(dir) set_output_directory dir @out_file = @file.basename end |