Module: ArgScanner
- Defined in:
- lib/arg_scanner.rb,
lib/arg_scanner/options.rb,
lib/arg_scanner/version.rb,
lib/arg_scanner/workspace.rb,
lib/arg_scanner/type_tracker.rb,
lib/arg_scanner/state_tracker.rb,
ext/arg_scanner/arg_scanner.c
Defined Under Namespace
Classes: StateTracker, TypeTracker, TypeTrackerPerformanceMonitor, Workspace
Constant Summary collapse
- OPTIONS =
OpenStruct.new( :enable_type_tracker => ENV['ARG_SCANNER_ENABLE_TYPE_TRACKER'], :enable_state_tracker => ENV['ARG_SCANNER_ENABLE_STATE_TRACKER'], :output_directory => ENV['ARG_SCANNER_DIR'], :catch_only_every_n_call => ENV['ARG_SCANNER_CATCH_ONLY_EVERY_N_CALL'] || 1, :project_root => ENV['ARG_SCANNER_PROJECT_ROOT'], :pipe_file_path => ENV['ARG_SCANNER_PIPE_FILE_PATH'] || '', :buffering => ENV['ARG_SCANNER_BUFFERING'] )
- VERSION =
"0.3.3"
Class Method Summary collapse
-
.check_if_arg_scanner_ready ⇒ Object
returns Qnil if ready; or string containing error message otherwise.
- .destructor ⇒ Object
-
.get_args_info ⇒ Object
For testing.
- .get_call_info ⇒ Object
- .handle_call ⇒ Object
- .handle_return ⇒ Object
- .init(pipe_file_path, buffering, project_root_local, catch_only_every_n_call_local) ⇒ Object
Class Method Details
.check_if_arg_scanner_ready ⇒ Object
returns Qnil if ready; or string containing error message otherwise
89 |
# File 'ext/arg_scanner/arg_scanner.c', line 89 static VALUE check_if_arg_scanner_ready(VALUE self); |
.destructor ⇒ Object
85 |
# File 'ext/arg_scanner/arg_scanner.c', line 85 static VALUE destructor(VALUE self); |
.get_args_info ⇒ Object
For testing
92 |
# File 'ext/arg_scanner/arg_scanner.c', line 92 static VALUE get_args_info_rb(VALUE self); |
.get_call_info ⇒ Object
93 |
# File 'ext/arg_scanner/arg_scanner.c', line 93 static VALUE get_call_info_rb(VALUE self); |
.handle_call ⇒ Object
83 |
# File 'ext/arg_scanner/arg_scanner.c', line 83 static VALUE handle_call(VALUE self, VALUE tp); |
.handle_return ⇒ Object
84 |
# File 'ext/arg_scanner/arg_scanner.c', line 84 static VALUE handle_return(VALUE self, VALUE tp); |
.init(pipe_file_path, buffering, project_root_local, catch_only_every_n_call_local) ⇒ Object
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'ext/arg_scanner/arg_scanner.c', line 188 static VALUE init(VALUE self, VALUE pipe_file_path, VALUE buffering, VALUE project_root_local, VALUE catch_only_every_n_call_local) { if (pipe_file_path != Qnil) { pipe_file_path = (1, &pipe_file_path); // https://ruby-doc.org/core-2.2.0/File.html#method-c-expand_path const char *pipe_file_path_c = StringValueCStr(pipe_file_path); if (!file_exists(pipe_file_path_c)) { fprintf(stderr, "Specified pipe file: %s doesn't exists\n", pipe_file_path_c); exit(1); } pipe_file = fopen(pipe_file_path_c, "w"); if (pipe_file == NULL) { fprintf(stderr, "Cannot open pipe file \"%s\" with write access\n", pipe_file_path_c); exit(1); } int buffering_disabled = buffering == Qnil; if (buffering_disabled) { setbuf(pipe_file, NULL); } } if (project_root_local != Qnil) { project_root = strdup(StringValueCStr(project_root_local)); } if (catch_only_every_n_call_local != Qnil) { if (sscanf(StringValueCStr(catch_only_every_n_call_local), "%d", &catch_only_every_n_call) != 1) { fprintf(stderr, "Please specify number in --catch-only-every-N-call arg\n"); exit(1); } srand(time(0)); } return Qnil; } |