Skip to content

Commit 46e6525

Browse files
committed
directory_path should be private
1 parent e3ec579 commit 46e6525

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/jekyll-admin/path_helper.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def renamed?
4848
ensure_leading_slash(request_payload["path"]) != relative_path
4949
end
5050

51+
private
52+
5153
# Returns the path to the requested file's containing directory
5254
def directory_path
5355
case namespace
@@ -60,8 +62,6 @@ def directory_path
6062
end
6163
end
6264

63-
private
64-
6565
def ensure_leading_slash(input)
6666
return input if input.nil? || input.empty? || input.start_with?("/")
6767
"/#{input}"

spec/jekyll-admin/path_helper_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ def collection
8080
end
8181

8282
it "knows the directory path" do
83-
expect(subject.directory_path).to eql("#{site_source}/")
83+
expect(subject.send(:directory_path)).to eql("#{site_source}/")
8484
end
8585

8686
context "subdir" do
8787
let(:splat) { ["foo"] }
8888

8989
it "knows the directory path" do
90-
expect(subject.directory_path).to eql("#{site_source}/foo")
90+
expect(subject.send(:directory_path)).to eql("#{site_source}/foo")
9191
end
9292

9393
it "returns the path" do
@@ -107,7 +107,7 @@ def collection
107107
let(:namespace) { "collections" }
108108

109109
it "knows the directory path" do
110-
expect(subject.directory_path).to eql("#{site_source}/_puppies")
110+
expect(subject.send(:directory_path)).to eql("#{site_source}/_puppies")
111111
end
112112

113113
it "returns the path" do

0 commit comments

Comments
 (0)