Sha256: 760cfb09bd6ce68c62528f74b4c46d5476124022ed0814c12e464183d67f2b71

Contents?: true

Size: 765 Bytes

Versions: 3

Compression:

Stored size: 765 Bytes

Contents

module Munge
  class Runner
    class << self
      def method_missing(method, root_path, *args)
        runner = new(application(root_path))
        runner.public_send(method, *args)
      end

      def respond_to_missing?(method, *)
        if instance_methods.include?(method)
          true
        else
          super
        end
      end

      def application(root_path)
        bootstrap = Munge::Bootstrap.new_from_dir(root_path: root_path)

        bootstrap.app
      end
    end

    def initialize(application)
      @app = application
    end

    def write
      @app.write do |item, did_write|
        if did_write
          puts "wrote #{item.route}"
        else
          puts "identical #{item.route}"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
munge-0.6.0 lib/munge/runner.rb
munge-0.5.0 lib/munge/runner.rb
munge-0.5.0.beta1 lib/munge/runner.rb