storyboardlint 0.1.1 → 0.1.2

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: cb6bd687ab2eef94fe9d9aaf3fe66d5599c05886
4
- data.tar.gz: 979f598428de5417814402939b1e456e04997c8f
3
+ metadata.gz: 58d343d4d968254f21f6a1e31d508c073a779fc4
4
+ data.tar.gz: a8675e78e75b2d299bbf8e19caa9ce95cf3bf9d9
5
5
  SHA512:
6
- metadata.gz: 5d0978e1b82ac952ee5ea8e7f3ea3286e769a3b9291e0d06f16dc48dd55ce519b6c9736bc41518d9ec6153e105ed85840f0ef0a3f3e2020ae9e4df23e6781a24
7
- data.tar.gz: f3cbc4e6c6dfc117cbc7c4a87e4e0cbf74d02cb617bb6312ca2b821a30c4bc1d77a93aa32f9872bb621b2341f9c67206f20ea8cf8c57ea49efc91e620092e4e3
6
+ metadata.gz: 94615f5aa57c7b7152be2f1a406b6a37b486fdff520d1bdf8e1da17ab31d0e91f8fe436b18f834853859acbf108f355b634c672ec6d1b109d08e6f90d50bdf67
7
+ data.tar.gz: 80a5e312da89a90b28c69e4391c0eab9fecb4b5aa0f4288f6bc03738aaac09c6fe1e6f44ea37a1984080d13ea45740fb6ea841ff0c7dd23b793a5d3aa68c62bf
data/README.md CHANGED
@@ -14,10 +14,10 @@ Fear Not!
14
14
  ---------
15
15
  With StoryboardLint, you can finally make sure that your code and your Storyboards are in sync (at least to a certain degree). StoryboardLint does the following things:
16
16
 
17
- - Makes sure your `UITableViewCell` and `UICollectionViewCell` reuse identifiers are named according to StoryboardLint's naming convention.
18
- - Makes sure your Storyboard and Segue identifiers are named according to StoryboardLint's naming convention.
17
+ - Makes sure your `UITableViewCell` and `UICollectionViewCell` reuse identifiers are named according to either your own or StoryboardLint's default naming convention.
18
+ - Makes sure your Storyboard and Segue identifiers are named according to either your own or StoryboardLint's naming convention.
19
19
  - Makes sure that all custom classes that are references from your Storyboard actually exist is your code.
20
- - Makes sure that all string literals in your code that reference reuse identifiers, Storyboard identifiers and Segue identifiers (according to the naming convention) actually exist in your Storyboard(s).
20
+ - Makes sure that all string literals in your code that reference reuse identifiers, Storyboard identifiers and Segue identifiers (according to a given or default naming convention) actually exist in your Storyboard(s).
21
21
  - Produces output that is parsable by Xcode so you can easily plug StoryboardLint into your build process:
22
22
 
23
23
  **Warnings right in your source code:**
@@ -30,13 +30,20 @@ With StoryboardLint, you can finally make sure that your code and your Storyboar
30
30
 
31
31
  Naming Convention
32
32
  -----------------
33
- In order for StoryboardLint to find the string literals in your code that contain reuse/Storyboard/Segue identifiers, you need to prefix them as follows:
33
+ In order for StoryboardLint to find the string literals in your code that contain reuse/Storyboard/Segue identifiers, you need to prefix and/or suffix them in a consistent way. If you don't provide any options, this is the default:
34
34
 
35
35
  - Reuse Identifiers start with `ruid_`. Example: `ruid_ProductTableViewCell`.
36
36
  - Storyboard Identifiers start with `sb_`. Example: `sb_ProductsViewController`.
37
37
  - Segue Identifiers start with `seg_`. Example: `seg_ProductDetailsSegue`.
38
38
 
39
- This should not be too much work and it will be worth it. Ideally you already have string constants for these things in your code, so that you only have to edit two places: your string constant in code and the respective value in your Storyboard.
39
+ However, if you already use a certain naming convention or if you would prefer a different one, you can tell StoryboardLint about it using these commandline arguments:
40
+
41
+ - `--storyboard-prefix`. Example: `storyboardlint ~/Code/MyProject --storyboard-prefix MyGreatPrefix`
42
+ - `--storyboard-suffix`. Example: `storyboardlint ~/Code/MyProject --storyboard-suffix MyGreatSuffix`
43
+
44
+ The same goes for `--segue-prefix`, `--segue-suffix`, `--reuse-prefix` and `--reuse-suffix`. You are even allowed to provide both a prefix and a suffix.
45
+
46
+ Naming your identifiers according to a consistent naming convention should not be too much work and it will be worth it. Ideally you already have string constants for these things in your code, so that you only have to edit two places: your string constant in code and the respective value in your Storyboard.
40
47
 
41
48
  Installation
42
49
  ------------
@@ -49,7 +56,7 @@ In your Xcode Project, simply add a "Run Script" build phase in order to run Sto
49
56
  1. Go to your project and select your project's target in the "Targets" section.
50
57
  2. Go to "Build Phases"
51
58
  3. Select from the Menu "Editor -> Add Build Phase -> Add Run Script Build Phase"
52
- 4. Paste this command into the Run Script section: `storyboardlint "$SRCROOT"`
59
+ 4. Paste this command into the Run Script section: `storyboardlint "$SRCROOT"` (this will use the default naming convention). Alternatively, you can provide options to tell StoryboardLint about our own naming conventions, for example: `storyboardlint "$SRCROOT" --storyboard-suffix Storyboard --segue-suffix Segue --reuse-suffix ReuseID`
53
60
  5. That's it!
54
61
 
55
62
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  # Have fun. Use at your own risk.
2
3
  # Copyright (c) 2014 Johannes Fahrenkrug
3
4
 
@@ -86,7 +87,7 @@ module StoryboardLint
86
87
  @reuse_ids ||= []
87
88
 
88
89
  source_files.each do |source_file|
89
- File.readlines(source_file).each_with_index do |line, idx|
90
+ File.readlines(source_file, :encoding => 'UTF-8').each_with_index do |line, idx|
90
91
  # class names
91
92
  line.scan(@matcher.class_regex).each do |match|
92
93
  @class_names << {:file => source_file, :line => idx + 1, :class_name => match[0]}
@@ -278,7 +279,7 @@ module StoryboardLint
278
279
 
279
280
  # Another typical switch to print the version.
280
281
  opts.on_tail("--version", "Show version") do
281
- puts "StoryboardLint v0.1.1"
282
+ puts "StoryboardLint v0.1.2"
282
283
  exit
283
284
  end
284
285
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "storyboardlint"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Johannes Fahrenkrug"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: storyboardlint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Fahrenkrug