Sha256: e05f1d220031c053829cba7aff02abd1b19577249cc97e6b1ec5506e5fd8175c

Contents?: true

Size: 1.15 KB

Versions: 34

Compression:

Stored size: 1.15 KB

Contents

module FlashPlayer

  class Task < Rake::Task

    attr_accessor :input
    attr_accessor :pkg_name
    attr_accessor :pkg_version

    ##
    # This is the Rake::Task constructor
    # signature...
    def initialize task_name, rake_application
      super
      @input = task_name
      @player = FlashPlayer::Executable.new
      @pkg_name = FlashPlayer::NAME
      @pkg_version = FlashPlayer::VERSION
    end

    def execute *args
      super
      update_input_if_necessary
      @player.input = input
      @player.fdb = use_fdb?
      @player.execute
    end

    def logger=(logger)
      @player.logger = logger
    end

    def logger
      @player.logger
    end

    private

    def use_fdb?
      # Check as string b/c this is
      # how the boolean value comes
      # accross the command line input.
      ENV['USE_FDB'].to_s == 'true'
    end

    def update_input_if_necessary
      return if input.match(/\.swf$/)
      prerequisites.each do |prereq|
        if(prereq.match(/\.swf$/))
          self.input = prereq
          return
        end
      end
    end

  end
end

def flashplayer *args, &block
  FlashPlayer::Task.define_task *args, &block
end

Version data entries

34 entries across 34 versions & 3 rubygems

Version Path
h4oflashsdk-1.0.13 lib/flashplayer/task.rb
h4oflashsdk-1.0.12 lib/flashplayer/task.rb
h4oflashsdk-1.0.11 lib/flashplayer/task.rb
h4oflashsdk-1.0.10 lib/flashplayer/task.rb
h4oflashsdk-1.0.9 lib/flashplayer/task.rb
h4oflashsdk-1.0.8 lib/flashplayer/task.rb
h4oflashsdk-1.0.7 lib/flashplayer/task.rb
h4oflashsdk-1.0.6 lib/flashplayer/task.rb
h4oflashsdk-1.0.5 lib/flashplayer/task.rb
h4oflashsdk-1.0.4 lib/flashplayer/task.rb
h4oflashsdk-1.0.3 lib/flashplayer/task.rb
h4oflashsdk-1.0.2 lib/flashplayer/task.rb
h4oflashsdk-1.0.1 lib/flashplayer/task.rb
h4oflashsdk-1.0.0 lib/flashplayer/task.rb
flashsdk_sqe-0.0.14 lib/flashplayer/task.rb
flashsdk_sqe-0.0.13 lib/flashplayer/task.rb
flashsdk_sqe-0.0.12 lib/flashplayer/task.rb
flashsdk_sqe-0.0.11 lib/flashplayer/task.rb
flashsdk_sqe-0.0.10 lib/flashplayer/task.rb
flashsdk_sqe-0.0.9 lib/flashplayer/task.rb