redbreast 1.4.0 → 1.4.1
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 +4 -4
- data/lib/redbreast/commands/setup.rb +15 -22
- data/lib/redbreast/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c480f664a7236aa040c135bbb0ac9ab3b0094079def7706d52e622f8761e50fe
|
4
|
+
data.tar.gz: 7d0c140bd021d378e57c10bc83bd46bef2c18cf47df4805d82b2f45a970fcbe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e189fc86aa4bb2908217306485a6a1a42d79347934f46b132e32b97111084508799363c6e4b23528b229778227a13f44ce1fb90ca9c344c5ee2ff778679784d
|
7
|
+
data.tar.gz: e44abf29a209555d579a51d8cbbf9651f5c41b77d4a348c933b612992423aa8b83fb6631ff6b26f432ae74c0fba77c23a65e625034cadd33e5ddca41e3800e6d
|
@@ -18,11 +18,11 @@ module Redbreast
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def call
|
21
|
-
language = language_prompt
|
22
21
|
app_name = app_name_prompt
|
23
|
-
bundle_names = bundle_names_prompt(
|
24
|
-
assets_types = assets_types_prompt
|
22
|
+
bundle_names = bundle_names_prompt().split(' ')
|
25
23
|
bundles = bundle_names.map do |bundle|
|
24
|
+
language = language_prompt(bundle)
|
25
|
+
assets_types = assets_types_prompt(bundle)
|
26
26
|
reference = bundle_reference(bundle, language)
|
27
27
|
assets_search_path = assets_search_path_prompt(bundle)
|
28
28
|
output_source_path_images = assets_types == 1 ? nil : images_sources_path_prompt(bundle, language)
|
@@ -31,6 +31,7 @@ module Redbreast
|
|
31
31
|
output_test_path_images = assets_types != 1 && include_tests ? images_tests_path_prompt(bundle, language) : nil
|
32
32
|
output_test_path_colors = assets_types != 0 && include_tests ? colors_tests_path_prompt(bundle, language) : nil
|
33
33
|
fields = {
|
34
|
+
language: language,
|
34
35
|
name: bundle,
|
35
36
|
reference: reference,
|
36
37
|
assetsSearchPath: assets_search_path,
|
@@ -43,7 +44,6 @@ module Redbreast
|
|
43
44
|
compact fields
|
44
45
|
end
|
45
46
|
config = {
|
46
|
-
language: language,
|
47
47
|
bundles: bundles,
|
48
48
|
app_name: app_name
|
49
49
|
}
|
@@ -55,9 +55,9 @@ module Redbreast
|
|
55
55
|
|
56
56
|
# Language
|
57
57
|
|
58
|
-
def language_prompt
|
58
|
+
def language_prompt(bundle)
|
59
59
|
languages = { 'Swift' => 'swift', 'SwiftUI' => 'swiftui', 'Objective-C' => 'objc', }
|
60
|
-
prompt.select(
|
60
|
+
prompt.select("Choose a language for bundle #{bundle}: ", languages)
|
61
61
|
end
|
62
62
|
|
63
63
|
# Assets source path
|
@@ -69,16 +69,9 @@ module Redbreast
|
|
69
69
|
|
70
70
|
# Bundle names promt
|
71
71
|
|
72
|
-
def bundle_names_prompt(
|
73
|
-
prompt_text = 'Please enter bundle names that you use separated by spaces'
|
74
|
-
|
75
|
-
when 'objc'
|
76
|
-
prompt.ask(prompt_text, default: 'mainBundle')
|
77
|
-
when 'swift'
|
78
|
-
prompt.ask(prompt_text, default: 'main')
|
79
|
-
when 'swiftui'
|
80
|
-
prompt.ask(prompt_text, default: 'main')
|
81
|
-
end
|
72
|
+
def bundle_names_prompt()
|
73
|
+
prompt_text = 'Please enter bundle names that you use separated by spaces. For Obj-C use mainBundle.'
|
74
|
+
prompt.ask(prompt_text, default: 'main')
|
82
75
|
end
|
83
76
|
|
84
77
|
def bundle_reference(bundle_name, language)
|
@@ -95,7 +88,7 @@ module Redbreast
|
|
95
88
|
# Images source path
|
96
89
|
|
97
90
|
def images_sources_path_prompt(bundle, language)
|
98
|
-
prompt_text = "Where would you like to store
|
91
|
+
prompt_text = "Where would you like to store image resources files for bundle #{bundle}?"
|
99
92
|
case language
|
100
93
|
when 'objc'
|
101
94
|
prompt.ask(prompt_text, default: './Common/Categories/Images')
|
@@ -109,7 +102,7 @@ module Redbreast
|
|
109
102
|
# Colors source path
|
110
103
|
|
111
104
|
def colors_sources_path_prompt(bundle, language)
|
112
|
-
prompt_text = "Where would you like to store
|
105
|
+
prompt_text = "Where would you like to store color resources files for bundle #{bundle}?"
|
113
106
|
case language
|
114
107
|
when 'objc'
|
115
108
|
prompt.ask(prompt_text, default: './Common/Categories/Colors')
|
@@ -127,7 +120,7 @@ module Redbreast
|
|
127
120
|
end
|
128
121
|
|
129
122
|
def images_tests_path_prompt(bundle, language)
|
130
|
-
prompt_text = "Where would you like to store tests for bundle #{bundle}?"
|
123
|
+
prompt_text = "Where would you like to store image tests for bundle #{bundle}?"
|
131
124
|
case language
|
132
125
|
when 'objc'
|
133
126
|
prompt.ask(prompt_text, default: './Common/Categories/ImagesTest')
|
@@ -139,7 +132,7 @@ module Redbreast
|
|
139
132
|
end
|
140
133
|
|
141
134
|
def colors_tests_path_prompt(bundle, language)
|
142
|
-
prompt_text = "Where would you like to store tests for bundle #{bundle}?"
|
135
|
+
prompt_text = "Where would you like to store color tests for bundle #{bundle}?"
|
143
136
|
case language
|
144
137
|
when 'objc'
|
145
138
|
prompt.ask(prompt_text, default: './Common/Categories/ColorsTest')
|
@@ -169,9 +162,9 @@ module Redbreast
|
|
169
162
|
|
170
163
|
# Assets type prompt
|
171
164
|
|
172
|
-
def assets_types_prompt
|
165
|
+
def assets_types_prompt(bundle)
|
173
166
|
types = { 'Images' => 0, 'Colors' => 1, 'Both' => 2 }
|
174
|
-
prompt.select(
|
167
|
+
prompt.select("Choose a type for bundle #{bundle}: ", types)
|
175
168
|
end
|
176
169
|
end
|
177
170
|
end
|
data/lib/redbreast/version.rb
CHANGED