Sha256: 4513112b1eeb01fe2aa0dd202d03cd2184e134a42faf3fe0a7620bdeaf240c71

Contents?: true

Size: 536 Bytes

Versions: 13

Compression:

Stored size: 536 Bytes

Contents

# encoding: UTF-8

module ScriptEditorHelper
  # @param pars [Array]
  # @return [nil]
  def add_pars_to_controllers(pars)
    Dir["#{@app_structure.controllers_fld}/*"].each do |controller|
      content = load_file_text(controller)
      content.sub!(/CONFIG = \{[\s\w:',.\/\?=\-]*?\s\s}/) { |config|
        pars.each { |par| config.sub!(/CONFIG = \{\n/, "CONFIG = {\n\t\t\t#{par},\n") unless content[par] || content[par[/['"][\s\w:,.\/\?=\-]+?['"]/]] }
        config
      }
      create_file(controller, content)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
joe_utils-0.1.6 lib/joe_utils/helpers/script_editor_helper.rb
joe_utils-0.0.12 lib/joe_utils/script_editor_helper.rb
joe_utils-0.0.11 lib/joe_utils/script_editor_helper.rb
joe_utils-0.0.10 lib/joe_utils/script_editor_helper.rb
joe_utils-0.0.9 lib/joe_utils/script_editor_helper.rb
joe_utils-0.0.8 lib/joe_utils/script_editor_helper.rb
joe_utils-0.0.7 lib/joe_utils/script_editor_helper.rb
joe_utils-0.0.6 lib/joe_utils/script_editor_helper.rb
joe_utils-0.0.5 lib/joe_utils/script_editor_helper.rb
joe_utils-0.0.4 lib/joe_utils/script_editor_helper.rb
joe_utils-0.0.3 lib/joe_utils/script_editor_helper.rb
joe_utils-0.0.2 lib/joe_utils/script_editor_helper.rb
joe_utils-0.0.0 lib/joe_utils/script_editor_helper.rb