redbreast 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0af297ef6e37a2914f39cefda66be835e4d8550728f87faebf68748843ba0e8d
4
- data.tar.gz: c2b0b4251ae80070c635453c9988eec30d285e2a3e7cab4607a14aa10f54d220
3
+ metadata.gz: c480f664a7236aa040c135bbb0ac9ab3b0094079def7706d52e622f8761e50fe
4
+ data.tar.gz: 7d0c140bd021d378e57c10bc83bd46bef2c18cf47df4805d82b2f45a970fcbe0
5
5
  SHA512:
6
- metadata.gz: 7af2661161d5e3b4c6fd4764d4836065eb136494dbb70ff0767c51cb847ab66f9c6c631429267072a74fb255f22baa17bab18f95d7813ef287a21278a4d01690
7
- data.tar.gz: 806e793afb6fe385b2207b96cc60bf239f58f249d1da38d048bd5f884c9d9ff3e76436dd124c0b983f06845898548040afff714b8be3353091daec87f2ea0d28
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(language).split(' ')
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('Choose a language: ', languages)
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(language)
73
- prompt_text = 'Please enter bundle names that you use separated by spaces'
74
- case language
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 images resources files for bundle #{bundle}?"
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 colors resources files for bundle #{bundle}?"
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('Choose a type: ', types)
167
+ prompt.select("Choose a type for bundle #{bundle}: ", types)
175
168
  end
176
169
  end
177
170
  end
@@ -1,3 +1,3 @@
1
1
  module Redbreast
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redbreast
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maroje