Skip to content

Commit

Permalink
Use Pathname#new instead of Pathname()
Browse files Browse the repository at this point in the history
Although it [works the same way], `Pathname(...)` is an unfamiliar and
surprising syntax.

This commit changes all occurrences to use the constructor.

[works the same way]: https://ruby-doc.org/stdlib-2.1.2/libdoc/pathname/rdoc/Pathname.html#method-i-each_child
  • Loading branch information
seanpdoyle committed Jun 9, 2017
1 parent 2729537 commit 47e9b46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/ember_cli/path_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def ember
$ cd #{root}
$ #{package_manager} install
MSG
end
end
Expand All @@ -65,7 +66,7 @@ def bower
bower_path = app_options.fetch(:bower_path) { which("bower") }

bower_path.tap do |path|
unless Pathname(path.to_s).executable?
unless Pathname.new(path.to_s).executable?
fail DependencyError.new <<-MSG.strip_heredoc
Bower is required by EmberCLI
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/ember_cli/app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

describe "#root_path" do
it "delegates to PathSet" do
root_path = Pathname(".")
root_path = Pathname.new(".")
stub_paths(root: root_path)
app = EmberCli::App.new("foo")

Expand All @@ -55,7 +55,7 @@

describe "#dist_path" do
it "delegates to PathSet" do
dist_path = Pathname(".")
dist_path = Pathname.new(".")
stub_paths(dist: dist_path)
app = EmberCli::App.new("foo")

Expand Down

0 comments on commit 47e9b46

Please sign in to comment.