fui 0.2.0 → 0.3.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
  SHA1:
3
- metadata.gz: 39c221175e03a81032408c1a8635b7191e7b112a
4
- data.tar.gz: 221f943408123601fe7fbd671a64bdbe4b856c1c
3
+ metadata.gz: 95461cae3ee31c3d0a45fc8996d12f85e0af00ea
4
+ data.tar.gz: 3f90ffa5af46eb689930f6029805cea8281efdd1
5
5
  SHA512:
6
- metadata.gz: 9af00c9579ebff0ad21c72d4b47c366b8905c45b8e2bad576bd275f76f0df522d6c5638c7fbc7dc9639745baf09db42194c49fa3915335400ca6511bb54c377b
7
- data.tar.gz: 872db52c29157f6ea883ea4c371445755ac7c00531972b8f403e022ba1e03b03d6cda891550e8eed45376b822b8d7a84d0e17177b12e03e5846037e7b1787444
6
+ metadata.gz: ee27ad841003c4f16beb828ffd048a539bc4039d565e57043895645eaf9e1fa167f7d3af8f5a2a4090bee95f8c6744bc9e73611a99d4f1f226495d936d9b4967
7
+ data.tar.gz: ab689ab980e1e10f06798c3bc9626c06127397e1bf9dde263c8ae97a4139ce88b02f4bc4816d5ec3930b1d6e1f5b6c88c0ba339594aa529049b2069d02f1edf0
@@ -1,6 +1,11 @@
1
+ ### 0.3.0 (2/7/2014)
2
+
3
+ * [#5](https://github.com/dblock/fui/issues/5): Explicitly require Ruby 1.9.3 or later in .gemspec - [@paulyoung](https://github.com/paulyoung).
4
+ * [#4](https://github.com/dblock/fui/issues/4): Added support for .storyboard and .xib `customClass` references - [@dblock](https://github.com/dblock).
5
+
1
6
  ### 0.2.0 (1/23/2014)
2
7
 
3
- * By default will display (simulation) because no actual files are being deleted - [@dblock](https://github.com/dblock).
8
+ * By default will display "(simulation)" because no actual files are being deleted - [@dblock](https://github.com/dblock).
4
9
  * Fui's exit code with `find` will be the number of unused references found - [@dblock](https://github.com/dblock).
5
10
 
6
11
  ### 0.1.1 (1/22/2014)
data/README.md CHANGED
@@ -23,7 +23,7 @@ fui help
23
23
  fui find
24
24
  ```
25
25
 
26
- The `find` command lists all the files that contain unused interfaces and exits with the number of files found.
26
+ The `find` command lists all the files that contain unused imports and exits with the number of files found.
27
27
 
28
28
  #### Find Unused Classes in a Path
29
29
 
@@ -39,7 +39,7 @@ fui --path=~/source/project/Name delete --perform --prompt
39
39
 
40
40
  ## Contributing
41
41
 
42
- See [CONTRIBUTING](CONTRIBUTING.md).
42
+ There're a [few known issues](https://github.com/dblock/fui/issues), notably around storyboards and .xib files. Please contribute! See [CONTRIBUTING](CONTRIBUTING.md).
43
43
 
44
44
  ## Copyright and License
45
45
 
@@ -18,14 +18,11 @@ module Fui
18
18
  references[header] = []
19
19
  end
20
20
  Find.find(path) do |path|
21
- next unless [".m", ".h", ".pch"].include?(File.extname(path)) && File.ftype(path) == "file"
22
- File.open(path) do |file|
23
- filename = File.basename(path)
24
- yield path if block_given?
25
- headers.each do |header|
26
- filename_without_extension = File.basename(path, File.extname(path))
27
- references[header] << path if filename_without_extension != header.filename_without_extension && File.read(file).include?("#import \"#{header.filename}\"")
28
- end
21
+ next unless File.ftype(path) == "file"
22
+ if [".m", ".h", ".pch"].include?(File.extname(path))
23
+ process_code references, path, &block
24
+ elsif [".storyboard", ".xib"].include?(File.extname(path))
25
+ process_xml references, path, &block
29
26
  end
30
27
  end
31
28
  references
@@ -46,5 +43,26 @@ module Fui
46
43
  }
47
44
  results
48
45
  end
46
+
47
+ def process_code(references, path, &block)
48
+ File.open(path) do |file|
49
+ yield path if block_given?
50
+ filename = File.basename(path)
51
+ headers.each do |header|
52
+ filename_without_extension = File.basename(path, File.extname(path))
53
+ references[header] << path if filename_without_extension != header.filename_without_extension && File.read(file).include?("#import \"#{header.filename}\"")
54
+ end
55
+ end
56
+ end
57
+
58
+ def process_xml(references, path, &block)
59
+ File.open(path) do |file|
60
+ yield path if block_given?
61
+ headers.each do |header|
62
+ filename_without_extension = File.basename(path, File.extname(path))
63
+ references[header] << path if File.read(file).include?("customClass=\"#{header.filename_without_extension}\"")
64
+ end
65
+ end
66
+ end
49
67
  end
50
68
  end
@@ -1,3 +1,3 @@
1
1
  module Fui
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
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.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-23 00:00:00.000000000 Z
11
+ date: 2014-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -52,7 +52,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - '>='
54
54
  - !ruby/object:Gem::Version
55
- version: '0'
55
+ version: 1.9.3
56
56
  required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - '>='
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  version: 1.3.6
61
61
  requirements: []
62
62
  rubyforge_project:
63
- rubygems_version: 2.0.14
63
+ rubygems_version: 2.1.11
64
64
  signing_key:
65
65
  specification_version: 4
66
66
  summary: Find unused Objective-C imports.