Class: Redbreast::Command::ColorGenerator

Inherits:
Object
  • Object
show all
Includes:
Helper::General, Helper::Terminal
Defined in:
lib/redbreast/commands/color_generator.rb

Overview

Class for generating color files

Constant Summary

Constants included from Helper::General

Helper::General::ESCAPE_KEYWORDS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helper::General

#app_name, #bundles, #clean_case_name, #clean_enum_name, #clean_variable_name, #config, #escape_keyword_if_needed, #escape_with_underscore_if_needed, #indent, #programming_language, #upper_camel_case

Methods included from Helper::Terminal

#prompt, #success

Class Method Details

.initObject



8
9
10
# File 'lib/redbreast/commands/color_generator.rb', line 8

def self.init
  new.call
end

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
# File 'lib/redbreast/commands/color_generator.rb', line 12

def call
  filtered_bundles = bundles.select { |bundle| bundle[:outputSourcePathColors] }
  return if filtered_bundles.empty?

  prompt.say('Generating color resources...')
  generate_color_sources(filtered_bundles, app_name)
  success('Color resources generated!')
end