Class: Canon::Config::DiffConfig
- Inherits:
-
Object
- Object
- Canon::Config::DiffConfig
- Defined in:
- lib/canon/config.rb
Overview
Diff configuration for output formatting
Instance Method Summary collapse
- #algorithm ⇒ Object
- #algorithm=(value) ⇒ Object
- #context_lines ⇒ Object
- #context_lines=(value) ⇒ Object
- #grouping_lines ⇒ Object
- #grouping_lines=(value) ⇒ Object
-
#initialize(format = nil) ⇒ DiffConfig
constructor
A new instance of DiffConfig.
-
#max_diff_lines ⇒ Object
Maximum diff output lines (default 10,000).
- #max_diff_lines=(value) ⇒ Object
-
#max_file_size ⇒ Object
File size limit in bytes (default 5MB).
- #max_file_size=(value) ⇒ Object
-
#max_node_count ⇒ Object
Maximum node count in tree (default 10,000).
- #max_node_count=(value) ⇒ Object
-
#mode ⇒ Object
Accessors with ENV override support.
- #mode=(value) ⇒ Object
- #reset! ⇒ Object
- #show_diffs ⇒ Object
- #show_diffs=(value) ⇒ Object
- #show_line_numbered_inputs ⇒ Object
- #show_line_numbered_inputs=(value) ⇒ Object
- #show_preprocessed_inputs ⇒ Object
- #show_preprocessed_inputs=(value) ⇒ Object
- #show_raw_inputs ⇒ Object
- #show_raw_inputs=(value) ⇒ Object
-
#to_h ⇒ Object
Build diff options.
- #use_color ⇒ Object
- #use_color=(value) ⇒ Object
- #verbose_diff ⇒ Object
- #verbose_diff=(value) ⇒ Object
Constructor Details
#initialize(format = nil) ⇒ DiffConfig
Returns a new instance of DiffConfig.
166 167 168 169 |
# File 'lib/canon/config.rb', line 166 def initialize(format = nil) @format = format @resolver = build_resolver(format) end |
Instance Method Details
#algorithm ⇒ Object
248 249 250 |
# File 'lib/canon/config.rb', line 248 def algorithm @resolver.resolve(:algorithm) end |
#algorithm=(value) ⇒ Object
252 253 254 |
# File 'lib/canon/config.rb', line 252 def algorithm=(value) @resolver.set_programmatic(:algorithm, value) end |
#context_lines ⇒ Object
192 193 194 |
# File 'lib/canon/config.rb', line 192 def context_lines @resolver.resolve(:context_lines) end |
#context_lines=(value) ⇒ Object
196 197 198 |
# File 'lib/canon/config.rb', line 196 def context_lines=(value) @resolver.set_programmatic(:context_lines, value) end |
#grouping_lines ⇒ Object
200 201 202 |
# File 'lib/canon/config.rb', line 200 def grouping_lines @resolver.resolve(:grouping_lines) end |
#grouping_lines=(value) ⇒ Object
204 205 206 |
# File 'lib/canon/config.rb', line 204 def grouping_lines=(value) @resolver.set_programmatic(:grouping_lines, value) end |
#max_diff_lines ⇒ Object
Maximum diff output lines (default 10,000)
275 276 277 |
# File 'lib/canon/config.rb', line 275 def max_diff_lines @resolver.resolve(:max_diff_lines) end |
#max_diff_lines=(value) ⇒ Object
279 280 281 |
# File 'lib/canon/config.rb', line 279 def max_diff_lines=(value) @resolver.set_programmatic(:max_diff_lines, value) end |
#max_file_size ⇒ Object
File size limit in bytes (default 5MB)
257 258 259 |
# File 'lib/canon/config.rb', line 257 def max_file_size @resolver.resolve(:max_file_size) end |
#max_file_size=(value) ⇒ Object
261 262 263 |
# File 'lib/canon/config.rb', line 261 def max_file_size=(value) @resolver.set_programmatic(:max_file_size, value) end |
#max_node_count ⇒ Object
Maximum node count in tree (default 10,000)
266 267 268 |
# File 'lib/canon/config.rb', line 266 def max_node_count @resolver.resolve(:max_node_count) end |
#max_node_count=(value) ⇒ Object
270 271 272 |
# File 'lib/canon/config.rb', line 270 def max_node_count=(value) @resolver.set_programmatic(:max_node_count, value) end |
#mode ⇒ Object
Accessors with ENV override support
176 177 178 |
# File 'lib/canon/config.rb', line 176 def mode @resolver.resolve(:mode) end |
#mode=(value) ⇒ Object
180 181 182 |
# File 'lib/canon/config.rb', line 180 def mode=(value) @resolver.set_programmatic(:mode, value) end |
#reset! ⇒ Object
171 172 173 |
# File 'lib/canon/config.rb', line 171 def reset! @resolver = build_resolver(@format) end |
#show_diffs ⇒ Object
208 209 210 |
# File 'lib/canon/config.rb', line 208 def show_diffs @resolver.resolve(:show_diffs) end |
#show_diffs=(value) ⇒ Object
212 213 214 |
# File 'lib/canon/config.rb', line 212 def show_diffs=(value) @resolver.set_programmatic(:show_diffs, value) end |
#show_line_numbered_inputs ⇒ Object
240 241 242 |
# File 'lib/canon/config.rb', line 240 def show_line_numbered_inputs @resolver.resolve(:show_line_numbered_inputs) end |
#show_line_numbered_inputs=(value) ⇒ Object
244 245 246 |
# File 'lib/canon/config.rb', line 244 def show_line_numbered_inputs=(value) @resolver.set_programmatic(:show_line_numbered_inputs, value) end |
#show_preprocessed_inputs ⇒ Object
232 233 234 |
# File 'lib/canon/config.rb', line 232 def show_preprocessed_inputs @resolver.resolve(:show_preprocessed_inputs) end |
#show_preprocessed_inputs=(value) ⇒ Object
236 237 238 |
# File 'lib/canon/config.rb', line 236 def show_preprocessed_inputs=(value) @resolver.set_programmatic(:show_preprocessed_inputs, value) end |
#show_raw_inputs ⇒ Object
224 225 226 |
# File 'lib/canon/config.rb', line 224 def show_raw_inputs @resolver.resolve(:show_raw_inputs) end |
#show_raw_inputs=(value) ⇒ Object
228 229 230 |
# File 'lib/canon/config.rb', line 228 def show_raw_inputs=(value) @resolver.set_programmatic(:show_raw_inputs, value) end |
#to_h ⇒ Object
Build diff options
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
# File 'lib/canon/config.rb', line 284 def to_h { diff: mode, use_color: use_color, context_lines: context_lines, grouping_lines: grouping_lines, show_diffs: show_diffs, verbose_diff: verbose_diff, diff_algorithm: algorithm, show_raw_inputs: show_raw_inputs, show_preprocessed_inputs: show_preprocessed_inputs, show_line_numbered_inputs: show_line_numbered_inputs, max_file_size: max_file_size, max_node_count: max_node_count, max_diff_lines: max_diff_lines, } end |
#use_color ⇒ Object
184 185 186 |
# File 'lib/canon/config.rb', line 184 def use_color @resolver.resolve(:use_color) end |
#use_color=(value) ⇒ Object
188 189 190 |
# File 'lib/canon/config.rb', line 188 def use_color=(value) @resolver.set_programmatic(:use_color, value) end |
#verbose_diff ⇒ Object
216 217 218 |
# File 'lib/canon/config.rb', line 216 def verbose_diff @resolver.resolve(:verbose_diff) end |
#verbose_diff=(value) ⇒ Object
220 221 222 |
# File 'lib/canon/config.rb', line 220 def verbose_diff=(value) @resolver.set_programmatic(:verbose_diff, value) end |