Class: Masticate::Command
- Inherits:
-
Thor
- Object
- Thor
- Masticate::Command
- Defined in:
- lib/masticate/command.rb
Instance Method Summary collapse
- #concat(*args) ⇒ Object
- #cook(filename = nil) ⇒ Object
- #csvify(filename = nil) ⇒ Object
- #datify(filename = nil) ⇒ Object
- #exclude(filename = nil) ⇒ Object
- #gsub(filename = nil) ⇒ Object
- #include(filename = nil) ⇒ Object
- #maxrows(filename = nil) ⇒ Object
- #mend(filename = nil) ⇒ Object
- #pluck(filename = nil) ⇒ Object
- #relabel(filename = nil) ⇒ Object
- #sniff ⇒ Object
- #transform(filename = nil) ⇒ Object
Instance Method Details
#concat(*args) ⇒ Object
108 109 110 |
# File 'lib/masticate/command.rb', line 108 def concat(*args) Masticate.concat(args, params) end |
#cook(filename = nil) ⇒ Object
150 151 152 |
# File 'lib/masticate/command.rb', line 150 def cook(filename = nil) execute(filename) end |
#csvify(filename = nil) ⇒ Object
65 66 67 |
# File 'lib/masticate/command.rb', line 65 def csvify(filename = nil) execute(filename) end |
#datify(filename = nil) ⇒ Object
82 83 84 |
# File 'lib/masticate/command.rb', line 82 def datify(filename = nil) execute(filename) end |
#exclude(filename = nil) ⇒ Object
125 126 127 |
# File 'lib/masticate/command.rb', line 125 def exclude(filename = nil) execute(filename) end |
#gsub(filename = nil) ⇒ Object
92 93 94 |
# File 'lib/masticate/command.rb', line 92 def gsub(filename = nil) execute(filename) end |
#include(filename = nil) ⇒ Object
134 135 136 |
# File 'lib/masticate/command.rb', line 134 def include(filename = nil) execute(filename) end |
#maxrows(filename = nil) ⇒ Object
101 102 103 |
# File 'lib/masticate/command.rb', line 101 def maxrows(filename = nil) execute(filename) end |
#mend(filename = nil) ⇒ Object
57 58 59 60 |
# File 'lib/masticate/command.rb', line 57 def mend(filename = nil) results = Masticate.mend(filename, params) (__method__, params, results) end |
#pluck(filename = nil) ⇒ Object
73 74 75 |
# File 'lib/masticate/command.rb', line 73 def pluck(filename = nil) execute(filename) end |
#relabel(filename = nil) ⇒ Object
116 117 118 |
# File 'lib/masticate/command.rb', line 116 def relabel(filename = nil) Masticate.relabel(filename, params) end |
#sniff ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/masticate/command.rb', line 36 def sniff results = Masticate.sniff(filename, params) col_sep = results[:col_sep] col_sep = "TAB" if col_sep == "\t" quote_char = results[:quote_char] || "NONE" $stderr.puts <<-EOT Processing complete. Input delimiter: #{col_sep} Quote char: #{quote_char} Field counts: #{results[:field_counts].inspect} Headers: #{results[:headers].join(',')} EOT end |
#transform(filename = nil) ⇒ Object
142 143 144 |
# File 'lib/masticate/command.rb', line 142 def transform(filename = nil) execute(filename) end |