Skip to content

Commit 6fdc1c1

Browse files
dblockCopilot
andcommitted
Fix NameError: undefined local variable or method 'project_path' in verbose mode
In verbose mode, Fui::Project#bridging_headers referenced `project_path` which does not exist. The correct method is `path`, already available as an attr_accessor on the instance. Fixes #42. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 862bc11 commit 6fdc1c1

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
* [#45](https://github.com/dblock/fui/pull/45): Migrated from Travis CI to GitHub Actions with danger-pr-comment workflow - [@dblock](https://github.com/dblock).
44
* [#37](https://github.com/dblock/fui/issues/37): Fixed `ArgumentError: invalid byte sequence in UTF-8` when processing files with non-UTF-8 encoding - [@dblock](https://github.com/dblock).
5+
* [#42](https://github.com/dblock/fui/issues/42): Fixed `NameError: undefined local variable or method 'project_path'` in verbose mode - [@dblock](https://github.com/dblock).
56
* Your contribution here.
67

78
### 0.5.0 (2018/12/19)

lib/fui/project.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def bridging_headers(verbose)
2222

2323
path_tokens = tokens[1].split('/')
2424
bridging_header = path_tokens[path_tokens.length - 1]
25-
puts "Bridging Header Found: #{bridging_header} in #{project_path}." if verbose
25+
puts "Bridging Header Found: #{bridging_header} in #{path}." if verbose
2626
bridging_headers << bridging_header
2727
end
2828
bridging_headers.uniq

spec/fui/project_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
project = Fui::Project.new(@fixture)
2525
expect(project.bridging_headers(false)).to eq(['BridgingHeaderSpec-Bridging-Header.h'])
2626
end
27+
it 'bridging headers are found in verbose mode' do
28+
project = Fui::Project.new(@fixture)
29+
expect { project.bridging_headers(true) }.not_to raise_error
30+
end
2731
end
2832
describe '#bridging_headers' do
2933
before :each do

0 commit comments

Comments
 (0)