Class: Maatkit::Find

Inherits:
Object
  • Object
show all
Defined in:
lib/maatkit-ruby/mk-find.rb

Overview

Find MySQL tables and execute actions, like GNU find.

Maatkit::Find.new( array, str, array)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Find

Returns a new Find Object



80
81
# File 'lib/maatkit-ruby/mk-find.rb', line 80

def initialize()
end

Instance Attribute Details

#ask_pass ⇒ Object

FALSE



15
16
17
# File 'lib/maatkit-ruby/mk-find.rb', line 15

def ask_pass
  @ask_pass
end

#autoinc ⇒ Object

(No value)



16
17
18
# File 'lib/maatkit-ruby/mk-find.rb', line 16

def autoinc
  @autoinc
end

#avgrowlen ⇒ Object

(No value)



17
18
19
# File 'lib/maatkit-ruby/mk-find.rb', line 17

def avgrowlen
  @avgrowlen
end

#case_insensitive ⇒ Object

FALSE



18
19
20
# File 'lib/maatkit-ruby/mk-find.rb', line 18

def case_insensitive
  @case_insensitive
end

#charset ⇒ Object

(No value)



19
20
21
# File 'lib/maatkit-ruby/mk-find.rb', line 19

def charset
  @charset
end

#checksum ⇒ Object

(No value)



20
21
22
# File 'lib/maatkit-ruby/mk-find.rb', line 20

def checksum
  @checksum
end

#cmin ⇒ Object

(No value)



21
22
23
# File 'lib/maatkit-ruby/mk-find.rb', line 21

def cmin
  @cmin
end

#collation ⇒ Object

(No value)



22
23
24
# File 'lib/maatkit-ruby/mk-find.rb', line 22

def collation
  @collation
end

#column_name ⇒ Object

(No value)



23
24
25
# File 'lib/maatkit-ruby/mk-find.rb', line 23

def column_name
  @column_name
end

#column_type ⇒ Object

(No value)



24
25
26
# File 'lib/maatkit-ruby/mk-find.rb', line 24

def column_type
  @column_type
end

#comment ⇒ Object

(No value)



25
26
27
# File 'lib/maatkit-ruby/mk-find.rb', line 25

def comment
  @comment
end

#config ⇒ Object

/etc/maatkit/maatkit.conf,/etc/maatkit/mk_find.conf,/home/joel/.maatkit.conf,/home/joel/.mk_find.conf



26
27
28
# File 'lib/maatkit-ruby/mk-find.rb', line 26

def config
  @config
end

#connection_id ⇒ Object

(No value)



27
28
29
# File 'lib/maatkit-ruby/mk-find.rb', line 27

def connection_id
  @connection_id
end

#createopts ⇒ Object

(No value)



28
29
30
# File 'lib/maatkit-ruby/mk-find.rb', line 28

def createopts
  @createopts
end

#ctime ⇒ Object

(No value)



29
30
31
# File 'lib/maatkit-ruby/mk-find.rb', line 29

def ctime
  @ctime
end

#datafree ⇒ Object

(No value)



30
31
32
# File 'lib/maatkit-ruby/mk-find.rb', line 30

def datafree
  @datafree
end

#datasize ⇒ Object

(No value)



31
32
33
# File 'lib/maatkit-ruby/mk-find.rb', line 31

def datasize
  @datasize
end

#day_start ⇒ Object

FALSE



32
33
34
# File 'lib/maatkit-ruby/mk-find.rb', line 32

def day_start
  @day_start
end

#dblike ⇒ Object

(No value)



33
34
35
# File 'lib/maatkit-ruby/mk-find.rb', line 33

def dblike
  @dblike
end

#dbregex ⇒ Object

(No value)



34
35
36
# File 'lib/maatkit-ruby/mk-find.rb', line 34

def dbregex
  @dbregex
end

#defaults_file ⇒ Object

(No value)



35
36
37
# File 'lib/maatkit-ruby/mk-find.rb', line 35

def defaults_file
  @defaults_file
end

#empty ⇒ Object

FALSE



36
37
38
# File 'lib/maatkit-ruby/mk-find.rb', line 36

def empty
  @empty
end

#engine ⇒ Object

(No value)



37
38
39
# File 'lib/maatkit-ruby/mk-find.rb', line 37

def engine
  @engine
end

#exec ⇒ Object

(No value)



38
39
40
# File 'lib/maatkit-ruby/mk-find.rb', line 38

def exec
  @exec
end

#exec_dsn ⇒ Object

(No value)



39
40
41
# File 'lib/maatkit-ruby/mk-find.rb', line 39

def exec_dsn
  @exec_dsn
end

#exec_plus ⇒ Object

(No value)



40
41
42
# File 'lib/maatkit-ruby/mk-find.rb', line 40

def exec_plus
  @exec_plus
end

#function ⇒ Object

(No value)



41
42
43
# File 'lib/maatkit-ruby/mk-find.rb', line 41

def function
  @function
end

#help ⇒ Object

TRUE



42
43
44
# File 'lib/maatkit-ruby/mk-find.rb', line 42

def help
  @help
end

#host ⇒ Object

(No value)



43
44
45
# File 'lib/maatkit-ruby/mk-find.rb', line 43

def host
  @host
end

#indexsize ⇒ Object

(No value)



44
45
46
# File 'lib/maatkit-ruby/mk-find.rb', line 44

def indexsize
  @indexsize
end

#kmin ⇒ Object

(No value)



45
46
47
# File 'lib/maatkit-ruby/mk-find.rb', line 45

def kmin
  @kmin
end

#ktime ⇒ Object

(No value)



46
47
48
# File 'lib/maatkit-ruby/mk-find.rb', line 46

def ktime
  @ktime
end

#mmin ⇒ Object

(No value)



47
48
49
# File 'lib/maatkit-ruby/mk-find.rb', line 47

def mmin
  @mmin
end

#mtime ⇒ Object

(No value)



48
49
50
# File 'lib/maatkit-ruby/mk-find.rb', line 48

def mtime
  @mtime
end

#or ⇒ Object

FALSE



49
50
51
# File 'lib/maatkit-ruby/mk-find.rb', line 49

def or
  @or
end

#password ⇒ Object

(No value)



50
51
52
# File 'lib/maatkit-ruby/mk-find.rb', line 50

def password
  @password
end

#path_to_mk_find ⇒ Object

Sets the executable path, otherwise the environment path will be used.



75
76
77
# File 'lib/maatkit-ruby/mk-find.rb', line 75

def path_to_mk_find
  @path_to_mk_find
end

#pid ⇒ Object

(No value)



51
52
53
# File 'lib/maatkit-ruby/mk-find.rb', line 51

def pid
  @pid
end

#port ⇒ Object

(No value)



52
53
54
# File 'lib/maatkit-ruby/mk-find.rb', line 52

def port
  @port
end

FALSE



53
54
55
# File 'lib/maatkit-ruby/mk-find.rb', line 53

def print
  @print
end

#printf ⇒ Object

(No value)



54
55
56
# File 'lib/maatkit-ruby/mk-find.rb', line 54

def printf
  @printf
end

#procedure ⇒ Object

(No value)



55
56
57
# File 'lib/maatkit-ruby/mk-find.rb', line 55

def procedure
  @procedure
end

#quote ⇒ Object

TRUE



56
57
58
# File 'lib/maatkit-ruby/mk-find.rb', line 56

def quote
  @quote
end

#rowformat ⇒ Object

(No value)



57
58
59
# File 'lib/maatkit-ruby/mk-find.rb', line 57

def rowformat
  @rowformat
end

#rows ⇒ Object

(No value)



58
59
60
# File 'lib/maatkit-ruby/mk-find.rb', line 58

def rows
  @rows
end

#server_id ⇒ Object

(No value)



59
60
61
# File 'lib/maatkit-ruby/mk-find.rb', line 59

def server_id
  @server_id
end

#set_vars ⇒ Object

wait_timeout=10000



60
61
62
# File 'lib/maatkit-ruby/mk-find.rb', line 60

def set_vars
  @set_vars
end

#socket ⇒ Object

(No value)



61
62
63
# File 'lib/maatkit-ruby/mk-find.rb', line 61

def socket
  @socket
end

#tablesize ⇒ Object

(No value)



62
63
64
# File 'lib/maatkit-ruby/mk-find.rb', line 62

def tablesize
  @tablesize
end

#tbllike ⇒ Object

(No value)



63
64
65
# File 'lib/maatkit-ruby/mk-find.rb', line 63

def tbllike
  @tbllike
end

#tblregex ⇒ Object

(No value)



64
65
66
# File 'lib/maatkit-ruby/mk-find.rb', line 64

def tblregex
  @tblregex
end

#tblversion ⇒ Object

(No value)



65
66
67
# File 'lib/maatkit-ruby/mk-find.rb', line 65

def tblversion
  @tblversion
end

#trigger ⇒ Object

(No value)



66
67
68
# File 'lib/maatkit-ruby/mk-find.rb', line 66

def trigger
  @trigger
end

#trigger_table ⇒ Object

(No value)



67
68
69
# File 'lib/maatkit-ruby/mk-find.rb', line 67

def trigger_table
  @trigger_table
end

#user ⇒ Object

(No value)



68
69
70
# File 'lib/maatkit-ruby/mk-find.rb', line 68

def user
  @user
end

#version ⇒ Object

FALSE



69
70
71
# File 'lib/maatkit-ruby/mk-find.rb', line 69

def version
  @version
end

#view ⇒ Object

(No value)



70
71
72
# File 'lib/maatkit-ruby/mk-find.rb', line 70

def view
  @view
end

Instance Method Details

#start(options = nil) ⇒ Object

Execute the command



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/maatkit-ruby/mk-find.rb', line 86

def start(options = nil)
  tmp = Tempfile.new('tmp')
  command = option_string() + options.to_s + " 2> " + tmp.path
  success = system(command)
  if success
    begin
      while (line = tmp.readline)
        line.chomp
        selected_string = line
      end
    rescue EOFError
      tmp.close
    end
    return selected_string
  else
    tmp.close!
    return success
  end
end