Sha256: 5534ec9c8a471ca88d7da04ce5c8203798f1661189e2ef7ef1472473218a5713

Contents?: true

Size: 943 Bytes

Versions: 5

Compression:

Stored size: 943 Bytes

Contents

module RubiGen #:nodoc:
  module Commands #:nodoc:
    class Create #:nodoc:
      # Launch given Rake task in destination_path
      def rake(task_name)
        logger.rake task_name
        Dir.chdir(destination_path('')){
         system("rake #{task_name}")
        }
      end
      
      # Copy one directory to another in destination_path
      # Can be useful to duplicate index from development to production,
      # instead of indexing twice.
      def mirror(relative_source,relative_destination)
        logger.mirror "#{relative_source} -> #{relative_destination}"
        source      = destination_path(relative_source)
        destination = destination_path(relative_destination)
        FileUtils.cp_r source, destination
      end

      # Remove every file from destination_path
      # Useful to remove temporary dirs.
      def clean
        FileUtils.remove_entry_secure destination_path('')
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
picolena-0.1.1 lib/rubigen_ext.rb
picolena-0.1.2 lib/rubigen_ext.rb
picolena-0.1.3 lib/rubigen_ext.rb
picolena-0.1.4 lib/rubigen_ext.rb
picolena-0.1.5 lib/rubigen_ext.rb