Sha256: 89e25382881e7b6e783c8b844d5160d01826947f35d912c351a8ce89295dbb9c

Contents?: true

Size: 1.21 KB

Versions: 30

Compression:

Stored size: 1.21 KB

Contents

module FaaStRuby
  module Local
    class StaticFileProcessor < Processor

      def added(event)
        debug "added(#{event.inspect})"
        # This should trigger
        # - Copy to workspace
        deploy(event)
      end

      def modified(event)
        debug "modified(#{event.inspect})"
        # This should trigger
        # - Copy to workspace
        deploy(event)
      end

      def removed(event)
        debug "removed(#{event.inspect})"
        # This should trigger
        # - Remove from workspace
        remove_from_workspace(event)
      end

      def deploy(event)
        static_file = StaticFile.new(
          full_path: event.full_path,
          relative_path: event.relative_path,
          filename: event.filename,
          dirname: event.dirname
        )
        run(event.relative_path, 'deploy') {static_file.deploy}
      end

      def remove_from_workspace(event)
        static_file = StaticFile.new(
          full_path: event.full_path,
          relative_path: event.relative_path,
          filename: event.filename,
          dirname: event.dirname
        )
        run(event.relative_path, 'remove_from_workspace') {static_file.remove_from_workspace}
      end

    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
faastruby-0.5.30 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.29 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.28 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.27 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.26 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.25 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.24 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.23 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.22 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.21 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.20 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.19 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.18 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.17 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.16 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.15 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.14 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.13 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.12 lib/faastruby/local/processors/static_file.rb
faastruby-0.5.11 lib/faastruby/local/processors/static_file.rb