Sha256: a108a1c4b242a5bc2b6e2743abb33496afff2de8850a43a0d9f1a9a578d6b628

Contents?: true

Size: 1.27 KB

Versions: 87

Compression:

Stored size: 1.27 KB

Contents

#
# Copyright 2012 Mortar Data Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require "mortar/generators/generator_base"
module Mortar
  module Generators
    class PigscriptGenerator < Base

      def generate_pigscript(script_name, project, options)
        set_script_binding(script_name, options)


        generate_file "pigscript.pig", "pigscripts/#{script_name}.pig", :recursive => true
        copy_file "python_udf.py", "udfs/python/#{script_name}.py", :recursive => true if not options[:skip_udf]
      end

      protected

        def set_script_binding(script_name, options)
          options = options
          script_name = script_name
          script_name_alias = script_name.gsub /[^0-9a-z]/i, ''
          @script_binding = binding
        end 
      
    end
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
mortar-0.15.53 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.52 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.51 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.50 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.49 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.48 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.47 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.46 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.45 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.44 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.43 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.42 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.41 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.40 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.39 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.38 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.37 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.36 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.35 lib/mortar/generators/pigscript_generator.rb
mortar-0.15.34 lib/mortar/generators/pigscript_generator.rb