fui 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca2369b75631de675a012aa298db4edc1976fba82ca689411be60347be016525
4
- data.tar.gz: 179e9195e0ededab573b0dee845cb4c60b766ce3e64cf001bf86d6be8a937c8e
3
+ metadata.gz: 3b2fed3007eea591e143ba3feb0510c01aa6c95b03d002c64c9b14774cc075d2
4
+ data.tar.gz: 41c89d4dfe79c209d4dd92c9b5fad7fea4a72afc8b7c13f1a1bd2238d02f3f96
5
5
  SHA512:
6
- metadata.gz: 8f2b6927e03089fee397a11ea73ce511c88ddbbe15652e106e4f1801fc677351f10f90cb39734bb2279cdda003e8c577108c9efab324a3dfe848b90c01133745
7
- data.tar.gz: 2039608e5a2394039f3d576838da7e7324cdd8588bdca12cb15570a3d729446885568d2e1e3d05fd7777a9e9313d3f500c775368eb77a667a3495c470e5928cf
6
+ metadata.gz: 30cb12a339d0c0a0dfb2d4808ede925eaacdf466d200006f61c58ed0c0d70e3bd0148efa61e8d8bdea94e0a21855113ebc7aa51f70f24d6f442ab18477993373
7
+ data.tar.gz: cbf0cd4dddfc554350a53587b56a5681891994912c5eaa1eca965190ad00d3c2c122c4a08bf999111e3e648a437fd536c7a88c42302034ac6d96d85ec8cb8571
data/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ### 0.7.0 (2026/11/25)
2
+
3
+ * [#53](https://github.com/dblock/fui/pull/53): Test on Ruby 2.7, 3.4, and 4.0 with a `matrix.entry` matrix and current GitHub Actions - [@dblock](https://github.com/dblock).
4
+ * [#54](https://github.com/dblock/fui/pull/54): Lint Markdown, YAML, and spelling with rubocop-md, rubocop-prose, rubocop-spellcheck, and rubocop-yaml in a separate Lint workflow, and clean up documentation - [@dblock](https://github.com/dblock).
5
+ * [#55](https://github.com/dblock/fui/pull/55): Run CI pushes only on the default branch, cancel superseded pull request runs, and bound job times - [@dblock](https://github.com/dblock).
6
+ * [#56](https://github.com/dblock/fui/pull/56): Update Danger to the danger/danger-pr-comment 0.3.0 workflows and gem - [@dblock](https://github.com/dblock).
7
+ * [#62](https://github.com/dblock/fui/pull/62): Pin the danger/danger-pr-comment 0.3.0 workflows by commit, skip empty Danger comments, and cancel superseded Danger runs - [@dblock](https://github.com/dblock).
8
+ * [#58](https://github.com/dblock/fui/pull/58): Find imports without a space or with extra spaces, such as `#import"header.h"` - [@dblock](https://github.com/dblock).
9
+ * [#59](https://github.com/dblock/fui/pull/59): Find headers referenced with `#include`, including from `.c`, `.cc`, and `.cpp` files - [@dblock](https://github.com/dblock).
10
+ * [#60](https://github.com/dblock/fui/pull/60): Find imports whose case differs from the header file name, such as `#import "myclass.h"` for `MyClass.h` - [@dblock](https://github.com/dblock).
11
+ * [#63](https://github.com/dblock/fui/pull/63): Release with ruby-gem-release through a manually dispatched GitHub Actions workflow and RubyGems Trusted Publishing - [@dblock](https://github.com/dblock).
12
+
13
+ ### 0.6.0 (2026/04/12)
14
+
15
+ * [#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).
16
+ * [#47](https://github.com/dblock/fui/pull/47): Fixed `ArgumentError: invalid byte sequence in UTF-8` when processing files with non-UTF-8 encoding - [@dblock](https://github.com/dblock).
17
+ * [#48](https://github.com/dblock/fui/pull/48): Fixed `NameError: undefined local variable or method 'project_path'` in verbose mode - [@dblock](https://github.com/dblock).
18
+ * [#49](https://github.com/dblock/fui/pull/49): Added summary output to `find` command: prints `Found N unused header(s).` or `No unused imports found.` - [@dblock](https://github.com/dblock).
19
+ * [#50](https://github.com/dblock/fui/pull/50): Fixed `delete` command to also remove `.mm` (Objective-C++) implementation files - [@dblock](https://github.com/dblock).
20
+ * [#51](https://github.com/dblock/fui/pull/51): Added support for Ruby 4.x - [@dblock](https://github.com/dblock).
21
+ * [#52](https://github.com/dblock/fui/pull/52): Clarified README: fui finds unreferenced header files, not unused imports within files - [@dblock](https://github.com/dblock).
22
+
1
23
  ### 0.5.0 (2018/12/19)
2
24
 
3
25
  * [#29](https://github.com/dblock/fui/pull/29): Added support for ignoring paths through `-i`, `--ignore-path` - [@jeffctown](https://github.com/jeffctown).
data/CONTRIBUTING.md CHANGED
@@ -1,10 +1,9 @@
1
- Contributing
2
- ============
1
+ # Contributing
3
2
 
4
3
  You're encouraged to contribute to this gem.
5
4
 
6
5
  * Fork this project.
7
6
  * Make changes, write tests.
8
- * Updated [CHANGELOG](CHANGELOG.md).
7
+ * Run `bundle exec rake` to lint the code and documentation and run the tests.
8
+ * Update [CHANGELOG](CHANGELOG.md).
9
9
  * Make a pull request, bonus points for topic branches.
10
-
data/LICENSE.md CHANGED
@@ -2,21 +2,8 @@ MIT License
2
2
 
3
3
  Copyright (c) 2014-2018 Daniel Doubrovkine.
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12
6
 
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15
8
 
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,18 +1,20 @@
1
- Fui
2
- ==========
1
+ # Fui
3
2
 
4
- [![Gem Version](https://badge.fury.io/rb/fui.svg)](https://badge.fury.io/rb/fui)
5
- [![Build Status](https://travis-ci.org/dblock/fui.svg)](https://travis-ci.org/dblock/fui)
3
+ [![Gem Version](https://badge.fury.io/rb/fui.svg)](https://badge.fury.io/rb/fui) [![Test](https://github.com/dblock/fui/actions/workflows/test.yml/badge.svg)](https://github.com/dblock/fui/actions/workflows/test.yml) [![Lint](https://github.com/dblock/fui/actions/workflows/lint.yml/badge.svg)](https://github.com/dblock/fui/actions/workflows/lint.yml)
6
4
 
7
5
  Find unused Objective-C imports.
8
6
 
7
+ > **What fui does:** finds header (`.h`) files that are never imported anywhere in your project — i.e. classes that can potentially be deleted entirely.
8
+ >
9
+ > **What fui does not do:** find `#import` statements within a file that are unused by that file's code. For that, use a tool like [Clang's unused-includes warning](https://clang.llvm.org/docs/DiagnosticsReference.html) or AppCode.
10
+
9
11
  # Table of Contents
10
12
 
11
13
  - [Usage](#usage)
12
14
  - [Get Help](#get-help)
13
15
  - [Find Unused Classes in the Current Directory](#find-unused-classes-in-the-current-directory)
14
- - [Find Unused Classes in any Path](#find-unused-classes-in-any-path)
15
- - [Skip Interface Builder (.xib) Files](#skip-interface-builder-xib-files)
16
+ - [Find Unused Classes in Any Path](#find-unused-classes-in-any-path)
17
+ - [Skip Interface Builder (XIB) Files](#skip-interface-builder-xib-files)
16
18
  - [Ignore Local Imports](#ignore-local-imports)
17
19
  - [Ignore Global Imports](#ignore-global-imports)
18
20
  - [Ignore a Path](#ignore-a-path)
@@ -24,51 +26,51 @@ Find unused Objective-C imports.
24
26
 
25
27
  ## Usage
26
28
 
27
- ```
29
+ ```sh
28
30
  gem install fui
29
31
  ```
30
32
 
31
33
  ### Get Help
32
34
 
33
- ```
35
+ ```sh
34
36
  fui help
35
37
  ```
36
38
 
37
39
  ### Find Unused Classes in the Current Directory
38
40
 
39
- ```
41
+ ```sh
40
42
  fui find
41
43
  ```
42
44
 
43
- The `find` command lists all the files that contain unused imports and exits with the number of files found.
45
+ The `find` command lists all header (`.h`) files that are not imported anywhere in the project, and exits with the number of such files found.
44
46
 
45
- ### Find Unused Classes in any Path
47
+ ### Find Unused Classes in Any Path
46
48
 
47
- ```
49
+ ```sh
48
50
  fui --path=~/source/project/Name find
49
51
  ```
50
52
 
51
- ### Skip Interface Builder (.xib) Files
53
+ ### Skip Interface Builder (XIB) Files
52
54
 
53
55
  Running `fui` with `-x` (or `--ignore-xib-files`) will, for example, mark `Foo.h` as unused when `Foo.xib` holds a reference to the `Foo` class and no other references to Foo.h exist.
54
56
 
55
- ```
57
+ ```sh
56
58
  fui -x --path=~/source/project/Name find
57
59
  ```
58
60
 
59
61
  ### Ignore Local Imports
60
62
 
61
- Running `fui` with `-l` (or `--ignore-local-imports`) will, for example, mark `Foo.h` as unused when `Bar.h` contains a local (quotation syntax) import of `Foo.h` (eg. `#import Foo.h`).
63
+ Running `fui` with `-l` (or `--ignore-local-imports`) will, for example, mark `Foo.h` as unused when `Bar.h` contains a local (quotation syntax) import of `Foo.h` (e.g. `#import Foo.h`).
62
64
 
63
- ```
65
+ ```sh
64
66
  fui -l --path=~/source/project/Name find
65
67
  ```
66
68
 
67
69
  ### Ignore Global Imports
68
70
 
69
- Running `fui` with `-g` (or `--ignore-global-imports`) will, for example, mark `Foo.h` as unused when `Bar.h` contains a global (bracket syntax) import of `Foo.h` (eg. `#import <Framework/Foo.h>`).
71
+ Running `fui` with `-g` (or `--ignore-global-imports`) will, for example, mark `Foo.h` as unused when `Bar.h` contains a global (bracket syntax) import of `Foo.h` (e.g. `#import <Framework/Foo.h>`).
70
72
 
71
- ```
73
+ ```sh
72
74
  fui -g --path=~/source/project/Name find
73
75
  ```
74
76
 
@@ -76,7 +78,7 @@ fui -g --path=~/source/project/Name find
76
78
 
77
79
  Running `fui` with `-i` (or `--ignore-path`) will, for example, ignore a `Pods` folder when searching for headers or referencing files.
78
80
 
79
- ```
81
+ ```sh
80
82
  fui --path=~/source/project/Name --ignore-path=Pods find
81
83
  ```
82
84
 
@@ -84,13 +86,13 @@ fui --path=~/source/project/Name --ignore-path=Pods find
84
86
 
85
87
  Running `fui` with `-i` (or `--ignore-path`) can ignore multiple folders when searching for headers or referencing files.
86
88
 
87
- ```
89
+ ```sh
88
90
  fui --path=~/source/project/Name --ignore-path=Pods --ignore-path=Libraries find
89
91
  ```
90
92
 
91
93
  ### Delete All Unused Class Files with Prompt
92
94
 
93
- ```
95
+ ```sh
94
96
  fui --path=~/source/project/Name delete --perform --prompt
95
97
  ```
96
98
 
@@ -100,7 +102,7 @@ Use [xcfui](https://github.com/jcavar/xcfui) for integration with Xcode.
100
102
 
101
103
  ## Contributing
102
104
 
103
- There're [a few feature requests and known issues](https://github.com/dblock/fui/issues). Please contribute! See [CONTRIBUTING](CONTRIBUTING.md).
105
+ There are [a few feature requests and known issues](https://github.com/dblock/fui/issues). Please contribute! See [CONTRIBUTING](CONTRIBUTING.md).
104
106
 
105
107
  ## Copyright and License
106
108
 
data/RELEASING.md CHANGED
@@ -1,61 +1,37 @@
1
- # Releasing fui
1
+ # Releasing Fui
2
2
 
3
3
  There are no hard rules about when to release fui. Release bug fixes frequently, features not so frequently, and breaking changes rarely.
4
4
 
5
- ### Release
5
+ Releases use [ruby-gem-release](https://github.com/dblock/ruby-gem-release) 0.9.0 through a manually dispatched [Release workflow](.github/workflows/release.yml). Keep the `ruby-gem-release` gem in [Gemfile](Gemfile) and the reusable workflow in `release.yml` pinned to the same version. The workflow publishes through RubyGems Trusted Publishing, so no RubyGems API key or one-time password is needed. It only runs from `master` in `dblock/fui`. The local Bundler `rake release`, `release:rubygem_push`, and `release:source_control_push` tasks are disabled.
6
6
 
7
- Run tests, check that all tests succeed locally.
7
+ ## One-Time Setup
8
8
 
9
- ```
10
- bundle install
11
- rake
12
- ```
13
-
14
- Check that the last build succeeded in [Travis CI](https://travis-ci.org/dblock/fui).
15
-
16
- Change "Next" in [CHANGELOG.md](CHANGELOG.md) to the current date.
17
-
18
- ```
19
- ### 0.4.0 (2016/5/14)
20
- ```
9
+ The [trusted publisher for fui](https://rubygems.org/gems/fui/trusted_publishers) is configured as a GitHub Actions publisher with repository owner `dblock`, repository `fui`, workflow filename `release.yml`, environment `release`, and the separate workflow repository owner `dblock` and repository `ruby-gem-release`.
21
10
 
22
- Remove the line with "Your contribution here.", since there will be no more contributions to this release.
11
+ GitHub creates the `release` environment in `dblock/fui` on the first dispatch. Restrict its deployment branches to `master`, and add required reviewers to require maintainer approval before publication. Allow GitHub Actions to push release commits and `v*` tags to `master`. See the upstream [setup and permissions guidance](https://github.com/dblock/ruby-gem-release/blob/v0.9.0/RELEASING.md#one-time-setup).
23
12
 
24
- Commit your changes.
13
+ Verify the setup without publishing with a [dry run](https://github.com/dblock/ruby-gem-release/blob/v0.9.0/docs/actions/release.md#dry-run), which never edits files, builds, pushes, or publishes:
25
14
 
26
- ```
27
- git add CHANGELOG.md
28
- git commit -m "Preparing for release, 0.4.0."
29
- git push origin master
15
+ ```sh
16
+ gh workflow run release.yml --repo dblock/fui --ref master -f dry-run=true
30
17
  ```
31
18
 
32
- Release.
19
+ ## Prepare
33
20
 
34
- ```
35
- $ rake release
21
+ Start with a clean, up-to-date `master` and verify that the latest [CI checks](https://github.com/dblock/fui/actions) pass for all supported Ruby versions. Follow semantic versioning: patch for fixes, minor for backward-compatible features, major for breaking changes. Check `VERSION` in [lib/fui/version.rb](lib/fui/version.rb) and the matching `(Next)` heading in [CHANGELOG.md](CHANGELOG.md), and change both in a pull request if needed, or pass a `version` override when dispatching.
36
22
 
37
- fui 0.4.0 built to pkg/fui-0.4.0.gem.
38
- Tagged v0.4.0.
39
- Pushed git commits and tags.
40
- Pushed fui 0.4.0 to rubygems.org.
41
- ```
23
+ The workflow dates the `(Next)` heading using `YYYY/MM/DD` and removes the `* Your contribution here.` placeholder; a section without notes cannot be released.
42
24
 
43
- ### Prepare for the Next Version
25
+ Release automation requires MRI Ruby 3.3 or newer; the release dependency and tasks are skipped on older Ruby versions and JRuby. Release specs in [spec/release](spec/release) run the actual release tasks against a local fixture with the [ruby-gem-release RSpec helpers](https://github.com/dblock/ruby-gem-release/blob/v0.9.0/docs/testing.md), without contacting RubyGems or GitHub.
44
26
 
45
- Add the next release to [CHANGELOG.md](CHANGELOG.md).
27
+ ## Publish
46
28
 
29
+ ```sh
30
+ gh workflow run release.yml --repo dblock/fui --ref master
47
31
  ```
48
- ### 0.4.1 (Next)
49
32
 
50
- * Your contribution here.
51
- ```
33
+ Pass `-f version=x.y.z` to release a different version. Dispatching starts a real release; do not merge into `master` while it runs. The workflow prepares the release commit, runs lint and specs on Ruby 3.3, builds the gem, preserves recovery artifacts, publishes to RubyGems, pushes the release commit and `v` tag, and creates a GitHub Release with the changelog notes and the gem attached. It then increments the patch version, adds a new `(Next)` section, and pushes the next development commit. Verify the published version on [RubyGems](https://rubygems.org/gems/fui), the tag, the [GitHub Release](https://github.com/dblock/fui/releases), and the next development commit.
52
34
 
53
- Increment the third version number in [lib/fui/version.rb](lib/fui/version.rb).
35
+ ## Recover a Partial Release
54
36
 
55
- Commit your changes.
56
-
57
- ```
58
- git add CHANGELOG.md lib/fui/version.rb
59
- git commit -m "Preparing for next development iteration, 0.4.1."
60
- git push origin master
61
- ```
37
+ Inspect the failed run, RubyGems, remote commits and tags, and the GitHub Release before retrying. Publication may have succeeded even if a later step failed. Never move a published tag or republish a version with different contents. Use the run's retained recovery artifacts and the upstream [recovery instructions](https://github.com/dblock/ruby-gem-release/blob/v0.9.0/docs/actions/release.md#recovery-artifacts).
data/bin/fui CHANGED
@@ -37,7 +37,13 @@ command :find do |c|
37
37
  puts relative_path
38
38
  end
39
39
  end
40
- exit_now! nil, $fui.unused_references.count
40
+ count = $fui.unused_references.count
41
+ if count > 0
42
+ puts "Found #{count} unused #{count == 1 ? 'header' : 'headers'}."
43
+ else
44
+ puts 'No unused imports found.'
45
+ end
46
+ exit_now! nil, count
41
47
  end
42
48
  end
43
49
 
@@ -57,7 +63,7 @@ command :delete do |c|
57
63
  end.each do |k, _v|
58
64
  relative_path = Pathname.new(k.path).relative_path_from(root).to_s
59
65
  if options[:prompt]
60
- print "Remove #{relative_path}(.m) [y/N] "
66
+ print "Remove #{relative_path}(.m/.mm) [y/N] "
61
67
  response = STDIN.getc.upcase
62
68
  puts "#{response.chr}\r\n"
63
69
  next unless response.chr == 'Y'
@@ -68,16 +74,18 @@ command :delete do |c|
68
74
  puts "#{relative_path}#{options[:perform] ? '' : ' (simulation)'}\r\n"
69
75
  end
70
76
  File.delete(k.path) if options[:perform]
71
- impl_path = k.path.gsub(/\.h$/, '.m')
72
- next unless File.exist?(impl_path)
77
+ ['.m', '.mm'].each do |ext|
78
+ impl_path = k.path.gsub(/\.h$/, ext)
79
+ next unless File.exist?(impl_path)
73
80
 
74
- relative_path = Pathname.new(impl_path).relative_path_from(root).to_s
75
- if global_options[:verbose]
76
- puts "Removing #{relative_path}#{options[:perform] ? '' : ' (simulation)'}\r\n"
77
- else
78
- puts "#{relative_path}#{options[:perform] ? '' : ' (simulation)'}\r\n"
81
+ relative_path = Pathname.new(impl_path).relative_path_from(root).to_s
82
+ if global_options[:verbose]
83
+ puts "Removing #{relative_path}#{options[:perform] ? '' : ' (simulation)'}\r\n"
84
+ else
85
+ puts "#{relative_path}#{options[:perform] ? '' : ' (simulation)'}\r\n"
86
+ end
87
+ File.delete(impl_path) if options[:perform]
79
88
  end
80
- File.delete(impl_path) if options[:perform]
81
89
  end
82
90
  ensure
83
91
  system('stty -raw echo')
data/lib/fui/finder.rb CHANGED
@@ -34,7 +34,7 @@ module Fui
34
34
  references[header] = []
35
35
  end
36
36
  Find.find(path) do |path|
37
- if ['.m', '.mm', '.h', '.pch'].include?(File.extname(path))
37
+ if ['.m', '.mm', '.h', '.pch', '.c', '.cc', '.cpp'].include?(File.extname(path))
38
38
  process_code references, path, &block
39
39
  elsif ['.storyboard', '.xib'].include?(File.extname(path))
40
40
  process_xml references, path, &block
@@ -72,38 +72,33 @@ module Fui
72
72
  def local_imported(file_contents, header)
73
73
  return false if options['ignore-local-imports']
74
74
 
75
- file_contents.include?("#import \"#{header.filename}\"")
75
+ file_contents.match?(/#\s*(?:import|include)\s*"#{Regexp.quote(header.filename)}"/i)
76
76
  end
77
77
 
78
78
  def global_imported(file_contents, header)
79
79
  return false if options['ignore-global-imports']
80
80
 
81
- escaped_header = Regexp.quote(header.filename)
82
- regex = '(#import\s{1}<.+\/' + escaped_header + '>)'
83
- file_contents.match(regex)
81
+ file_contents.match?(%r{#\s*(?:import|include)\s*<.+/#{Regexp.quote(header.filename)}>}i)
84
82
  end
85
83
 
86
84
  def process_code(references, path)
87
- File.open(path) do |file|
88
- yield path if block_given?
89
- headers.each do |header|
90
- filename_without_extension = File.basename(path, File.extname(path))
91
- file_contents = File.read(file)
92
- global_import_exists = global_imported(file_contents, header)
93
- local_import_exists = local_imported(file_contents, header)
94
- references[header] << path if filename_without_extension != header.filename_without_extension && (local_import_exists || global_import_exists)
95
- end
85
+ yield path if block_given?
86
+ file_contents = File.read(path, encoding: 'binary').encode('UTF-8', invalid: :replace, undef: :replace)
87
+ headers.each do |header|
88
+ filename_without_extension = File.basename(path, File.extname(path))
89
+ global_import_exists = global_imported(file_contents, header)
90
+ local_import_exists = local_imported(file_contents, header)
91
+ references[header] << path if filename_without_extension != header.filename_without_extension && (local_import_exists || global_import_exists)
96
92
  end
97
93
  end
98
94
 
99
95
  def process_xml(references, path)
100
- File.open(path) do |file|
101
- yield path if block_given?
102
- headers.each do |header|
103
- filename_without_extension = File.basename(path, File.extname(path))
104
- check_xibs = !options['ignore-xib-files']
105
- references[header] << path if (check_xibs || filename_without_extension != header.filename_without_extension) && File.read(file).include?("customClass=\"#{header.filename_without_extension}\"")
106
- end
96
+ yield path if block_given?
97
+ file_contents = File.read(path, encoding: 'binary').encode('UTF-8', invalid: :replace, undef: :replace)
98
+ headers.each do |header|
99
+ filename_without_extension = File.basename(path, File.extname(path))
100
+ check_xibs = !options['ignore-xib-files']
101
+ references[header] << path if (check_xibs || filename_without_extension != header.filename_without_extension) && file_contents.include?("customClass=\"#{header.filename_without_extension}\"")
107
102
  end
108
103
  end
109
104
  end
data/lib/fui/project.rb CHANGED
@@ -22,7 +22,7 @@ module Fui
22
22
 
23
23
  path_tokens = tokens[1].split('/')
24
24
  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
26
26
  bridging_headers << bridging_header
27
27
  end
28
28
  bridging_headers.uniq
data/lib/fui/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fui
2
- VERSION = '0.5.0'.freeze
2
+ VERSION = '0.7.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-20 00:00:00.000000000 Z
11
+ date: 2026-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -24,7 +24,7 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- description:
27
+ description:
28
28
  email: dblock@dblock.org
29
29
  executables:
30
30
  - fui
@@ -46,7 +46,7 @@ homepage: http://github.com/dblock/fui
46
46
  licenses:
47
47
  - MIT
48
48
  metadata: {}
49
- post_install_message:
49
+ post_install_message:
50
50
  rdoc_options: []
51
51
  require_paths:
52
52
  - lib
@@ -61,9 +61,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  - !ruby/object:Gem::Version
62
62
  version: 1.3.6
63
63
  requirements: []
64
- rubyforge_project:
65
- rubygems_version: 2.7.8
66
- signing_key:
64
+ rubygems_version: 3.5.22
65
+ signing_key:
67
66
  specification_version: 4
68
67
  summary: Find unused Objective-C imports.
69
68
  test_files: []