Sha256: c8f6de0ae86b35d4533f38ee10a70f989f296300d03f18c655a010dc265010a0

Contents?: true

Size: 979 Bytes

Versions: 28

Compression:

Stored size: 979 Bytes

Contents

module PowerStencil
  module CommandProcessors

    class NewPlugin

      include Climatic::Script::UnimplementedProcessor
      include Climatic::Proxy
      include PowerStencil::Project::Proxy

      def execute
        if config.command_line_layer.extra_parameters.empty?
          raise PowerStencil::Error, 'Please specify a plugin name!'
        end
        config.command_line_layer.extra_parameters.each do |plugin_name|
          begin
            target_path = File.join project.project_plugin_path(plugin_name)
            project.create_plugin_tree plugin_name, target_path
            puts "Generated new plugin '#{plugin_name}'"
          rescue => e
            msg = "Could not create plugin '#{plugin_name}' because '#{e.message}'"
            puts msg
            logger.error "Could not create plugin '#{plugin_name}' because '#{e.message}'"
            logger.debug PowerStencil::Error.report_error(e)
          end
        end
      end

    end

  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
power_stencil-0.3.7 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.3.6 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.3.5 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.3.4 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.3.3 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.3.2 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.3.1 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.3.0 lib/power_stencil/command_processors/new_plugin.rb