File tree Expand file tree Collapse file tree
lib/generators/rolemodel/optics/icons Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,18 +22,23 @@ def remove_existing_icon_helper_and_builders
2222 end
2323
2424 def add_view_helper
25- @chosen_library = options [ 'icon_library' ]
26- @chosen_library ||= ask (
27- 'What icon library would you like to add?' ,
28- default : SUPPORTED_LIBRARIES . keys . first . to_s ,
29- limited_to : SUPPORTED_LIBRARIES . keys . map ( &:to_s )
30- )
25+ @chosen_library = chosen_icon_library
3126 @supported_properties = SUPPORTED_LIBRARIES . fetch ( @chosen_library )
3227
3328 template 'app/icon_builders/icon_builder.rb'
3429 template "app/icon_builders/#{ @chosen_library } _icon_builder.rb"
3530 template 'app/helpers/icon_helper.rb'
3631 end
32+
33+ private
34+
35+ def chosen_icon_library
36+ return options [ 'icon_library' ] if options . icon_library?
37+
38+ ask ( 'What icon library would you like to add?' ,
39+ default : SUPPORTED_LIBRARIES . keys . first . to_s ,
40+ limited_to : SUPPORTED_LIBRARIES . keys . map ( &:to_s ) )
41+ end
3742 end
3843 end
3944end
You can’t perform that action at this time.
0 commit comments