Class: Tikarb

Inherits:
Object
  • Object
show all
Defined in:
lib/tikarb.rb,
lib/tikarb/version.rb

Defined Under Namespace

Classes: Java

Constant Summary collapse

VERSION =
"0.1.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.pathObject

Returns the value of attribute path.



27
28
29
# File 'lib/tikarb.rb', line 27

def path
  @path
end

Class Method Details

.cli(*args) ⇒ Object



45
46
47
48
49
50
51
52
# File 'lib/tikarb.rb', line 45

def cli(*args)
  Java.load

  trap_stdout do
    cli = Java::TikaCLI.new
    args.each { |arg| cli.process(arg) }
  end
end

.detect(file) ⇒ Object



29
30
31
32
33
34
# File 'lib/tikarb.rb', line 29

def detect(file)
  Java.load

  tika = Java::Tika.new
  tika.detect(file_to_input_stream(file))
end

.parse(file) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/tikarb.rb', line 36

def parse(file)
  Java.load

  tika = Java::Tika.new
   = Java::Metadata.new
  text = tika.parseToString(file_to_input_stream(file), )
  return text, ()
end