Sha256: e4d145db53ee85d9f856c3123be5fe16ed41ae00b8492da642111a95549c3980

Contents?: true

Size: 647 Bytes

Versions: 11

Compression:

Stored size: 647 Bytes

Contents

require 'thor/group'

module Prophecy

  module Generators
    class Assets < Thor::Group
      include Thor::Actions

      def self.source_root
        File.dirname(__FILE__)
      end

      def copy_assets
        unless File.exists?('book.yml')
          warn "Cancelled. This doesn't look like a book project folder (there's no book.yml)."
          exit 2
        end
        if Dir.exists?('assets')
          warn "Cancelled. There is already an 'assets' folder here. Move it or delete it manually if you want a new copy."
          exit 2
        end
        directory(File.join('..', 'assets'), "assets")
      end
    end
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
prophecy-0.2.7 lib/prophecy/generators/assets.rb
prophecy-0.2.6 lib/prophecy/generators/assets.rb
prophecy-0.2.5 lib/prophecy/generators/assets.rb
prophecy-0.2.4 lib/prophecy/generators/assets.rb
prophecy-0.2.3 lib/prophecy/generators/assets.rb
prophecy-0.2.2 lib/prophecy/generators/assets.rb
prophecy-0.2.1 lib/prophecy/generators/assets.rb
prophecy-0.2.0 lib/prophecy/generators/assets.rb
prophecy-0.1.3 lib/prophecy/generators/assets.rb
prophecy-0.1.2 lib/prophecy/generators/assets.rb
prophecy-0.0.1 lib/prophecy/generators/assets.rb