Skip to content

Commit

Permalink
Address deprecation warnings from Ruby 2.7 (#45)
Browse files Browse the repository at this point in the history
```
warning: Using the last argument as keyword parameters is deprecated
```
  • Loading branch information
ashmaroli authored Dec 20, 2024
1 parent 95bfcf5 commit fd4a9a4
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
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

0 comments on commit fd4a9a4

Please sign in to comment.