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.4.17 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.16 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.15 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.14 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.13 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.12 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.11 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.10 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.9 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.8 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.7 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.6 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.5 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.4 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.3 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.2 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.1 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.4.0 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.3.9 lib/power_stencil/command_processors/new_plugin.rb
power_stencil-0.3.8 lib/power_stencil/command_processors/new_plugin.rb