Sha256: 8dd59e29d4c97e6a3479954cbcf5dd232e28930e30b3cf442afefd109f5e74d9

Contents?: true

Size: 789 Bytes

Versions: 9

Compression:

Stored size: 789 Bytes

Contents

# frozen_string_literal: true

require 'rake'
require 'rake/tasklib'
require 'archival'

class RakeTasks
  # Common tasks for archival.
  #
  # To include, just add
  #
  # require 'archival/rake_tasks'
  #
  # to your Rakefile.
  include Rake::DSL if defined? Rake::DSL

  class << self
    # set when install'd.
    attr_accessor :instance

    def install_tasks
      new.install
    end
  end

  def install
    build_dir = Dir.pwd

    task 'build' do
      Archival::Logger.benchmark('built') do
        config = Archival::Config.new('root' => build_dir)
        builder = Archival::Builder.new(config)
        builder.write_all
      end
    end

    task 'run' do
      Archival.listen('root' => build_dir)
    end

    RakeTasks.instance = self
  end
end

RakeTasks.install_tasks

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
archival-0.0.12 lib/archival/rake_tasks.rb
archival-0.0.11 lib/archival/rake_tasks.rb
archival-0.0.10 lib/archival/rake_tasks.rb
archival-0.0.9 lib/archival/rake_tasks.rb
archival-0.0.8 lib/archival/rake_tasks.rb
archival-0.0.7 lib/archival/rake_tasks.rb
archival-0.0.6 lib/archival/rake_tasks.rb
archival-0.0.5 lib/archival/rake_tasks.rb
archival-0.0.4 lib/archival/rake_tasks.rb