-
Notifications
You must be signed in to change notification settings - Fork 102
fix #273 #274
base: main
Are you sure you want to change the base?
fix #273 #274
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,7 +88,13 @@ def linkable_file?(name) | |
| end | ||
|
|
||
| def resource_file?(name) | ||
| name.end_with?('xcassets', 'bundle', 'xib', 'storyboard') | ||
| suffixes = ['xcassets', 'bundle', 'xib', 'storyboard'].concat(@config.additional_resource_suffixes) | ||
| suffixes.each do |suffix| | ||
| if name.end_with?(suffix) | ||
| return true | ||
| end | ||
| end | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trailing whitespace detected. |
||
| return false | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Redundant |
||
| end | ||
|
|
||
| def template_file?(object) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ class ProjectConfiguration | |
| :indentation_level, | ||
| :warnings, | ||
| :templates, | ||
| :additional_resource_suffixes, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Align the parameters of a method call if they span more than one line. |
||
| :project_template, | ||
| :app_target_templates, | ||
| :test_target_templates, | ||
|
|
@@ -66,6 +67,10 @@ def each_template(&block) | |
| end | ||
| end | ||
|
|
||
| def additional_resource_suffixes | ||
| @additional_resource_suffixes ||= [] | ||
| end | ||
|
|
||
| def get_binding | ||
| binding | ||
| end | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,6 +73,16 @@ | |
| end | ||
| end | ||
|
|
||
| describe '#additional_resource_suffixes' do | ||
| it 'returns an array of suffixes' do | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
| additional_resource_suffixes = ['foo', 'bar'] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
|
|
||
| config = Liftoff::ProjectConfiguration.new({:additional_resource_suffixes => additional_resource_suffixes}) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [113/80] |
||
|
|
||
| expect(config.additional_resource_suffixes).to eq(['foo', 'bar']) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
| end | ||
| end | ||
|
|
||
| describe '#app_target_groups' do | ||
| context 'when the project_template is set to swift' do | ||
| it 'returns the swift app target groups' do | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| txt test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [105/80]
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.