Sha256: a05c1571ebfc7eaae3125a9311943f92b814a8621a32aee4191a9d3623015374

Contents?: true

Size: 611 Bytes

Versions: 1

Compression:

Stored size: 611 Bytes

Contents

require 'rails'

class Protod
  class TaskGenerator < Rails::Generators::Base
    def create_raketask
      create_file "lib/tasks/protod.rake", <<~RUBY
        # frozen_string_literal: true

        begin
          require 'protod/rake_task'

          Protod::RakeTask::Builder.new do |builder|
            # If you want to change the rake task namespace, comment in it.
            # default: :protod
            # builder.name = :pd
          end.build
        rescue LoadError => e
          $stderr.puts "#\{e\}\\nYou might should remove 'lib/tasks/protod.rake'."
        end
      RUBY
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
protod-0.1.0 lib/generators/protod/task_generator.rb