require 'cocoadepot' require_relative '../source/lib_bundle' require_relative '../code_generator/code_generator' module CocoaDepot # The abstract for the container that contains a component. In cocoa # it may be a pod. class Component # Check the aim bundle is exist or not def check_auto_compoment! all_component_resource_paths = auto_assets_generation_path.children.select(&:directory?) all_component_resource_paths.each do |child| app_id = child.basename bundle_name = auto_bundle_name component_name = "#{bundle_name}#{app_id.to_s.camelize}" lib = KCommercial::Resources::LibBundleGenerator.new(component_name, auto_bundle_name, child) lib.generate! end # rm assets FileUtils.rm_rf(auto_assets_generation_path) end def auto_compoment_list auto_assets_generation_path.mkdir unless auto_assets_generation_path.exist? all_component_resource_paths = auto_assets_generation_path.children.select(&:directory?) components = all_component_resource_paths.map do |c| bundle_name = auto_bundle_name app_id = c.basename component_name = "#{bundle_name}#{app_id.to_s.camelize}" component_name end components end end end