Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address deprecation warnings from Ruby 2.7 #45

Merged
merged 1 commit into from
Dec 20, 2024
Merged
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
2 changes: 1 addition & 1 deletion lib/jekyll-admin/apiable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def mtime
end

def file_contents
@file_contents ||= File.read(file_path, file_read_options) if file_exists?
@file_contents ||= File.read(file_path, **file_read_options) if file_exists?
end

def file_read_options
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-admin/server/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def entries
:splat => params["splat"].first,
}
# get the directories inside the requested directory
directory = JekyllAdmin::Directory.new(directory_path, args)
directory = JekyllAdmin::Directory.new(directory_path, **args)
directories = directory.directories
# merge directories with the documents at the same level
directories.concat(directory_docs.sort_by(&:date).reverse)
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-admin/server/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def parsed_configuration
def raw_configuration
File.read(
configuration_path,
Jekyll::Utils.merged_file_read_opts(site, {})
**Jekyll::Utils.merged_file_read_opts(site, {})
)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-admin/server/data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def entries
:splat => splats.first,
}
# get all directories inside the requested directory
directory = JekyllAdmin::Directory.new(directory_path, args)
directory = JekyllAdmin::Directory.new(directory_path, **args)
directories = directory.directories

# exclude root level directories which do not have data files
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-admin/server/draft.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def entries
:splat => params["splat"].first,
}
# get the directories inside the requested directory
directory = JekyllAdmin::Directory.new(directory_path, args)
directory = JekyllAdmin::Directory.new(directory_path, **args)
directories = directory.directories

# exclude root level directories which do not have drafts
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-admin/server/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def entries
:splat => params["splat"].first,
}
# get all directories inside the requested directory
directory = JekyllAdmin::Directory.new(directory_path, args)
directory = JekyllAdmin::Directory.new(directory_path, **args)
directories = directory.directories

# exclude root level directories which do not have pages
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-admin/server/static_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def entries
:splat => params["splat"].first,
}
# get all directories inside the requested directory
directory = JekyllAdmin::Directory.new(directory_path, args)
directory = JekyllAdmin::Directory.new(directory_path, **args)
directories = directory.directories

# exclude root level directories which do not have static files
Expand Down
4 changes: 2 additions & 2 deletions lib/jekyll-admin/server/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def dirs
:content_type => "templates",
:splat => splats.first,
}
Directory.new(directory_path, args).directories
Directory.new(directory_path, **args).directories
end

def template_directories
Expand Down Expand Up @@ -173,7 +173,7 @@ def ensure_requested_file

def file_contents(file = requested_file)
@file_contents ||= File.read(
file, Jekyll::Utils.merged_file_read_opts(site, {})
file, **Jekyll::Utils.merged_file_read_opts(site, {})
)
end

Expand Down
4 changes: 2 additions & 2 deletions lib/jekyll-admin/server/theme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def entries
:content_type => "theme",
:splat => splats.first,
}
Directory.new(directory_path, args).directories
Directory.new(directory_path, **args).directories
end

def subdir_entries
Expand Down Expand Up @@ -130,7 +130,7 @@ def exist_at_source?
end

def raw_content
File.read(file_path, Jekyll::Utils.merged_file_read_opts(site, {}))
File.read(file_path, **Jekyll::Utils.merged_file_read_opts(site, {}))
end
end
end
Expand Down
Loading