Class: Blufin::YmlJavaCssDependencyWriter
- Inherits:
-
YmlWriterBase
- Object
- YmlWriterBase
- Blufin::YmlJavaCssDependencyWriter
- Defined in:
- lib/core/yml_writers/yml_java_css_dependency_writer.rb
Constant Summary
Constants inherited from YmlWriterBase
Blufin::YmlWriterBase::AUTO_TYPES, Blufin::YmlWriterBase::PLACEHOLDER_CLASS, Blufin::YmlWriterBase::PLACEHOLDER_IMPORT, Blufin::YmlWriterBase::PLACEHOLDER_PACKAGE, Blufin::YmlWriterBase::PLACEHOLDER_SCHEMA
Instance Method Summary collapse
-
#initialize(site) ⇒ Object
constructor
Initialize the class.
-
#write ⇒ Object
Write the file(s).
Methods inherited from YmlWriterBase
#get_base_path, #get_java_path, #get_package, #get_package_from_file, #write_file_java
Constructor Details
#initialize(site) ⇒ Object
Initialize the class.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/core/yml_writers/yml_java_css_dependency_writer.rb', line 7 def initialize(site) @site = Blufin::SiteResolver::validate_site(site) @site_name = Blufin::SiteResolver::get_site_name(@site) @site_domain = Blufin::SiteResolver::get_site_domain(@site) @site_location = "#{Blufin::SiteResolver::get_site_location(@site)}/" # Wipe out all previous files. # Blufin::YmlSchemaValidator::VALID_SCHEMAS_GENERATE.each do |schema| # %W( # #{@embedded_path}/base # #{@embedded_path}/field # #{@embedded_path}/filter # #{@embedded_path}/mapper # #{@embedded_path}/refiner # #{@embedded_path}/service # #{@embedded_path}/sort # ).each do |path_to_wipe_out| # if Blufin::Files::path_exists(path_to_wipe_out) # if Blufin::Files::get_files_in_dir(path_to_wipe_out).any? # Blufin::Terminal::command('rm *', path_to_wipe_out, false, false) unless path_to_wipe_out == "#{@embedded_path}/dto" # Safe-guard to prevent accidental deletion of /dto folder. # end # end # end # end @template = "package \#{PLACEHOLDER_PACKAGE};\n\npublic class \#{PLACEHOLDER_CLASS} {\n\n}\n" end |
Instance Method Details
#write ⇒ Object
Write the file(s).
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/core/yml_writers/yml_java_css_dependency_writer.rb', line 45 def write # class_name = 'MessageType' # # contents = @template # contents = contents.gsub(PLACEHOLDER_PACKAGE, get_package(@site, nil, PACKAGE, SERVICE)) # contents = contents.gsub(PLACEHOLDER_CLASS, class_name) # # write_file_java("#{get_java_path(@site, nil, SERVICE, PACKAGE)}/#{class_name}.java", Blufin::YmlCommon::convert_string_to_line_array(contents)) end |