Sha256: 0cb363546bf35b2bf1f60d42423a42c1030f69aaa86c2e95f42ab8784abf6e87

Contents?: true

Size: 1.1 KB

Versions: 11

Compression:

Stored size: 1.1 KB

Contents

module PowerStencil
  module Utils

    module Completion

      class FakeIgnoreList
        attr_accessor :return_value
        def ignore_file?(file)
          return_value
        end
      end

      include PowerStencil::Utils::DirectoryProcessor

      def generate_zsh_completion(script_name, target_file, generating_project_completion)

        source_dir = File.join PowerStencil::Project::Paths.system_templates_templates_path, 'zsh_command_line_completion'
        source_template = File.join source_dir, '_power_stencil.sh.erb'

        engine = PowerStencil::Engine::InitEngine.new
        engine.dsl = PowerStencil::Dsl::Completion
        engine.dsl.script_name = script_name
        engine.dsl.generating_project_completion = generating_project_completion

        engine.instance_eval do
          @files_not_to_rename = FakeIgnoreList.new
          files_not_to_rename.return_value = true
          @files_not_to_render = FakeIgnoreList.new
          files_not_to_render.return_value = false
        end

        engine.render_single_template_file source_template, target_file

      end

    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
power_stencil-0.10.0 lib/power_stencil/utils/completion.rb
power_stencil-0.9.8 lib/power_stencil/utils/completion.rb
power_stencil-0.9.7 lib/power_stencil/utils/completion.rb
power_stencil-0.9.6 lib/power_stencil/utils/completion.rb
power_stencil-0.9.5 lib/power_stencil/utils/completion.rb
power_stencil-0.9.4 lib/power_stencil/utils/completion.rb
power_stencil-0.9.3 lib/power_stencil/utils/completion.rb
power_stencil-0.9.2 lib/power_stencil/utils/completion.rb
power_stencil-0.9.1 lib/power_stencil/utils/completion.rb
power_stencil-0.9.0 lib/power_stencil/utils/completion.rb
power_stencil-0.8.14 lib/power_stencil/utils/completion.rb