Module: Rake::DSL

Defined in:
lib/rake_hdfs/hdfs_dsl_definition.rb

Instance Method Summary collapse

Instance Method Details

#hdirectory(*args, &block) ⇒ Object

:doc:



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rake_hdfs/hdfs_dsl_definition.rb', line 12

def hdirectory(*args, &block) # :doc:
  result = hfile_create(*args, &block)
  dir, _ = *Rake.application.resolve_args(args)
  dir = Rake.from_pathname(dir)
  Rake.each_dir_parent(dir) do |d|
    hfile_create d do |t|
      hmkdir_p t.name unless WebHDFS::FileUtils.exist?(t.name)
    end
  end
  result
end

#hfile(*args, &block) ⇒ Object

:doc:



4
5
6
# File 'lib/rake_hdfs/hdfs_dsl_definition.rb', line 4

def hfile(*args, &block) # :doc:
  Rake::HDFSFileTask.define_task(*args, &block)
end

#hfile_create(*args, &block) ⇒ Object



8
9
10
# File 'lib/rake_hdfs/hdfs_dsl_definition.rb', line 8

def hfile_create(*args, &block)
  Rake::HDFSFileCreationTask.define_task(*args, &block)
end