Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/hologram/doc_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def self.from_yaml(yaml_file, extra_args = [])
end

def self.setup_dir
if File.exists?("hologram_config.yml")
if File.exist?("hologram_config.yml")
DisplayMessage.warning("Cowardly refusing to overwrite existing hologram_config.yml")
return
end
Expand Down Expand Up @@ -250,18 +250,18 @@ def write_page(file_name, body, binding)
def set_header_footer
# load the markdown renderer we are going to use

if File.exists?("#{doc_assets_dir}/_header.html")
if File.exist?("#{doc_assets_dir}/_header.html")
@header_erb = ERB.new(File.read("#{doc_assets_dir}/_header.html"))
elsif File.exists?("#{doc_assets_dir}/header.html")
elsif File.exist?("#{doc_assets_dir}/header.html")
@header_erb = ERB.new(File.read("#{doc_assets_dir}/header.html"))
else
@header_erb = nil
DisplayMessage.warning("No _header.html found in documentation assets. Without this your css/header will not be included on the generated pages.")
end

if File.exists?("#{doc_assets_dir}/_footer.html")
if File.exist?("#{doc_assets_dir}/_footer.html")
@footer_erb = ERB.new(File.read("#{doc_assets_dir}/_footer.html"))
elsif File.exists?("#{doc_assets_dir}/footer.html")
elsif File.exist?("#{doc_assets_dir}/footer.html")
@footer_erb = ERB.new(File.read("#{doc_assets_dir}/footer.html"))
else
@footer_erb = nil
Expand Down
2 changes: 1 addition & 1 deletion lib/hologram/doc_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def build_output(doc_blocks, output_file = nil, depth = 1)
end

def is_supported_file_type?(file)
@supported_extensions.include?(File.extname(file)) and !Dir.exists?(file)
@supported_extensions.include?(File.extname(file)) and !Dir.exist?(file)
end

def get_file_name(str)
Expand Down
2 changes: 1 addition & 1 deletion lib/hologram/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

module Hologram
VERSION = "1.4.0"
VERSION = "1.4.1"
end
4 changes: 2 additions & 2 deletions spec/doc_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@
end

it 'creates a config file' do
expect(File.exists?('hologram_config.yml')).to be_truthy
expect(File.exist?('hologram_config.yml')).to be_truthy
end

it 'creates default assets' do
Dir.chdir('doc_assets') do
['_header.html', '_footer.html'].each do |asset|
expect(File.exists?(asset)).to be_truthy
expect(File.exist?(asset)).to be_truthy
end
end
end
Expand Down