Created
June 7, 2026 04:09
-
-
Save rubys/3b40bbb41556f97992fa612056dbf904 to your computer and use it in GitHub Desktop.
roundhouse real-blog article_test out.c — spinel bab584f — implicit-new specialization cross-variant setter misbind (follow-up to matz/spinel#1344)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Generated by Spinel AOT compiler */ | |
| #include "sp_runtime.h" | |
| /* sp_sym intern table */ | |
| #define SP_SYM_COUNT 118 | |
| static const char *const sp_sym_names[118] = {(&("\xff" "OK")[1]),(&("\xff" "ROW")[1]),(&("\xff" "DONE")[1]),(&("\xff" "sqlite3_open")[1]),(&("\xff" "str")[1]),(&("\xff" "ptr")[1]),(&("\xff" "int")[1]),(&("\xff" "sqlite3_close")[1]),(&("\xff" "sqlite3_exec")[1]),(&("\xff" "sqlite3_prepare_v2")[1]),(&("\xff" "sqlite3_step")[1]),(&("\xff" "sqlite3_finalize")[1]),(&("\xff" "sqlite3_reset")[1]),(&("\xff" "sqlite3_clear_bindings")[1]),(&("\xff" "sqlite3_column_int")[1]),(&("\xff" "sqlite3_column_text")[1]),(&("\xff" "sqlite3_column_count")[1]),(&("\xff" "sqlite3_column_name")[1]),(&("\xff" "sqlite3_errmsg")[1]),(&("\xff" "sqlite3_last_insert_rowid")[1]),(&("\xff" "long")[1]),(&("\xff" "sqlite3_changes")[1]),(&("\xff" "db_out")[1]),(&("\xff" "stmt_out")[1]),(&("\xff" "read_ptr")[1]),(&("\xff" "db_conn")[1]),(&("\xff" "opt")[1]),(&("\xff" "i")[1]),(&("\xff" "record")[1]),(&("\xff" "size")[1]),(&("\xff" "free")[1]),(&("\xff" "adapter")[1]),(&("\xff" "id")[1]),(&("\xff" "row")[1]),(&("\xff" "r")[1]),(&("\xff" "updated_at")[1]),(&("\xff" "created_at")[1]),(&("\xff" "verb")[1]),(&("\xff" "pattern")[1]),(&("\xff" "controller")[1]),(&("\xff" "action")[1]),(&("\xff" "path_params")[1]),(&("\xff" "notice")[1]),(&("\xff" "alert")[1]),(&("\xff" "k")[1]),(&("\xff" "v")[1]),(&("\xff" "__body__")[1]),(&("\xff" "href")[1]),(&("\xff" "method")[1]),(&("\xff" "form_class")[1]),(&("\xff" "class")[1]),(&("\xff" "type")[1]),(&("\xff" "rel")[1]),(&("\xff" "p")[1]),(&("\xff" "name")[1]),(&("\xff" "path")[1]),(&("\xff" "inner_k")[1]),(&("\xff" "inner_v")[1]),(&("\xff" "ok")[1]),(&("\xff" "created")[1]),(&("\xff" "accepted")[1]),(&("\xff" "no_content")[1]),(&("\xff" "moved_permanently")[1]),(&("\xff" "found")[1]),(&("\xff" "see_other")[1]),(&("\xff" "not_modified")[1]),(&("\xff" "bad_request")[1]),(&("\xff" "unauthorized")[1]),(&("\xff" "forbidden")[1]),(&("\xff" "not_found")[1]),(&("\xff" "unprocessable_entity")[1]),(&("\xff" "unprocessable_content")[1]),(&("\xff" "internal_server_error")[1]),(&("\xff" "params")[1]),(&("\xff" "session")[1]),(&("\xff" "flash")[1]),(&("\xff" "request_method")[1]),(&("\xff" "request_path")[1]),(&("\xff" "request_format")[1]),(&("\xff" "status")[1]),(&("\xff" "body")[1]),(&("\xff" "location")[1]),(&("\xff" "content_type")[1]),(&("\xff" "html")[1]),(&("\xff" "append")[1]),(&("\xff" "stream")[1]),(&("\xff" "target")[1]),(&("\xff" "prepend")[1]),(&("\xff" "replace")[1]),(&("\xff" "remove")[1]),(&("\xff" "delete")[1]),(&("\xff" "comments_count")[1]),(&("\xff" "length")[1]),(&("\xff" "patch")[1]),(&("\xff" "post")[1]),(&("\xff" "error")[1]),(&("\xff" "title")[1]),(&("\xff" "a")[1]),(&("\xff" "article_id")[1]),(&("\xff" "commenter")[1]),(&("\xff" "c")[1]),(&("\xff" "head")[1]),(&("\xff" "data-turbo-track")[1]),(&("\xff" "article")[1]),(&("\xff" "index")[1]),(&("\xff" "show")[1]),(&("\xff" "new")[1]),(&("\xff" "edit")[1]),(&("\xff" "create")[1]),(&("\xff" "update")[1]),(&("\xff" "destroy")[1]),(&("\xff" "json")[1]),(&("\xff" "articles")[1]),(&("\xff" "comments")[1]),(&("\xff" "sql")[1]),(&("\xff" "success")[1]),(&("\xff" "redirect")[1]),(&("\xff" "missing")[1])}; | |
| static const char **sp_sym_dyn_names = NULL; | |
| static mrb_int sp_sym_dyn_count = 0; | |
| static mrb_int sp_sym_dyn_cap = 0; | |
| static sp_sym sp_sym_intern(const char *s) __attribute__((unused)); | |
| static sp_sym sp_sym_intern(const char *s){mrb_int i;for(i=0;i<SP_SYM_COUNT;i++){if(strcmp(sp_sym_names[i],s)==0)return (sp_sym)i;}for(i=0;i<sp_sym_dyn_count;i++){if(strcmp(sp_sym_dyn_names[i],s)==0)return (sp_sym)(SP_SYM_COUNT+i);}if(sp_sym_dyn_count>=sp_sym_dyn_cap){sp_sym_dyn_cap=sp_sym_dyn_cap?sp_sym_dyn_cap*2:8;sp_sym_dyn_names=(const char**)realloc(sp_sym_dyn_names,sizeof(char*)*sp_sym_dyn_cap);}{size_t sl=strlen(s);char*dup=(char*)malloc(sl+1);memcpy(dup,s,sl+1);sp_sym_dyn_names[sp_sym_dyn_count]=dup;}return (sp_sym)(SP_SYM_COUNT+sp_sym_dyn_count++);} | |
| static const char *sp_sym_to_s(sp_sym id) __attribute__((unused)); | |
| static const char *sp_sym_to_s(sp_sym id){if(id<0)return "";if(id<SP_SYM_COUNT)return sp_sym_names[id];mrb_int idx=(mrb_int)id-SP_SYM_COUNT;if(idx>=sp_sym_dyn_count)return "";return sp_sym_dyn_names[idx];} | |
| #define SPS_OK ((sp_sym)0) | |
| #define SPS_ROW ((sp_sym)1) | |
| #define SPS_DONE ((sp_sym)2) | |
| #define SPS_sqlite3_open ((sp_sym)3) | |
| #define SPS_str ((sp_sym)4) | |
| #define SPS_ptr ((sp_sym)5) | |
| #define SPS_int ((sp_sym)6) | |
| #define SPS_sqlite3_close ((sp_sym)7) | |
| #define SPS_sqlite3_exec ((sp_sym)8) | |
| #define SPS_sqlite3_prepare_v2 ((sp_sym)9) | |
| #define SPS_sqlite3_step ((sp_sym)10) | |
| #define SPS_sqlite3_finalize ((sp_sym)11) | |
| #define SPS_sqlite3_reset ((sp_sym)12) | |
| #define SPS_sqlite3_clear_bindings ((sp_sym)13) | |
| #define SPS_sqlite3_column_int ((sp_sym)14) | |
| #define SPS_sqlite3_column_text ((sp_sym)15) | |
| #define SPS_sqlite3_column_count ((sp_sym)16) | |
| #define SPS_sqlite3_column_name ((sp_sym)17) | |
| #define SPS_sqlite3_errmsg ((sp_sym)18) | |
| #define SPS_sqlite3_last_insert_rowid ((sp_sym)19) | |
| #define SPS_long ((sp_sym)20) | |
| #define SPS_sqlite3_changes ((sp_sym)21) | |
| #define SPS_db_out ((sp_sym)22) | |
| #define SPS_stmt_out ((sp_sym)23) | |
| #define SPS_read_ptr ((sp_sym)24) | |
| #define SPS_db_conn ((sp_sym)25) | |
| #define SPS_opt ((sp_sym)26) | |
| #define SPS_i ((sp_sym)27) | |
| #define SPS_record ((sp_sym)28) | |
| #define SPS_size ((sp_sym)29) | |
| #define SPS_free ((sp_sym)30) | |
| #define SPS_adapter ((sp_sym)31) | |
| #define SPS_id ((sp_sym)32) | |
| #define SPS_row ((sp_sym)33) | |
| #define SPS_r ((sp_sym)34) | |
| #define SPS_updated_at ((sp_sym)35) | |
| #define SPS_created_at ((sp_sym)36) | |
| #define SPS_verb ((sp_sym)37) | |
| #define SPS_pattern ((sp_sym)38) | |
| #define SPS_controller ((sp_sym)39) | |
| #define SPS_action ((sp_sym)40) | |
| #define SPS_path_params ((sp_sym)41) | |
| #define SPS_notice ((sp_sym)42) | |
| #define SPS_alert ((sp_sym)43) | |
| #define SPS_k ((sp_sym)44) | |
| #define SPS_v ((sp_sym)45) | |
| #define SPS___body__ ((sp_sym)46) | |
| #define SPS_href ((sp_sym)47) | |
| #define SPS_method ((sp_sym)48) | |
| #define SPS_form_class ((sp_sym)49) | |
| #define SPS_class ((sp_sym)50) | |
| #define SPS_type ((sp_sym)51) | |
| #define SPS_rel ((sp_sym)52) | |
| #define SPS_p ((sp_sym)53) | |
| #define SPS_name ((sp_sym)54) | |
| #define SPS_path ((sp_sym)55) | |
| #define SPS_inner_k ((sp_sym)56) | |
| #define SPS_inner_v ((sp_sym)57) | |
| #define SPS_ok ((sp_sym)58) | |
| #define SPS_created ((sp_sym)59) | |
| #define SPS_accepted ((sp_sym)60) | |
| #define SPS_no_content ((sp_sym)61) | |
| #define SPS_moved_permanently ((sp_sym)62) | |
| #define SPS_found ((sp_sym)63) | |
| #define SPS_see_other ((sp_sym)64) | |
| #define SPS_not_modified ((sp_sym)65) | |
| #define SPS_bad_request ((sp_sym)66) | |
| #define SPS_unauthorized ((sp_sym)67) | |
| #define SPS_forbidden ((sp_sym)68) | |
| #define SPS_not_found ((sp_sym)69) | |
| #define SPS_unprocessable_entity ((sp_sym)70) | |
| #define SPS_unprocessable_content ((sp_sym)71) | |
| #define SPS_internal_server_error ((sp_sym)72) | |
| #define SPS_params ((sp_sym)73) | |
| #define SPS_session ((sp_sym)74) | |
| #define SPS_flash ((sp_sym)75) | |
| #define SPS_request_method ((sp_sym)76) | |
| #define SPS_request_path ((sp_sym)77) | |
| #define SPS_request_format ((sp_sym)78) | |
| #define SPS_status ((sp_sym)79) | |
| #define SPS_body ((sp_sym)80) | |
| #define SPS_location ((sp_sym)81) | |
| #define SPS_content_type ((sp_sym)82) | |
| #define SPS_html ((sp_sym)83) | |
| #define SPS_append ((sp_sym)84) | |
| #define SPS_stream ((sp_sym)85) | |
| #define SPS_target ((sp_sym)86) | |
| #define SPS_prepend ((sp_sym)87) | |
| #define SPS_replace ((sp_sym)88) | |
| #define SPS_remove ((sp_sym)89) | |
| #define SPS_delete ((sp_sym)90) | |
| #define SPS_comments_count ((sp_sym)91) | |
| #define SPS_length ((sp_sym)92) | |
| #define SPS_patch ((sp_sym)93) | |
| #define SPS_post ((sp_sym)94) | |
| #define SPS_error ((sp_sym)95) | |
| #define SPS_title ((sp_sym)96) | |
| #define SPS_a ((sp_sym)97) | |
| #define SPS_article_id ((sp_sym)98) | |
| #define SPS_commenter ((sp_sym)99) | |
| #define SPS_c ((sp_sym)100) | |
| #define SPS_head ((sp_sym)101) | |
| #define SPS_article ((sp_sym)103) | |
| #define SPS_index ((sp_sym)104) | |
| #define SPS_show ((sp_sym)105) | |
| #define SPS_new ((sp_sym)106) | |
| #define SPS_edit ((sp_sym)107) | |
| #define SPS_create ((sp_sym)108) | |
| #define SPS_update ((sp_sym)109) | |
| #define SPS_destroy ((sp_sym)110) | |
| #define SPS_json ((sp_sym)111) | |
| #define SPS_articles ((sp_sym)112) | |
| #define SPS_comments ((sp_sym)113) | |
| #define SPS_sql ((sp_sym)114) | |
| #define SPS_success ((sp_sym)115) | |
| #define SPS_redirect ((sp_sym)116) | |
| #define SPS_missing ((sp_sym)117) | |
| typedef struct{sp_sym*keys;mrb_int*vals;sp_sym*order;mrb_int len;mrb_int cap;mrb_int mask;mrb_int default_v;}sp_SymIntHash; | |
| static void sp_SymIntHash_fin(void*p){sp_SymIntHash*h=(sp_SymIntHash*)p;free(h->keys);free(h->vals);free(h->order);} | |
| static sp_SymIntHash*sp_SymIntHash_new(void){sp_SymIntHash*h=(sp_SymIntHash*)sp_gc_alloc(sizeof(sp_SymIntHash),sp_SymIntHash_fin,NULL);h->cap=16;h->mask=15;h->keys=(sp_sym*)malloc(sizeof(sp_sym)*h->cap);for(mrb_int i=0;i<h->cap;i++)h->keys[i]=-1;h->vals=(mrb_int*)calloc(h->cap,sizeof(mrb_int));h->order=(sp_sym*)malloc(sizeof(sp_sym)*h->cap);h->len=0;h->default_v=SP_INT_NIL;return h;} | |
| static sp_SymIntHash*sp_SymIntHash_new_with_default(mrb_int d){sp_SymIntHash*h=sp_SymIntHash_new();h->default_v=d;return h;} | |
| static void sp_SymIntHash_grow(sp_SymIntHash*h){mrb_int oc=h->cap;sp_sym*ok=h->keys;mrb_int*ov=h->vals;h->cap*=2;h->mask=h->cap-1;h->keys=(sp_sym*)malloc(sizeof(sp_sym)*h->cap);for(mrb_int i=0;i<h->cap;i++)h->keys[i]=-1;h->vals=(mrb_int*)calloc(h->cap,sizeof(mrb_int));h->order=(sp_sym*)realloc(h->order,sizeof(sp_sym)*h->cap);h->len=0;for(mrb_int i=0;i<oc;i++){if(ok[i]>=0){mrb_int idx=(mrb_int)(((mrb_int)ok[i])&h->mask);while(h->keys[idx]>=0)idx=(idx+1)&h->mask;h->keys[idx]=ok[i];h->vals[idx]=ov[i];h->len++;}}free(ok);free(ov);} | |
| static mrb_int sp_SymIntHash_get(sp_SymIntHash*h,sp_sym k){if(!h)return 0;mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k)return h->vals[idx];idx=(idx+1)&h->mask;}return h->default_v;} | |
| static mrb_int sp_SymIntHash_get_opt(sp_SymIntHash*h,sp_sym k){if(!h)return SP_INT_NIL;mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k)return h->vals[idx];idx=(idx+1)&h->mask;}return h->default_v;} | |
| static void sp_SymIntHash_set(sp_SymIntHash*h,sp_sym k,mrb_int v){if(h->len*2>=h->cap)sp_SymIntHash_grow(h);mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k){h->vals[idx]=v;return;}idx=(idx+1)&h->mask;}h->keys[idx]=k;h->vals[idx]=v;h->order[h->len]=k;h->len++;} | |
| static mrb_bool sp_SymIntHash_has_key(sp_SymIntHash*h,sp_sym k){mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k)return TRUE;idx=(idx+1)&h->mask;}return FALSE;} | |
| static mrb_bool sp_SymIntHash_has_value(sp_SymIntHash*h,mrb_int v){for(mrb_int i=0;i<h->len;i++)if(sp_SymIntHash_get(h,h->order[i])==v)return TRUE;return FALSE;} | |
| static mrb_int sp_SymIntHash_length(sp_SymIntHash*h){return h->len;} | |
| static void sp_SymIntHash_delete(sp_SymIntHash*h,sp_sym k){mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k){h->keys[idx]=-1;h->vals[idx]=0;h->len--;mrb_int j=(idx+1)&h->mask;while(h->keys[j]>=0){mrb_int nj=(mrb_int)(((mrb_int)h->keys[j])&h->mask);if((j>idx&&(nj<=idx||nj>j))||(j<idx&&nj<=idx&&nj>j)){h->keys[idx]=h->keys[j];h->vals[idx]=h->vals[j];h->keys[j]=-1;h->vals[j]=0;idx=j;}j=(j+1)&h->mask;}{mrb_int oi=0;while(oi<=h->len){if(h->order[oi]==k){while(oi<h->len){h->order[oi]=h->order[oi+1];oi++;}break;}oi++;}}return;}idx=(idx+1)&h->mask;}} | |
| static sp_IntArray*sp_SymIntHash_keys(sp_SymIntHash*h){sp_IntArray*a=sp_IntArray_new();for(mrb_int i=0;i<h->len;i++)sp_IntArray_push(a,(mrb_int)h->order[i]);return a;} | |
| static sp_IntArray*sp_SymIntHash_values(sp_SymIntHash*h){sp_IntArray*a=sp_IntArray_new();for(mrb_int i=0;i<h->len;i++)sp_IntArray_push(a,sp_SymIntHash_get(h,h->order[i]));return a;} | |
| static sp_SymIntHash*sp_SymIntHash_dup(sp_SymIntHash*h){sp_SymIntHash*r=sp_SymIntHash_new();r->default_v=h->default_v;for(mrb_int i=0;i<h->len;i++)sp_SymIntHash_set(r,h->order[i],sp_SymIntHash_get(h,h->order[i]));return r;} | |
| static sp_PolyArray*sp_SymIntHash_to_a(sp_SymIntHash*h){sp_PolyArray*r=sp_PolyArray_new();for(mrb_int i=0;i<h->len;i++){sp_PolyArray*p=sp_PolyArray_new();sp_PolyArray_push(p,sp_box_sym(h->order[i]));sp_PolyArray_push(p,sp_box_int(sp_SymIntHash_get(h,h->order[i])));sp_PolyArray_push(r,sp_box_poly_array(p));}return r;} | |
| static sp_PolyPolyHash*sp_SymIntHash_invert(sp_SymIntHash*h){sp_PolyPolyHash*r=sp_PolyPolyHash_new();for(mrb_int i=0;i<h->len;i++)sp_PolyPolyHash_set(r,sp_box_int(sp_SymIntHash_get(h,h->order[i])),sp_box_sym(h->order[i]));return r;} | |
| static sp_SymIntHash*sp_SymIntHash_merge(sp_SymIntHash*a,sp_SymIntHash*b){sp_SymIntHash*r=sp_SymIntHash_new();r->default_v=a->default_v;for(mrb_int i=0;i<a->len;i++)sp_SymIntHash_set(r,a->order[i],sp_SymIntHash_get(a,a->order[i]));if(b){for(mrb_int i=0;i<b->len;i++)sp_SymIntHash_set(r,b->order[i],sp_SymIntHash_get(b,b->order[i]));}return r;} | |
| static mrb_bool sp_SymIntHash_eq(sp_SymIntHash*a,sp_SymIntHash*b){if(!a||!b)return a==b;if(a->len!=b->len)return FALSE;for(mrb_int i=0;i<a->len;i++){sp_sym k=a->order[i];if(!sp_SymIntHash_has_key(b,k))return FALSE;if(sp_SymIntHash_get(a,k)!=sp_SymIntHash_get(b,k))return FALSE;}return TRUE;} | |
| static const char*sp_SymIntHash_inspect(sp_SymIntHash*h){sp_String*s=sp_String_new("{");for(mrb_int i=0;i<h->len;i++){if(i>0)sp_String_append(s,", ");sp_String_append(s,sp_sym_to_s(h->order[i]));sp_String_append(s,": ");sp_String_append(s,sp_int_to_s(sp_SymIntHash_get(h,h->order[i])));}sp_String_append(s,"}");return s->data;} | |
| static const char*sp_SymIntHash_json(sp_SymIntHash*h) __attribute__((unused)); | |
| static const char*sp_SymIntHash_json(sp_SymIntHash*h){sp_String*o=sp_String_new("{");SP_GC_ROOT(o);if(h){for(mrb_int i=0;i<h->len;i++){if(i>0)sp_String_append(o,",");sp_String_append(o,sp_json_str(sp_sym_to_s(h->order[i])));sp_String_append(o,":");sp_String_append(o,sp_int_to_s(sp_SymIntHash_get(h,h->order[i])));}}sp_String_append(o,"}");return o->data;} | |
| static mrb_int sp_SymIntHash_proc_fn(void*cap,mrb_int*args){return sp_SymIntHash_get((sp_SymIntHash*)cap,(sp_sym)args[0]);} | |
| static sp_SymIntHash*sp_SymArray_tally(sp_IntArray*a){sp_SymIntHash*h=sp_SymIntHash_new();for(mrb_int i=0;i<a->len;i++){sp_sym k=(sp_sym)a->data[a->start+i];mrb_int c=sp_SymIntHash_has_key(h,k)?sp_SymIntHash_get(h,k):0;sp_SymIntHash_set(h,k,c+1);}return h;} | |
| static sp_SymPolyHash*sp_SymPolyHash_merge_int(sp_SymPolyHash*a,sp_SymIntHash*b){sp_SymPolyHash*r=sp_SymPolyHash_new();for(mrb_int i=0;i<a->len;i++)sp_SymPolyHash_set(r,a->order[i],sp_SymPolyHash_get(a,a->order[i]));for(mrb_int i=0;i<b->len;i++)sp_SymPolyHash_set(r,b->order[i],sp_box_int(sp_SymIntHash_get(b,b->order[i])));return r;} | |
| static sp_SymPolyHash*sp_SymIntHash_to_sym_poly(sp_SymIntHash*h){sp_SymPolyHash*r=sp_SymPolyHash_new();for(mrb_int i=0;i<h->len;i++)sp_SymPolyHash_set(r,h->order[i],sp_box_int(sp_SymIntHash_get(h,h->order[i])));return r;} | |
| typedef struct{sp_sym*keys;const char**vals;sp_sym*order;mrb_int len;mrb_int cap;mrb_int mask;const char*default_v;}sp_SymStrHash; | |
| static void sp_SymStrHash_fin(void*p){sp_SymStrHash*h=(sp_SymStrHash*)p;free(h->keys);free(h->vals);free(h->order);} | |
| static sp_SymStrHash*sp_SymStrHash_new(void){sp_SymStrHash*h=(sp_SymStrHash*)sp_gc_alloc(sizeof(sp_SymStrHash),sp_SymStrHash_fin,NULL);h->cap=16;h->mask=15;h->keys=(sp_sym*)malloc(sizeof(sp_sym)*h->cap);for(mrb_int i=0;i<h->cap;i++)h->keys[i]=-1;h->vals=(const char**)calloc(h->cap,sizeof(const char*));h->order=(sp_sym*)malloc(sizeof(sp_sym)*h->cap);h->len=0;h->default_v=NULL;return h;} | |
| static sp_SymStrHash*sp_SymStrHash_new_with_default(const char*d){sp_SymStrHash*h=sp_SymStrHash_new();h->default_v=d;return h;} | |
| static void sp_SymStrHash_grow(sp_SymStrHash*h){mrb_int oc=h->cap;sp_sym*ok=h->keys;const char**ov=h->vals;h->cap*=2;h->mask=h->cap-1;h->keys=(sp_sym*)malloc(sizeof(sp_sym)*h->cap);for(mrb_int i=0;i<h->cap;i++)h->keys[i]=-1;h->vals=(const char**)calloc(h->cap,sizeof(const char*));h->order=(sp_sym*)realloc(h->order,sizeof(sp_sym)*h->cap);h->len=0;for(mrb_int i=0;i<oc;i++){if(ok[i]>=0){mrb_int idx=(mrb_int)(((mrb_int)ok[i])&h->mask);while(h->keys[idx]>=0)idx=(idx+1)&h->mask;h->keys[idx]=ok[i];h->vals[idx]=ov[i];h->len++;}}free(ok);free(ov);} | |
| static const char*sp_SymStrHash_get(sp_SymStrHash*h,sp_sym k){if(!h)return NULL;mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k)return h->vals[idx];idx=(idx+1)&h->mask;}return h->default_v;} | |
| static void sp_SymStrHash_set(sp_SymStrHash*h,sp_sym k,const char*v){if(h->len*2>=h->cap)sp_SymStrHash_grow(h);mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k){h->vals[idx]=v;return;}idx=(idx+1)&h->mask;}h->keys[idx]=k;h->vals[idx]=v;h->order[h->len]=k;h->len++;} | |
| static mrb_bool sp_SymStrHash_has_key(sp_SymStrHash*h,sp_sym k){mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k)return TRUE;idx=(idx+1)&h->mask;}return FALSE;} | |
| static mrb_int sp_SymStrHash_length(sp_SymStrHash*h){return h->len;} | |
| static void sp_SymStrHash_delete(sp_SymStrHash*h,sp_sym k){mrb_int idx=(mrb_int)(((mrb_int)k)&h->mask);while(h->keys[idx]>=0){if(h->keys[idx]==k){h->keys[idx]=-1;h->vals[idx]=NULL;h->len--;mrb_int j=(idx+1)&h->mask;while(h->keys[j]>=0){mrb_int nj=(mrb_int)(((mrb_int)h->keys[j])&h->mask);if((j>idx&&(nj<=idx||nj>j))||(j<idx&&nj<=idx&&nj>j)){h->keys[idx]=h->keys[j];h->vals[idx]=h->vals[j];h->keys[j]=-1;h->vals[j]=NULL;idx=j;}j=(j+1)&h->mask;}{mrb_int oi=0;while(oi<=h->len){if(h->order[oi]==k){while(oi<h->len){h->order[oi]=h->order[oi+1];oi++;}break;}oi++;}}return;}idx=(idx+1)&h->mask;}} | |
| static sp_IntArray*sp_SymStrHash_keys(sp_SymStrHash*h){sp_IntArray*a=sp_IntArray_new();for(mrb_int i=0;i<h->len;i++)sp_IntArray_push(a,(mrb_int)h->order[i]);return a;} | |
| static sp_StrArray*sp_SymStrHash_values(sp_SymStrHash*h){sp_StrArray*a=sp_StrArray_new();for(mrb_int i=0;i<h->len;i++)sp_StrArray_push(a,sp_SymStrHash_get(h,h->order[i]));return a;} | |
| static mrb_bool sp_SymStrHash_has_value(sp_SymStrHash*h,const char*v){if(!h||!v)return FALSE;for(mrb_int i=0;i<h->len;i++){const char*x=sp_SymStrHash_get(h,h->order[i]);if(x&&strcmp(x,v)==0)return TRUE;}return FALSE;} | |
| static sp_SymStrHash*sp_SymStrHash_dup(sp_SymStrHash*h){sp_SymStrHash*r=sp_SymStrHash_new();r->default_v=h->default_v;for(mrb_int i=0;i<h->len;i++)sp_SymStrHash_set(r,h->order[i],sp_SymStrHash_get(h,h->order[i]));return r;} | |
| static sp_PolyArray*sp_SymStrHash_to_a(sp_SymStrHash*h){sp_PolyArray*r=sp_PolyArray_new();for(mrb_int i=0;i<h->len;i++){sp_PolyArray*p=sp_PolyArray_new();sp_PolyArray_push(p,sp_box_sym(h->order[i]));sp_PolyArray_push(p,sp_box_str(sp_SymStrHash_get(h,h->order[i])));sp_PolyArray_push(r,sp_box_poly_array(p));}return r;} | |
| static sp_PolyPolyHash*sp_SymStrHash_invert(sp_SymStrHash*h){sp_PolyPolyHash*r=sp_PolyPolyHash_new();for(mrb_int i=0;i<h->len;i++)sp_PolyPolyHash_set(r,sp_box_str(sp_SymStrHash_get(h,h->order[i])),sp_box_sym(h->order[i]));return r;} | |
| static sp_SymStrHash*sp_SymStrHash_merge(sp_SymStrHash*a,sp_SymStrHash*b){sp_SymStrHash*r=sp_SymStrHash_new();r->default_v=a->default_v;for(mrb_int i=0;i<a->len;i++)sp_SymStrHash_set(r,a->order[i],sp_SymStrHash_get(a,a->order[i]));for(mrb_int i=0;i<b->len;i++)sp_SymStrHash_set(r,b->order[i],sp_SymStrHash_get(b,b->order[i]));return r;} | |
| static mrb_bool sp_SymStrHash_eq(sp_SymStrHash*a,sp_SymStrHash*b){if(!a||!b)return a==b;if(a->len!=b->len)return FALSE;for(mrb_int i=0;i<a->len;i++){sp_sym k=a->order[i];if(!sp_SymStrHash_has_key(b,k))return FALSE;if(!sp_str_eq(sp_SymStrHash_get(a,k),sp_SymStrHash_get(b,k)))return FALSE;}return TRUE;} | |
| static const char*sp_SymStrHash_inspect(sp_SymStrHash*h){sp_String*s=sp_String_new("{");if(h){for(mrb_int i=0;i<h->len;i++){if(i>0)sp_String_append(s,", ");sp_String_append(s,sp_sym_to_s(h->order[i]));sp_String_append(s,": ");sp_String_append(s,sp_str_inspect(sp_SymStrHash_get(h,h->order[i])));}}sp_String_append(s,"}");return s->data;} | |
| static const char*sp_SymStrHash_json(sp_SymStrHash*h) __attribute__((unused)); | |
| static const char*sp_SymStrHash_json(sp_SymStrHash*h){sp_String*o=sp_String_new("{");SP_GC_ROOT(o);if(h){for(mrb_int i=0;i<h->len;i++){if(i>0)sp_String_append(o,",");sp_String_append(o,sp_json_str(sp_sym_to_s(h->order[i])));sp_String_append(o,":");sp_String_append(o,sp_json_str(sp_SymStrHash_get(h,h->order[i])));}}sp_String_append(o,"}");return o->data;} | |
| static sp_SymPolyHash*sp_SymStrHash_to_sym_poly(sp_SymStrHash*h){SP_GC_SAVE();SP_GC_ROOT(h);sp_SymPolyHash*r=sp_SymPolyHash_new();SP_GC_ROOT(r);for(mrb_int i=0;i<h->len;i++)sp_SymPolyHash_set(r,h->order[i],sp_box_str(sp_SymStrHash_get(h,h->order[i])));return r;} | |
| static sp_SymPolyHash*sp_SymPolyHash_merge_str(sp_SymPolyHash*a,sp_SymStrHash*b){SP_GC_SAVE();SP_GC_ROOT(a);SP_GC_ROOT(b);sp_SymPolyHash*r=sp_SymPolyHash_new();SP_GC_ROOT(r);for(mrb_int i=0;i<a->len;i++)sp_SymPolyHash_set(r,a->order[i],sp_SymPolyHash_get(a,a->order[i]));for(mrb_int i=0;i<b->len;i++)sp_SymPolyHash_set(r,b->order[i],sp_box_str(sp_SymStrHash_get(b,b->order[i])));return r;} | |
| static sp_StrPolyHash*sp_StrPolyHash_from_sym_int_hash(sp_SymIntHash*h){SP_GC_SAVE();SP_GC_ROOT(h);sp_StrPolyHash*r=sp_StrPolyHash_new();SP_GC_ROOT(r);if(!h)return r;r->default_v=sp_box_int(h->default_v);for(mrb_int i=0;i<h->len;i++){sp_sym k=h->order[i];sp_StrPolyHash_set(r,sp_sym_to_s(k),sp_box_int(sp_SymIntHash_get(h,k)));}return r;} | |
| static sp_StrPolyHash*sp_StrPolyHash_from_sym_str_hash(sp_SymStrHash*h){SP_GC_SAVE();SP_GC_ROOT(h);sp_StrPolyHash*r=sp_StrPolyHash_new();SP_GC_ROOT(r);if(!h)return r;if(h->default_v)r->default_v=sp_box_str(h->default_v);for(mrb_int i=0;i<h->len;i++){sp_sym k=h->order[i];sp_StrPolyHash_set(r,sp_sym_to_s(k),sp_box_str(sp_SymStrHash_get(h,k)));}return r;} | |
| static sp_StrPolyHash*sp_StrPolyHash_from_sym_poly_hash(sp_SymPolyHash*h){SP_GC_SAVE();SP_GC_ROOT(h);sp_StrPolyHash*r=sp_StrPolyHash_new();SP_GC_ROOT(r);if(!h)return r;r->default_v=h->default_v;for(mrb_int i=0;i<h->len;i++){sp_sym k=h->order[i];sp_StrPolyHash_set(r,sp_sym_to_s(k),sp_SymPolyHash_get(h,k));}return r;} | |
| /* ---- FFI externs ---- */ | |
| #include <stdint.h> | |
| #include <stddef.h> | |
| /* SPINEL_LINK: -lsqlite3 */ | |
| extern int sqlite3_open(const char *, void *); | |
| extern int sqlite3_close(void *); | |
| extern int sqlite3_exec(void *, const char *, void *, void *, void *); | |
| extern int sqlite3_prepare_v2(void *, const char *, int, void *, void *); | |
| extern int sqlite3_step(void *); | |
| extern int sqlite3_finalize(void *); | |
| extern int sqlite3_reset(void *); | |
| extern int sqlite3_clear_bindings(void *); | |
| extern int sqlite3_column_int(void *, int); | |
| extern const char * sqlite3_column_text(void *, int); | |
| extern int sqlite3_column_count(void *); | |
| extern const char * sqlite3_column_name(void *, int); | |
| extern const char * sqlite3_errmsg(void *); | |
| extern long sqlite3_last_insert_rowid(void *); | |
| extern int sqlite3_changes(void *); | |
| static char sp_ffi_buf_SQL_db_out[8]; | |
| static char sp_ffi_buf_SQL_stmt_out[8]; | |
| static mrb_regexp_pattern *sp_re_pat_0; | |
| static const char *sp_re_pat_err_0 = NULL; | |
| static mrb_regexp_pattern *sp_re_pat_1; | |
| static const char *sp_re_pat_err_1 = NULL; | |
| static mrb_regexp_pattern *sp_re_pat_2; | |
| static const char *sp_re_pat_err_2 = NULL; | |
| static void sp_re_init(void) { | |
| sp_re_set_error_handler(sp_re_startup_error_handler); | |
| sp_re_startup_err = NULL; | |
| if (setjmp(sp_re_startup_jmp) == 0) { | |
| sp_re_pat_0 = re_compile("[&<>\"']", 7, 0); | |
| } else { | |
| sp_re_pat_0 = NULL; | |
| sp_re_pat_err_0 = sp_re_startup_err; | |
| } | |
| sp_re_startup_err = NULL; | |
| if (setjmp(sp_re_startup_jmp) == 0) { | |
| sp_re_pat_1 = re_compile("[\\\\\"\\n\\r\\t\\x08\\f]", 17, 0); | |
| } else { | |
| sp_re_pat_1 = NULL; | |
| sp_re_pat_err_1 = sp_re_startup_err; | |
| } | |
| sp_re_startup_err = NULL; | |
| if (setjmp(sp_re_startup_jmp) == 0) { | |
| sp_re_pat_2 = re_compile("\\A[a-z]+", 8, 0); | |
| } else { | |
| sp_re_pat_2 = NULL; | |
| sp_re_pat_err_2 = sp_re_startup_err; | |
| } | |
| sp_re_set_error_handler(sp_re_default_error_handler); | |
| } | |
| static mrb_regexp_pattern *sp_re_dyn_0(const char *new_pat) { | |
| static char *cached_str = NULL; | |
| static mrb_regexp_pattern *cached_pat = NULL; | |
| if (cached_str != NULL && strcmp(cached_str, new_pat) == 0) return cached_pat; | |
| re_free(cached_pat); | |
| free(cached_str); | |
| cached_str = strdup(new_pat); | |
| cached_pat = re_compile(new_pat, (int64_t)strlen(new_pat), 0); | |
| return cached_pat; | |
| } | |
| static mrb_regexp_pattern *sp_re_dyn_1(const char *new_pat) { | |
| static char *cached_str = NULL; | |
| static mrb_regexp_pattern *cached_pat = NULL; | |
| if (cached_str != NULL && strcmp(cached_str, new_pat) == 0) return cached_pat; | |
| re_free(cached_pat); | |
| free(cached_str); | |
| cached_str = strdup(new_pat); | |
| cached_pat = re_compile(new_pat, (int64_t)strlen(new_pat), 0); | |
| return cached_pat; | |
| } | |
| static mrb_regexp_pattern *sp_re_dyn_2(const char *new_pat) { | |
| static char *cached_str = NULL; | |
| static mrb_regexp_pattern *cached_pat = NULL; | |
| if (cached_str != NULL && strcmp(cached_str, new_pat) == 0) return cached_pat; | |
| re_free(cached_pat); | |
| free(cached_str); | |
| cached_str = strdup(new_pat); | |
| cached_pat = re_compile(new_pat, (int64_t)strlen(new_pat), 0); | |
| return cached_pat; | |
| } | |
| /* sp_Class names table */ | |
| #define SP_CLASS_COUNT 139 | |
| static const char *const sp_class_names[139] = {(&("\xff" "BasicObject")[1]),(&("\xff" "Object")[1]),(&("\xff" "Kernel")[1]),(&("\xff" "Comparable")[1]),(&("\xff" "Enumerable")[1]),(&("\xff" "NilClass")[1]),(&("\xff" "TrueClass")[1]),(&("\xff" "FalseClass")[1]),(&("\xff" "Numeric")[1]),(&("\xff" "Integer")[1]),(&("\xff" "Float")[1]),(&("\xff" "String")[1]),(&("\xff" "Symbol")[1]),(&("\xff" "Array")[1]),(&("\xff" "Hash")[1]),(&("\xff" "Range")[1]),(&("\xff" "Time")[1]),(&("\xff" "Module")[1]),(&("\xff" "Class")[1]),(&("\xff" "Complex")[1]),(&("\xff" "Proc")[1]),(&("\xff" "Exception")[1]),(&("\xff" "StandardError")[1]),(&("\xff" "RuntimeError")[1]),(&("\xff" "ArgumentError")[1]),(&("\xff" "TypeError")[1]),(&("\xff" "IndexError")[1]),(&("\xff" "KeyError")[1]),(&("\xff" "RangeError")[1]),(&("\xff" "FloatDomainError")[1]),(&("\xff" "NameError")[1]),(&("\xff" "NoMethodError")[1]),(&("\xff" "ZeroDivisionError")[1]),(&("\xff" "IOError")[1]),(&("\xff" "EOFError")[1]),(&("\xff" "FrozenError")[1]),(&("\xff" "ScriptError")[1]),(&("\xff" "NotImplementedError")[1]),(&("\xff" "LoadError")[1]),(&("\xff" "SyntaxError")[1]),(&("\xff" "StopIteration")[1]),(&("\xff" "RegexpError")[1]),(&("\xff" "EncodingError")[1]),(&("\xff" "SystemCallError")[1]),(&("\xff" "LocalJumpError")[1]),(&("\xff" "FiberError")[1]),(&("\xff" "Encoding")[1]),(&("\xff" "IO")[1]),(&("\xff" "File")[1]),(&("\xff" "ActiveRecord::RecordNotFound")[1]),(&("\xff" "ActiveRecord::RecordInvalid")[1]),(&("\xff" "ActiveRecord::ConnectionAdapters::ConnectionPool")[1]),(&("\xff" "ActiveRecord::Base")[1]),(&("\xff" "ActionDispatch::Router::Route")[1]),(&("\xff" "ActionDispatch::Router::MatchResult")[1]),(&("\xff" "ActionDispatch::Flash")[1]),(&("\xff" "ActionDispatch::Session")[1]),(&("\xff" "ActionView::Slots")[1]),(&("\xff" "ActionController::Base")[1]),(&("\xff" "Broadcasts::SeedTransport")[1]),(&("\xff" "ActionDispatch::IntegrationTest")[1]),(&("\xff" "Stmt")[1]),(&("\xff" "DbConn")[1]),(&("\xff" "DbPool")[1]),(&("\xff" "ApplicationController")[1]),(&("\xff" "ApplicationRecord")[1]),(&("\xff" "CommentRow")[1]),(&("\xff" "Comment")[1]),(&("\xff" "ArticleRow")[1]),(&("\xff" "Article")[1]),(&("\xff" "ArticleParams")[1]),(&("\xff" "ArticlesController")[1]),(&("\xff" "CommentParams")[1]),(&("\xff" "CommentsController")[1]),(&("\xff" "ActionResponse")[1]),(&("\xff" "TestBase")[1]),(&("\xff" "ArticleTest")[1]),(&("\xff" "Method")[1]),(&("\xff" "Article::_implicit_6872")[1]),(&("\xff" "Article::_implicit_6906")[1]),(&("\xff" "Article::_implicit_7484")[1]),(&("\xff" "Article::_implicit_7995")[1]),(&("\xff" "Article::_implicit_9355")[1]),(&("\xff" "Article::_implicit_9372")[1]),(&("\xff" "Base64")[1]),(&("\xff" "JSON")[1]),(&("\xff" "SQL")[1]),(&("\xff" "Db")[1]),(&("\xff" "ActiveRecord")[1]),(&("\xff" "ActiveRecord")[1]),(&("\xff" "ActiveRecord::ConnectionAdapters")[1]),(&("\xff" "ActiveRecord")[1]),(&("\xff" "ActiveRecord::Registry")[1]),(&("\xff" "ActiveRecord")[1]),(&("\xff" "Schema")[1]),(&("\xff" "ActionDispatch")[1]),(&("\xff" "ActionDispatch::Router")[1]),(&("\xff" "ActionDispatch")[1]),(&("\xff" "ActionDispatch")[1]),(&("\xff" "ActionView")[1]),(&("\xff" "ActionView")[1]),(&("\xff" "ActionView::ViewHelpers")[1]),(&("\xff" "ActionController")[1]),(&("\xff" "JsonBuilder")[1]),(&("\xff" "Broadcasts")[1]),(&("\xff" "Importmap")[1]),(&("\xff" "Importmap")[1]),(&("\xff" "RouteHelpers")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Comments")[1]),(&("\xff" "Inflector")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Layouts")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Views")[1]),(&("\xff" "Views::Articles")[1]),(&("\xff" "Routes")[1]),(&("\xff" "SchemaSetup")[1]),(&("\xff" "FixtureLoader")[1]),(&("\xff" "RequestDispatch")[1]),(&("\xff" "ActionDispatch")[1]),(&("\xff" "RequestDispatch")[1]),(&("\xff" "ArticlesFixtures")[1]),(&("\xff" "CommentsFixtures")[1])}; | |
| static const char *sp_class_to_s(sp_Class c) __attribute__((unused)); | |
| static const char *sp_class_to_s(sp_Class c){if(c.cls_id>=0&&c.cls_id<SP_CLASS_COUNT)return sp_class_names[c.cls_id];return "";} | |
| static mrb_bool sp_class_eq(sp_Class a, sp_Class b) __attribute__((unused)); | |
| static mrb_bool sp_class_eq(sp_Class a, sp_Class b){return a.cls_id == b.cls_id;} | |
| #define SP_USER_MODULE_BASE 84 | |
| static mrb_bool sp_class_is_module(sp_Class c) __attribute__((unused)); | |
| static mrb_bool sp_class_is_module(sp_Class c){return c.cls_id >= SP_USER_MODULE_BASE;} | |
| static const mrb_int sp_class_ancestors_off[140] __attribute__((unused)) = {0LL,1LL,4LL,5LL,6LL,7LL,11LL,15LL,19LL,24LL,30LL,36LL,41LL,46LL,51LL,56LL,61LL,66LL,70LL,75LL,81LL,85LL,89LL,94LL,100LL,106LL,112LL,118LL,125LL,131LL,138LL,144LL,151LL,157LL,163LL,170LL,177LL,182LL,188LL,194LL,200LL,207LL,213LL,219LL,225LL,231LL,237LL,241LL,245LL,250LL,256LL,262LL,263LL,264LL,265LL,266LL,267LL,268LL,269LL,270LL,271LL,274LL,275LL,276LL,277LL,279LL,281LL,282LL,285LL,286LL,289LL,290LL,293LL,294LL,297LL,298LL,299LL,301LL,302LL,305LL,308LL,311LL,314LL,317LL,320LL,321LL,322LL,323LL,324LL,325LL,326LL,327LL,328LL,329LL,330LL,331LL,332LL,333LL,334LL,335LL,336LL,337LL,338LL,339LL,340LL,341LL,342LL,343LL,344LL,345LL,346LL,347LL,348LL,349LL,350LL,351LL,352LL,353LL,354LL,355LL,356LL,357LL,358LL,359LL,360LL,361LL,362LL,363LL,364LL,365LL,366LL,367LL,368LL,369LL,370LL,371LL,372LL,373LL,374LL,375LL}; | |
| static const mrb_int sp_class_ancestors_flat[375] __attribute__((unused)) = {0LL,1LL,2LL,0LL,2LL,3LL,4LL,5LL,1LL,2LL,0LL,6LL,1LL,2LL,0LL,7LL,1LL,2LL,0LL,8LL,3LL,1LL,2LL,0LL,9LL,8LL,3LL,1LL,2LL,0LL,10LL,8LL,3LL,1LL,2LL,0LL,11LL,3LL,1LL,2LL,0LL,12LL,3LL,1LL,2LL,0LL,13LL,4LL,1LL,2LL,0LL,14LL,4LL,1LL,2LL,0LL,15LL,4LL,1LL,2LL,0LL,16LL,3LL,1LL,2LL,0LL,17LL,1LL,2LL,0LL,18LL,17LL,1LL,2LL,0LL,19LL,8LL,3LL,1LL,2LL,0LL,20LL,1LL,2LL,0LL,21LL,1LL,2LL,0LL,22LL,21LL,1LL,2LL,0LL,23LL,22LL,21LL,1LL,2LL,0LL,24LL,22LL,21LL,1LL,2LL,0LL,25LL,22LL,21LL,1LL,2LL,0LL,26LL,22LL,21LL,1LL,2LL,0LL,27LL,26LL,22LL,21LL,1LL,2LL,0LL,28LL,22LL,21LL,1LL,2LL,0LL,29LL,28LL,22LL,21LL,1LL,2LL,0LL,30LL,22LL,21LL,1LL,2LL,0LL,31LL,30LL,22LL,21LL,1LL,2LL,0LL,32LL,22LL,21LL,1LL,2LL,0LL,33LL,22LL,21LL,1LL,2LL,0LL,34LL,33LL,22LL,21LL,1LL,2LL,0LL,35LL,23LL,22LL,21LL,1LL,2LL,0LL,36LL,21LL,1LL,2LL,0LL,37LL,36LL,21LL,1LL,2LL,0LL,38LL,36LL,21LL,1LL,2LL,0LL,39LL,36LL,21LL,1LL,2LL,0LL,40LL,26LL,22LL,21LL,1LL,2LL,0LL,41LL,22LL,21LL,1LL,2LL,0LL,42LL,22LL,21LL,1LL,2LL,0LL,43LL,22LL,21LL,1LL,2LL,0LL,44LL,22LL,21LL,1LL,2LL,0LL,45LL,22LL,21LL,1LL,2LL,0LL,46LL,1LL,2LL,0LL,47LL,1LL,2LL,0LL,48LL,47LL,1LL,2LL,0LL,49LL,22LL,21LL,1LL,2LL,0LL,50LL,22LL,21LL,1LL,2LL,0LL,51LL,52LL,53LL,54LL,55LL,56LL,57LL,58LL,59LL,60LL,134LL,75LL,61LL,62LL,63LL,64LL,58LL,65LL,52LL,66LL,67LL,65LL,52LL,68LL,69LL,65LL,52LL,70LL,71LL,64LL,58LL,72LL,73LL,64LL,58LL,74LL,75LL,76LL,75LL,77LL,78LL,65LL,52LL,79LL,65LL,52LL,80LL,65LL,52LL,81LL,65LL,52LL,82LL,65LL,52LL,83LL,65LL,52LL,84LL,85LL,86LL,87LL,88LL,89LL,90LL,91LL,92LL,93LL,94LL,95LL,96LL,97LL,98LL,99LL,100LL,101LL,102LL,103LL,104LL,105LL,106LL,107LL,108LL,109LL,110LL,111LL,112LL,113LL,114LL,115LL,116LL,117LL,118LL,119LL,120LL,121LL,122LL,123LL,124LL,125LL,126LL,127LL,128LL,129LL,130LL,131LL,132LL,133LL,134LL,135LL,136LL,137LL,138LL}; | |
| static mrb_bool sp_class_le(sp_Class child, sp_Class anc) __attribute__((unused)); | |
| static mrb_bool sp_class_le(sp_Class child, sp_Class anc){if(child.cls_id<0||child.cls_id>=SP_CLASS_COUNT)return FALSE;mrb_int s=sp_class_ancestors_off[child.cls_id];mrb_int e=sp_class_ancestors_off[child.cls_id+1];for(mrb_int k=s;k<e;k++){if(sp_class_ancestors_flat[k]==anc.cls_id)return TRUE;}return FALSE;} | |
| static mrb_bool sp_class_lt(sp_Class child, sp_Class anc) __attribute__((unused)); | |
| static mrb_bool sp_class_lt(sp_Class child, sp_Class anc){if(child.cls_id==anc.cls_id)return FALSE;return sp_class_le(child,anc);} | |
| static sp_PolyArray *sp_class_ancestors_arr(sp_Class c) __attribute__((unused)); | |
| static sp_PolyArray *sp_class_ancestors_arr(sp_Class c){sp_PolyArray*r=sp_PolyArray_new();if(c.cls_id<0||c.cls_id>=SP_CLASS_COUNT)return r;mrb_int s=sp_class_ancestors_off[c.cls_id];mrb_int e=sp_class_ancestors_off[c.cls_id+1];for(mrb_int k=s;k<e;k++){sp_Class el={sp_class_ancestors_flat[k]};sp_PolyArray_push(r,sp_box_class(el));}return r;} | |
| static sp_Class sp_class_for_poly(sp_RbVal v) __attribute__((unused)); | |
| static sp_Class sp_class_for_poly(sp_RbVal v){switch(v.tag){case SP_TAG_NIL:return (sp_Class){5};case SP_TAG_BOOL:return (sp_Class){v.v.b?6:7};case SP_TAG_INT:return (sp_Class){9};case SP_TAG_FLT:return (sp_Class){10};case SP_TAG_STR:return (sp_Class){11};case SP_TAG_SYM:return (sp_Class){12};case SP_TAG_CLASS:return (sp_Class){(mrb_int)v.cls_id};case SP_TAG_ENCODING:return (sp_Class){46};case SP_TAG_OBJ:if(v.cls_id>=0)return (sp_Class){(mrb_int)v.cls_id};switch(v.cls_id){case SP_BUILTIN_INT_ARRAY:case SP_BUILTIN_STR_ARRAY:case SP_BUILTIN_FLT_ARRAY:case SP_BUILTIN_SYM_ARRAY:case SP_BUILTIN_PTR_ARRAY:case SP_BUILTIN_POLY_ARRAY:return (sp_Class){13};case SP_BUILTIN_STR_INT_HASH:case SP_BUILTIN_STR_STR_HASH:case SP_BUILTIN_INT_STR_HASH:case SP_BUILTIN_SYM_INT_HASH:case SP_BUILTIN_SYM_STR_HASH:case SP_BUILTIN_STR_POLY_HASH:case SP_BUILTIN_SYM_POLY_HASH:case SP_BUILTIN_POLY_POLY_HASH:return (sp_Class){14};case SP_BUILTIN_RANGE:return (sp_Class){15};case SP_BUILTIN_TIME:return (sp_Class){16};case SP_BUILTIN_PROC:return (sp_Class){20};default:return (sp_Class){-1};}}return (sp_Class){-1};} | |
| typedef struct sp_ActiveRecord_RecordNotFound_s sp_ActiveRecord_RecordNotFound; | |
| typedef struct sp_ActiveRecord_RecordInvalid_s sp_ActiveRecord_RecordInvalid; | |
| typedef struct sp_ActiveRecord_ConnectionAdapters_ConnectionPool_s sp_ActiveRecord_ConnectionAdapters_ConnectionPool; | |
| typedef struct sp_ActiveRecord_Base_s sp_ActiveRecord_Base; | |
| typedef struct sp_ActionDispatch_Router_Route_s sp_ActionDispatch_Router_Route; | |
| typedef struct sp_ActionDispatch_Router_MatchResult_s sp_ActionDispatch_Router_MatchResult; | |
| typedef struct sp_ActionDispatch_Flash_s sp_ActionDispatch_Flash; | |
| typedef struct sp_ActionDispatch_Session_s sp_ActionDispatch_Session; | |
| typedef struct sp_ActionView_Slots_s sp_ActionView_Slots; | |
| typedef struct sp_ActionController_Base_s sp_ActionController_Base; | |
| typedef struct sp_Broadcasts_SeedTransport_s sp_Broadcasts_SeedTransport; | |
| typedef struct sp_ActionDispatch_IntegrationTest_s sp_ActionDispatch_IntegrationTest; | |
| typedef struct sp_Stmt_s sp_Stmt; | |
| typedef struct sp_DbConn_s sp_DbConn; | |
| typedef struct sp_DbPool_s sp_DbPool; | |
| typedef struct sp_ApplicationController_s sp_ApplicationController; | |
| typedef struct sp_ApplicationRecord_s sp_ApplicationRecord; | |
| typedef struct sp_CommentRow_s sp_CommentRow; | |
| typedef struct sp_Comment_s sp_Comment; | |
| typedef struct sp_ArticleRow_s sp_ArticleRow; | |
| typedef struct sp_Article_s sp_Article; | |
| typedef struct sp_ArticleParams_s sp_ArticleParams; | |
| typedef struct sp_ArticlesController_s sp_ArticlesController; | |
| typedef struct sp_CommentParams_s sp_CommentParams; | |
| typedef struct sp_CommentsController_s sp_CommentsController; | |
| typedef struct sp_ActionResponse_s sp_ActionResponse; | |
| typedef struct sp_TestBase_s sp_TestBase; | |
| typedef struct sp_ArticleTest_s sp_ArticleTest; | |
| typedef struct sp_Method_s sp_Method; | |
| typedef struct sp_Article__implicit_6872_s sp_Article__implicit_6872; | |
| typedef struct sp_Article__implicit_6906_s sp_Article__implicit_6906; | |
| typedef struct sp_Article__implicit_7484_s sp_Article__implicit_7484; | |
| typedef struct sp_Article__implicit_7995_s sp_Article__implicit_7995; | |
| typedef struct sp_Article__implicit_9355_s sp_Article__implicit_9355; | |
| typedef struct sp_Article__implicit_9372_s sp_Article__implicit_9372; | |
| struct sp_ActiveRecord_RecordNotFound_s { | |
| mrb_int cls_id; | |
| }; | |
| struct sp_ActiveRecord_RecordInvalid_s { | |
| mrb_int cls_id; | |
| sp_ActiveRecord_Base * iv_record; | |
| }; | |
| struct sp_ActiveRecord_ConnectionAdapters_ConnectionPool_s { | |
| mrb_int cls_id; | |
| mrb_int iv_size; | |
| sp_IntArray * iv_free; | |
| }; | |
| struct sp_ActiveRecord_Base_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| sp_RbVal iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| }; | |
| struct sp_ActionDispatch_Router_Route_s { | |
| mrb_int cls_id; | |
| const char * iv_verb; | |
| const char * iv_pattern; | |
| sp_sym iv_controller; | |
| sp_sym iv_action; | |
| }; | |
| struct sp_ActionDispatch_Router_MatchResult_s { | |
| mrb_int cls_id; | |
| sp_sym iv_controller; | |
| sp_sym iv_action; | |
| sp_StrStrHash * iv_path_params; | |
| }; | |
| struct sp_ActionDispatch_Flash_s { | |
| mrb_int cls_id; | |
| const char * iv_notice; | |
| const char * iv_alert; | |
| }; | |
| struct sp_ActionDispatch_Session_s { | |
| mrb_int cls_id; | |
| sp_StrPolyHash * iv_data; | |
| }; | |
| struct sp_ActionView_Slots_s { | |
| mrb_int cls_id; | |
| sp_SymStrHash * iv_slots; | |
| }; | |
| struct sp_ActionController_Base_s { | |
| mrb_int cls_id; | |
| sp_RbVal iv_params; | |
| sp_ActionDispatch_Session * iv_session; | |
| sp_RbVal iv_flash; | |
| mrb_int iv_status; | |
| sp_RbVal iv_body; | |
| const char * iv_location; | |
| sp_sym iv_request_format; | |
| const char * iv_content_type; | |
| const char * iv_request_method; | |
| const char * iv_request_path; | |
| }; | |
| struct sp_Broadcasts_SeedTransport_s { | |
| mrb_int cls_id; | |
| }; | |
| struct sp_ActionDispatch_IntegrationTest_s { | |
| mrb_int cls_id; | |
| sp_ActionDispatch_Session * iv___session; | |
| sp_RbVal iv___flash; | |
| sp_ActionResponse * iv___response; | |
| }; | |
| struct sp_Stmt_s { | |
| mrb_int cls_id; | |
| const char * iv_sql; | |
| void * iv_ptr; | |
| }; | |
| struct sp_DbConn_s { | |
| mrb_int cls_id; | |
| void * iv_dbh; | |
| sp_PtrArray * iv_entries; | |
| }; | |
| struct sp_DbPool_s { | |
| mrb_int cls_id; | |
| sp_PtrArray * iv_conns; | |
| sp_IntArray * iv_free; | |
| }; | |
| struct sp_ApplicationController_s { | |
| mrb_int cls_id; | |
| sp_RbVal iv_params; | |
| sp_ActionDispatch_Session * iv_session; | |
| sp_RbVal iv_flash; | |
| mrb_int iv_status; | |
| sp_RbVal iv_body; | |
| const char * iv_location; | |
| sp_sym iv_request_format; | |
| const char * iv_content_type; | |
| const char * iv_request_method; | |
| const char * iv_request_path; | |
| }; | |
| struct sp_ApplicationRecord_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| sp_RbVal iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| }; | |
| struct sp_CommentRow_s { | |
| mrb_int cls_id; | |
| mrb_int iv_id; | |
| mrb_int iv_article_id; | |
| const char * iv_body; | |
| const char * iv_commenter; | |
| const char * iv_created_at; | |
| const char * iv_updated_at; | |
| }; | |
| struct sp_Comment_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| sp_RbVal iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| mrb_int iv_article_id; | |
| const char * iv_body; | |
| const char * iv_commenter; | |
| const char * iv_created_at; | |
| const char * iv_updated_at; | |
| }; | |
| struct sp_ArticleRow_s { | |
| mrb_int cls_id; | |
| mrb_int iv_id; | |
| const char * iv_body; | |
| const char * iv_created_at; | |
| const char * iv_title; | |
| const char * iv_updated_at; | |
| }; | |
| struct sp_Article_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| sp_RbVal iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| const char * iv_body; | |
| const char * iv_created_at; | |
| const char * iv_title; | |
| const char * iv_updated_at; | |
| sp_PtrArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| struct sp_ArticleParams_s { | |
| mrb_int cls_id; | |
| const char * iv_title; | |
| const char * iv_body; | |
| }; | |
| struct sp_ArticlesController_s { | |
| mrb_int cls_id; | |
| sp_RbVal iv_params; | |
| sp_ActionDispatch_Session * iv_session; | |
| sp_RbVal iv_flash; | |
| mrb_int iv_status; | |
| sp_RbVal iv_body; | |
| const char * iv_location; | |
| sp_sym iv_request_format; | |
| const char * iv_content_type; | |
| const char * iv_request_method; | |
| const char * iv_request_path; | |
| sp_PtrArray * iv_articles; | |
| sp_RbVal iv_article; | |
| }; | |
| struct sp_CommentParams_s { | |
| mrb_int cls_id; | |
| const char * iv_commenter; | |
| const char * iv_body; | |
| }; | |
| struct sp_CommentsController_s { | |
| mrb_int cls_id; | |
| sp_RbVal iv_params; | |
| sp_ActionDispatch_Session * iv_session; | |
| sp_RbVal iv_flash; | |
| mrb_int iv_status; | |
| sp_RbVal iv_body; | |
| const char * iv_location; | |
| sp_sym iv_request_format; | |
| const char * iv_content_type; | |
| const char * iv_request_method; | |
| const char * iv_request_path; | |
| sp_RbVal iv_article; | |
| sp_Comment * iv_comment; | |
| }; | |
| struct sp_ActionResponse_s { | |
| mrb_int cls_id; | |
| mrb_int iv_status; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_location; | |
| sp_RbVal iv_flash; | |
| }; | |
| struct sp_TestBase_s { | |
| mrb_int cls_id; | |
| }; | |
| struct sp_ArticleTest_s { | |
| mrb_int cls_id; | |
| }; | |
| struct sp_Method_s { | |
| mrb_int cls_id; | |
| sp_Method * iv_self_obj; | |
| mrb_int iv_fn_ptr; | |
| const char * iv_name; | |
| }; | |
| struct sp_Article__implicit_6872_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| sp_RbVal iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_updated_at; | |
| sp_IntArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| struct sp_Article__implicit_6906_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| sp_RbVal iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_updated_at; | |
| sp_PolyArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| struct sp_Article__implicit_7484_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| sp_RbVal iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_updated_at; | |
| sp_IntArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| struct sp_Article__implicit_7995_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| sp_RbVal iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_updated_at; | |
| sp_IntArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| struct sp_Article__implicit_9355_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| sp_RbVal iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_updated_at; | |
| sp_IntArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| struct sp_Article__implicit_9372_s { | |
| mrb_int cls_id; | |
| sp_StrArray * iv_errors; | |
| sp_RbVal iv_id; | |
| mrb_bool iv_persisted; | |
| mrb_bool iv_destroyed; | |
| sp_RbVal iv_body; | |
| sp_RbVal iv_created_at; | |
| sp_RbVal iv_title; | |
| sp_RbVal iv_updated_at; | |
| sp_IntArray * iv_comments_cache; | |
| mrb_bool iv_comments_loaded; | |
| }; | |
| static void sp_ActiveRecord_RecordInvalid_gc_scan(void *p); | |
| static void sp_ActiveRecord_ConnectionAdapters_ConnectionPool_gc_scan(void *p); | |
| static void sp_ActiveRecord_Base_gc_scan(void *p); | |
| static void sp_ActionDispatch_Router_Route_gc_scan(void *p); | |
| static void sp_ActionDispatch_Router_MatchResult_gc_scan(void *p); | |
| static void sp_ActionDispatch_Flash_gc_scan(void *p); | |
| static void sp_ActionDispatch_Session_gc_scan(void *p); | |
| static void sp_ActionView_Slots_gc_scan(void *p); | |
| static void sp_ActionController_Base_gc_scan(void *p); | |
| static void sp_ActionDispatch_IntegrationTest_gc_scan(void *p); | |
| static void sp_Stmt_gc_scan(void *p); | |
| static void sp_DbConn_gc_scan(void *p); | |
| static void sp_DbPool_gc_scan(void *p); | |
| static void sp_ApplicationController_gc_scan(void *p); | |
| static void sp_ApplicationRecord_gc_scan(void *p); | |
| static void sp_CommentRow_gc_scan(void *p); | |
| static void sp_Comment_gc_scan(void *p); | |
| static void sp_ArticleRow_gc_scan(void *p); | |
| static void sp_Article_gc_scan(void *p); | |
| static void sp_ArticleParams_gc_scan(void *p); | |
| static void sp_ArticlesController_gc_scan(void *p); | |
| static void sp_CommentParams_gc_scan(void *p); | |
| static void sp_CommentsController_gc_scan(void *p); | |
| static void sp_ActionResponse_gc_scan(void *p); | |
| static void sp_Method_gc_scan(void *p); | |
| static void sp_Article__implicit_6872_gc_scan(void *p); | |
| static void sp_Article__implicit_6906_gc_scan(void *p); | |
| static void sp_Article__implicit_7484_gc_scan(void *p); | |
| static void sp_Article__implicit_7995_gc_scan(void *p); | |
| static void sp_Article__implicit_9355_gc_scan(void *p); | |
| static void sp_Article__implicit_9372_gc_scan(void *p); | |
| static void sp_ActiveRecord_RecordInvalid_gc_scan(void *p) { | |
| sp_ActiveRecord_RecordInvalid *self = (sp_ActiveRecord_RecordInvalid *)p; | |
| if (self->iv_record) sp_gc_mark((void *)self->iv_record); | |
| } | |
| static void sp_ActiveRecord_ConnectionAdapters_ConnectionPool_gc_scan(void *p) { | |
| sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self = (sp_ActiveRecord_ConnectionAdapters_ConnectionPool *)p; | |
| if (self->iv_free) sp_gc_mark((void *)self->iv_free); | |
| } | |
| static void sp_ActiveRecord_Base_gc_scan(void *p) { | |
| sp_ActiveRecord_Base *self = (sp_ActiveRecord_Base *)p; | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| sp_mark_rbval(self->iv_id); | |
| } | |
| static void sp_ActionDispatch_Router_Route_gc_scan(void *p) { | |
| sp_ActionDispatch_Router_Route *self = (sp_ActionDispatch_Router_Route *)p; | |
| if (self->iv_verb) sp_gc_mark((void *)self->iv_verb); | |
| if (self->iv_pattern) sp_gc_mark((void *)self->iv_pattern); | |
| } | |
| static void sp_ActionDispatch_Router_MatchResult_gc_scan(void *p) { | |
| sp_ActionDispatch_Router_MatchResult *self = (sp_ActionDispatch_Router_MatchResult *)p; | |
| if (self->iv_path_params) sp_gc_mark((void *)self->iv_path_params); | |
| } | |
| static void sp_ActionDispatch_Flash_gc_scan(void *p) { | |
| sp_ActionDispatch_Flash *self = (sp_ActionDispatch_Flash *)p; | |
| if (self->iv_notice) sp_gc_mark((void *)self->iv_notice); | |
| if (self->iv_alert) sp_gc_mark((void *)self->iv_alert); | |
| } | |
| static void sp_ActionDispatch_Session_gc_scan(void *p) { | |
| sp_ActionDispatch_Session *self = (sp_ActionDispatch_Session *)p; | |
| if (self->iv_data) sp_gc_mark((void *)self->iv_data); | |
| } | |
| static void sp_ActionView_Slots_gc_scan(void *p) { | |
| sp_ActionView_Slots *self = (sp_ActionView_Slots *)p; | |
| if (self->iv_slots) sp_gc_mark((void *)self->iv_slots); | |
| } | |
| static void sp_ActionController_Base_gc_scan(void *p) { | |
| sp_ActionController_Base *self = (sp_ActionController_Base *)p; | |
| sp_mark_rbval(self->iv_params); | |
| if (self->iv_session) sp_gc_mark((void *)self->iv_session); | |
| sp_mark_rbval(self->iv_flash); | |
| sp_mark_rbval(self->iv_body); | |
| if (self->iv_location) sp_gc_mark((void *)self->iv_location); | |
| if (self->iv_content_type) sp_gc_mark((void *)self->iv_content_type); | |
| if (self->iv_request_method) sp_gc_mark((void *)self->iv_request_method); | |
| if (self->iv_request_path) sp_gc_mark((void *)self->iv_request_path); | |
| } | |
| static void sp_ActionDispatch_IntegrationTest_gc_scan(void *p) { | |
| sp_ActionDispatch_IntegrationTest *self = (sp_ActionDispatch_IntegrationTest *)p; | |
| if (self->iv___session) sp_gc_mark((void *)self->iv___session); | |
| sp_mark_rbval(self->iv___flash); | |
| if (self->iv___response) sp_gc_mark((void *)self->iv___response); | |
| } | |
| static void sp_Stmt_gc_scan(void *p) { | |
| sp_Stmt *self = (sp_Stmt *)p; | |
| if (self->iv_sql) sp_gc_mark((void *)self->iv_sql); | |
| } | |
| static void sp_DbConn_gc_scan(void *p) { | |
| sp_DbConn *self = (sp_DbConn *)p; | |
| if (self->iv_entries) sp_gc_mark((void *)self->iv_entries); | |
| } | |
| static void sp_DbPool_gc_scan(void *p) { | |
| sp_DbPool *self = (sp_DbPool *)p; | |
| if (self->iv_conns) sp_gc_mark((void *)self->iv_conns); | |
| if (self->iv_free) sp_gc_mark((void *)self->iv_free); | |
| } | |
| static void sp_ApplicationController_gc_scan(void *p) { | |
| sp_ApplicationController *self = (sp_ApplicationController *)p; | |
| sp_mark_rbval(self->iv_params); | |
| if (self->iv_session) sp_gc_mark((void *)self->iv_session); | |
| sp_mark_rbval(self->iv_flash); | |
| sp_mark_rbval(self->iv_body); | |
| if (self->iv_location) sp_gc_mark((void *)self->iv_location); | |
| if (self->iv_content_type) sp_gc_mark((void *)self->iv_content_type); | |
| if (self->iv_request_method) sp_gc_mark((void *)self->iv_request_method); | |
| if (self->iv_request_path) sp_gc_mark((void *)self->iv_request_path); | |
| } | |
| static void sp_ApplicationRecord_gc_scan(void *p) { | |
| sp_ApplicationRecord *self = (sp_ApplicationRecord *)p; | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| sp_mark_rbval(self->iv_id); | |
| } | |
| static void sp_CommentRow_gc_scan(void *p) { | |
| sp_CommentRow *self = (sp_CommentRow *)p; | |
| if (self->iv_body) sp_gc_mark((void *)self->iv_body); | |
| if (self->iv_commenter) sp_gc_mark((void *)self->iv_commenter); | |
| if (self->iv_created_at) sp_gc_mark((void *)self->iv_created_at); | |
| if (self->iv_updated_at) sp_gc_mark((void *)self->iv_updated_at); | |
| } | |
| static void sp_Comment_gc_scan(void *p) { | |
| sp_Comment *self = (sp_Comment *)p; | |
| if (self->iv_body) sp_gc_mark((void *)self->iv_body); | |
| if (self->iv_commenter) sp_gc_mark((void *)self->iv_commenter); | |
| if (self->iv_created_at) sp_gc_mark((void *)self->iv_created_at); | |
| if (self->iv_updated_at) sp_gc_mark((void *)self->iv_updated_at); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| sp_mark_rbval(self->iv_id); | |
| } | |
| static void sp_ArticleRow_gc_scan(void *p) { | |
| sp_ArticleRow *self = (sp_ArticleRow *)p; | |
| if (self->iv_body) sp_gc_mark((void *)self->iv_body); | |
| if (self->iv_created_at) sp_gc_mark((void *)self->iv_created_at); | |
| if (self->iv_title) sp_gc_mark((void *)self->iv_title); | |
| if (self->iv_updated_at) sp_gc_mark((void *)self->iv_updated_at); | |
| } | |
| static void sp_Article_gc_scan(void *p) { | |
| sp_Article *self = (sp_Article *)p; | |
| if (self->iv_body) sp_gc_mark((void *)self->iv_body); | |
| if (self->iv_created_at) sp_gc_mark((void *)self->iv_created_at); | |
| if (self->iv_title) sp_gc_mark((void *)self->iv_title); | |
| if (self->iv_updated_at) sp_gc_mark((void *)self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| sp_mark_rbval(self->iv_id); | |
| } | |
| static void sp_ArticleParams_gc_scan(void *p) { | |
| sp_ArticleParams *self = (sp_ArticleParams *)p; | |
| if (self->iv_title) sp_gc_mark((void *)self->iv_title); | |
| if (self->iv_body) sp_gc_mark((void *)self->iv_body); | |
| } | |
| static void sp_ArticlesController_gc_scan(void *p) { | |
| sp_ArticlesController *self = (sp_ArticlesController *)p; | |
| if (self->iv_articles) sp_gc_mark((void *)self->iv_articles); | |
| sp_mark_rbval(self->iv_article); | |
| sp_mark_rbval(self->iv_params); | |
| if (self->iv_session) sp_gc_mark((void *)self->iv_session); | |
| sp_mark_rbval(self->iv_flash); | |
| sp_mark_rbval(self->iv_body); | |
| if (self->iv_location) sp_gc_mark((void *)self->iv_location); | |
| if (self->iv_content_type) sp_gc_mark((void *)self->iv_content_type); | |
| if (self->iv_request_method) sp_gc_mark((void *)self->iv_request_method); | |
| if (self->iv_request_path) sp_gc_mark((void *)self->iv_request_path); | |
| } | |
| static void sp_CommentParams_gc_scan(void *p) { | |
| sp_CommentParams *self = (sp_CommentParams *)p; | |
| if (self->iv_commenter) sp_gc_mark((void *)self->iv_commenter); | |
| if (self->iv_body) sp_gc_mark((void *)self->iv_body); | |
| } | |
| static void sp_CommentsController_gc_scan(void *p) { | |
| sp_CommentsController *self = (sp_CommentsController *)p; | |
| sp_mark_rbval(self->iv_article); | |
| if (self->iv_comment) sp_gc_mark((void *)self->iv_comment); | |
| sp_mark_rbval(self->iv_params); | |
| if (self->iv_session) sp_gc_mark((void *)self->iv_session); | |
| sp_mark_rbval(self->iv_flash); | |
| sp_mark_rbval(self->iv_body); | |
| if (self->iv_location) sp_gc_mark((void *)self->iv_location); | |
| if (self->iv_content_type) sp_gc_mark((void *)self->iv_content_type); | |
| if (self->iv_request_method) sp_gc_mark((void *)self->iv_request_method); | |
| if (self->iv_request_path) sp_gc_mark((void *)self->iv_request_path); | |
| } | |
| static void sp_ActionResponse_gc_scan(void *p) { | |
| sp_ActionResponse *self = (sp_ActionResponse *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_location); | |
| sp_mark_rbval(self->iv_flash); | |
| } | |
| static void sp_Method_gc_scan(void *p) { | |
| sp_Method *self = (sp_Method *)p; | |
| if (self->iv_self_obj) sp_gc_mark((void *)self->iv_self_obj); | |
| if (self->iv_name) sp_gc_mark((void *)self->iv_name); | |
| } | |
| static void sp_Article__implicit_6872_gc_scan(void *p) { | |
| sp_Article__implicit_6872 *self = (sp_Article__implicit_6872 *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| sp_mark_rbval(self->iv_id); | |
| } | |
| static void sp_Article__implicit_6906_gc_scan(void *p) { | |
| sp_Article__implicit_6906 *self = (sp_Article__implicit_6906 *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| sp_mark_rbval(self->iv_id); | |
| } | |
| static void sp_Article__implicit_7484_gc_scan(void *p) { | |
| sp_Article__implicit_7484 *self = (sp_Article__implicit_7484 *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| sp_mark_rbval(self->iv_id); | |
| } | |
| static void sp_Article__implicit_7995_gc_scan(void *p) { | |
| sp_Article__implicit_7995 *self = (sp_Article__implicit_7995 *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| sp_mark_rbval(self->iv_id); | |
| } | |
| static void sp_Article__implicit_9355_gc_scan(void *p) { | |
| sp_Article__implicit_9355 *self = (sp_Article__implicit_9355 *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| sp_mark_rbval(self->iv_id); | |
| } | |
| static void sp_Article__implicit_9372_gc_scan(void *p) { | |
| sp_Article__implicit_9372 *self = (sp_Article__implicit_9372 *)p; | |
| sp_mark_rbval(self->iv_body); | |
| sp_mark_rbval(self->iv_created_at); | |
| sp_mark_rbval(self->iv_title); | |
| sp_mark_rbval(self->iv_updated_at); | |
| if (self->iv_comments_cache) sp_gc_mark((void *)self->iv_comments_cache); | |
| if (self->iv_errors) sp_gc_mark((void *)self->iv_errors); | |
| sp_mark_rbval(self->iv_id); | |
| } | |
| static const char * sp_Base64_cls_strict_encode64(const char * lv_s); | |
| static const char * sp_Base64_cls_strict_decode64(sp_RbVal lv_s); | |
| static inline mrb_int sp_Base64_cls_char_value(sp_RbVal lv_c); | |
| static inline const char * sp_JSON_cls_generate(sp_RbVal lv_value); | |
| static const char * sp_JSON_cls_escape_string(const char * lv_s); | |
| static mrb_int sp_Db_cls_configure(const char * lv_path, mrb_int lv_pool_size); | |
| static inline sp_RbVal sp_Db_cls_current_conn(void); | |
| static mrb_int sp_Db_cls_with_connection(void); | |
| static inline mrb_int sp_Db_cls_close(void); | |
| static mrb_int sp_Db_cls_exec(const char * lv_sql); | |
| static inline void * sp_Db_cls_prepare(const char * lv_sql); | |
| static sp_IntArray * sp_Db_cls_capture_sql(void); | |
| static inline sp_RbVal sp_Db_cls_record_query(const char * lv_sql); | |
| static inline mrb_bool sp_Db_cls_step_p(void * lv_stmt); | |
| static inline mrb_int sp_Db_cls_column_int(sp_RbVal lv_stmt, mrb_int lv_i); | |
| static inline const char * sp_Db_cls_column_text(sp_RbVal lv_stmt, mrb_int lv_i); | |
| static inline mrb_int sp_Db_cls_column_count(mrb_int lv_stmt); | |
| static inline const char * sp_Db_cls_column_name(mrb_int lv_stmt, mrb_int lv_i); | |
| static inline mrb_int sp_Db_cls_finalize(void * lv_stmt); | |
| static inline mrb_int sp_Db_cls_last_insert_rowid(void); | |
| static inline mrb_int sp_Db_cls_changes(void); | |
| static inline const char * sp_Db_cls_escape_string(sp_RbVal lv_s); | |
| static inline const char * sp_Db_cls_escape_int(sp_RbVal lv_n); | |
| static inline const char * sp_Db_cls_escape_int_list(sp_PolyArray * lv_ids); | |
| static inline const char * sp_Db_cls_escape_bool(mrb_int lv_b); | |
| static inline mrb_bool sp_Db_cls_column_bool(mrb_int lv_stmt, mrb_int lv_idx); | |
| static inline mrb_int sp_ActiveRecord_Registry_cls_register(const char * lv_name, sp_RbVal lv_klass); | |
| static inline sp_RbVal sp_ActiveRecord_Registry_cls_lookup(const char * lv_name); | |
| static inline mrb_bool sp_ActiveRecord_Registry_cls_registered_p(const char * lv_name); | |
| static inline mrb_int sp_ActiveRecord_Registry_cls_clear_bang(void); | |
| static inline sp_StrArray * sp_Schema_cls_statements(void); | |
| static sp_ActionDispatch_Router_MatchResult * sp_ActionDispatch_Router_cls_match(const char * lv_method, const char * lv_path, sp_PtrArray * lv_table); | |
| static sp_StrStrHash * sp_ActionDispatch_Router_cls_match_pattern(const char * lv_pattern, const char * lv_path); | |
| static inline mrb_int sp_ActionView_ViewHelpers_cls_reset_slots_bang(void); | |
| static inline mrb_int sp_ActionView_ViewHelpers_cls_content_for_set(sp_sym lv_slot, const char * lv_value); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_content_for_get(sp_sym lv_slot); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_get_slot(sp_sym lv_slot); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_get_yield(void); | |
| static inline mrb_int sp_ActionView_ViewHelpers_cls_set_yield(const char * lv_content); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_html_escape(const char * lv_s); | |
| static const char * sp_ActionView_ViewHelpers_cls_truncate(const char * lv_s, mrb_int lv_length, const char * lv_omission); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_dom_id(sp_RbVal lv_record, sp_RbVal lv_suffix); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_link_to(mrb_int lv_text, mrb_int lv_href, sp_StrIntHash * lv_opts); | |
| static const char * sp_ActionView_ViewHelpers_cls_button_to(mrb_int lv_text, mrb_int lv_href, sp_StrIntHash * lv_opts); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_csrf_meta_tags(void); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_csp_meta_tag(void); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_stylesheet_link_tag(const char * lv_name, sp_SymStrHash * lv_opts); | |
| static const char * sp_ActionView_ViewHelpers_cls_javascript_importmap_tags(sp_RbVal lv_pins, const char * lv_entry); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_turbo_stream_from(sp_RbVal lv_stream); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(void); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_method_override_input(sp_sym lv_method); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_optional_value_attr(sp_RbVal lv_value); | |
| static inline const char * sp_ActionView_ViewHelpers_cls_escape_or_empty(sp_RbVal lv_value); | |
| static const char * sp_ActionView_ViewHelpers_cls_render_attrs(sp_StrPolyHash * lv_attrs); | |
| static inline const char * sp_JsonBuilder_cls_encode_string(const char * lv_s); | |
| static const char * sp_JsonBuilder_cls_encode_value(sp_RbVal lv_v); | |
| static const char * sp_JsonBuilder_cls_encode_datetime(sp_RbVal lv_s); | |
| static inline sp_PolyArray * sp_Broadcasts_cls_reset_log_bang(void); | |
| static inline sp_PolyArray * sp_Broadcasts_cls_log(void); | |
| static inline sp_IntArray * sp_Broadcasts_cls_set_transport(mrb_int lv_transport); | |
| static inline mrb_int sp_Broadcasts_cls_append(const char * lv_stream, const char * lv_target, sp_String * lv_html); | |
| static inline mrb_int sp_Broadcasts_cls_prepend(const char * lv_stream, const char * lv_target, sp_String * lv_html); | |
| static inline mrb_int sp_Broadcasts_cls_replace(const char * lv_stream, const char * lv_target, sp_String * lv_html); | |
| static inline mrb_int sp_Broadcasts_cls_remove(const char * lv_stream, const char * lv_target); | |
| static mrb_int sp_Broadcasts_cls_record(sp_sym lv_action, const char * lv_stream, const char * lv_target, sp_RbVal lv_html); | |
| static inline const char * sp_Broadcasts_cls_render_fragment(sp_sym lv_action, const char * lv_target, sp_RbVal lv_html); | |
| static inline sp_PolyArray * sp_Importmap_cls_pins(void); | |
| static inline const char * sp_Importmap_cls_entry(void); | |
| static inline const char * sp_RouteHelpers_cls_root_path(void); | |
| static inline const char * sp_RouteHelpers_cls_articles_path(void); | |
| static inline const char * sp_RouteHelpers_cls_new_article_path(void); | |
| static inline const char * sp_RouteHelpers_cls_article_path(mrb_int lv_id); | |
| static inline const char * sp_RouteHelpers_cls_edit_article_path(mrb_int lv_id); | |
| static inline const char * sp_RouteHelpers_cls_article_comments_path(mrb_int lv_article_id); | |
| static inline const char * sp_RouteHelpers_cls_article_comment_path(mrb_int lv_article_id, mrb_int lv_id); | |
| static inline sp_String * sp_Views_Comments_cls_comment(sp_Comment * lv_comment, sp_String * lv_notice, sp_String * lv_alert); | |
| static inline const char * sp_Inflector_cls_pluralize(mrb_int lv_count, const char * lv_word); | |
| static inline sp_String * sp_Views_Articles_cls_article(sp_RbVal lv_article, sp_String * lv_notice, sp_String * lv_alert); | |
| static sp_String * sp_Views_Articles_cls_form(sp_RbVal lv_article, sp_String * lv_notice, sp_String * lv_alert); | |
| static sp_String * sp_Views_Articles_cls_index(sp_PtrArray * lv_articles, sp_RbVal lv_notice, sp_RbVal lv_alert); | |
| static sp_String * sp_Views_Articles_cls_show(sp_RbVal lv_article, sp_RbVal lv_notice, sp_RbVal lv_alert); | |
| static sp_String * sp_Views_Articles_cls_new(sp_RbVal lv_article, sp_RbVal lv_notice, sp_RbVal lv_alert); | |
| static sp_String * sp_Views_Articles_cls_edit(sp_RbVal lv_article, sp_RbVal lv_notice, sp_RbVal lv_alert); | |
| static inline sp_String * sp_Views_Layouts_cls_application(mrb_int lv_body, sp_String * lv_notice, sp_String * lv_alert); | |
| static const char * sp_Views_Articles_cls_article_json(sp_Article * lv_article); | |
| static const char * sp_Views_Articles_cls_index_json(sp_PtrArray * lv_articles); | |
| static inline const char * sp_Views_Articles_cls_show_json(sp_Article * lv_article); | |
| static inline sp_PtrArray * sp_Routes_cls_table(void); | |
| static inline sp_ActionDispatch_Router_Route * sp_Routes_cls_root(void); | |
| static inline mrb_int sp_SchemaSetup_cls_reset_bang(void); | |
| static inline mrb_int sp_FixtureLoader_cls_load_all_bang(void); | |
| static inline sp_Article * sp_ArticlesFixtures_cls_one(void); | |
| static inline sp_Article * sp_ArticlesFixtures_cls_two(void); | |
| static mrb_int sp_ArticlesFixtures_cls__fixtures_load_bang(void); | |
| static inline sp_Comment * sp_CommentsFixtures_cls_one(void); | |
| static inline sp_Comment * sp_CommentsFixtures_cls_two(void); | |
| static mrb_int sp_CommentsFixtures_cls__fixtures_load_bang(void); | |
| static sp_ActiveRecord_RecordNotFound *sp_ActiveRecord_RecordNotFound_new(const char * lv_message); | |
| static inline void sp_ActiveRecord_RecordNotFound_initialize(sp_ActiveRecord_RecordNotFound *self, const char * lv_message); | |
| static sp_ActiveRecord_RecordInvalid *sp_ActiveRecord_RecordInvalid_new(sp_ActiveRecord_Base * lv_record); | |
| static inline void sp_ActiveRecord_RecordInvalid_initialize(sp_ActiveRecord_RecordInvalid *self, sp_ActiveRecord_Base * lv_record); | |
| static sp_ActiveRecord_ConnectionAdapters_ConnectionPool *sp_ActiveRecord_ConnectionAdapters_ConnectionPool_new(mrb_int lv_size, sp_Proc *_ctor_blk); | |
| static inline void sp_ActiveRecord_ConnectionAdapters_ConnectionPool_initialize(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self, mrb_int lv_size); | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_checkout(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self); | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_checkin(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self, mrb_int lv_handle); | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_wait_for_handle(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self); | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_available_count(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self); | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_in_use_count(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self); | |
| static sp_ActiveRecord_Base *sp_ActiveRecord_Base_new(sp_SymPolyHash * lv__attrs); | |
| static inline void sp_ActiveRecord_Base_initialize(sp_ActiveRecord_Base *self, sp_SymPolyHash * lv__attrs); | |
| static inline sp_StrArray * sp_ActiveRecord_Base_errors(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base__adapter_insert(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base__adapter_update(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base__adapter_delete(sp_ActiveRecord_Base *self); | |
| static inline sp_ActiveRecord_Base * sp_ActiveRecord_Base__adapter_reload(sp_ActiveRecord_Base *self); | |
| static inline sp_SymPolyHash * sp_ActiveRecord_Base_attributes(sp_ActiveRecord_Base *self); | |
| static inline sp_RbVal sp_ActiveRecord_Base__aref(sp_ActiveRecord_Base *self, sp_sym lv__name); | |
| static inline sp_RbVal sp_ActiveRecord_Base__aset(sp_ActiveRecord_Base *self, sp_sym lv__name, sp_RbVal lv__value); | |
| static inline mrb_int sp_ActiveRecord_Base_assign_from_row(sp_ActiveRecord_Base *self, sp_StrPolyHash * lv__row); | |
| static inline const char * sp_ActiveRecord_Base_dom_prefix(sp_ActiveRecord_Base *self); | |
| static inline mrb_bool sp_ActiveRecord_Base_persisted_p(sp_ActiveRecord_Base *self); | |
| static inline mrb_bool sp_ActiveRecord_Base_new_record_p(sp_ActiveRecord_Base *self); | |
| static inline mrb_bool sp_ActiveRecord_Base_destroyed_p(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_mark_persisted_bang(sp_ActiveRecord_Base *self); | |
| static mrb_bool sp_ActiveRecord_Base_save(sp_ActiveRecord_Base *self); | |
| static inline sp_ActiveRecord_Base * sp_ActiveRecord_Base_save_bang(sp_ActiveRecord_Base *self); | |
| static sp_ActiveRecord_Base * sp_ActiveRecord_Base_destroy(sp_ActiveRecord_Base *self); | |
| static inline sp_ActiveRecord_Base * sp_ActiveRecord_Base_reload(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_before_validation(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_validation(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_before_save(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_save(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_before_create(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_create(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_before_update(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_update(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_before_destroy(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_destroy(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_commit(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_create_commit(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_update_commit(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_destroy_commit(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_save_commit(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_after_touch(sp_ActiveRecord_Base *self); | |
| static inline mrb_int sp_ActiveRecord_Base_validate(sp_ActiveRecord_Base *self); | |
| static mrb_int sp_ActiveRecord_Base_fill_timestamps(sp_ActiveRecord_Base *self, mrb_bool lv_creating); | |
| static inline mrb_bool sp_ActiveRecord_Base_valid_p(sp_ActiveRecord_Base *self); | |
| static sp_IntArray * sp_ActiveRecord_Base_cls_schema_columns(void); | |
| static sp_ActionDispatch_Router_Route *sp_ActionDispatch_Router_Route_new(const char * lv_verb, const char * lv_pattern, sp_sym lv_controller, sp_sym lv_action); | |
| static inline void sp_ActionDispatch_Router_Route_initialize(sp_ActionDispatch_Router_Route *self, const char * lv_verb, const char * lv_pattern, sp_sym lv_controller, sp_sym lv_action); | |
| static sp_ActionDispatch_Router_MatchResult *sp_ActionDispatch_Router_MatchResult_new(sp_sym lv_controller, sp_sym lv_action, sp_StrStrHash * lv_path_params); | |
| static inline void sp_ActionDispatch_Router_MatchResult_initialize(sp_ActionDispatch_Router_MatchResult *self, sp_sym lv_controller, sp_sym lv_action, sp_StrStrHash * lv_path_params); | |
| static sp_ActionDispatch_Flash *sp_ActionDispatch_Flash_new(sp_RbVal lv_other); | |
| static inline void sp_ActionDispatch_Flash_initialize(sp_ActionDispatch_Flash *self, sp_RbVal lv_other); | |
| static const char * sp_ActionDispatch_Flash__aref(sp_ActionDispatch_Flash *self, sp_RbVal lv_key); | |
| static inline const char * sp_ActionDispatch_Flash__aset(sp_ActionDispatch_Flash *self, sp_RbVal lv_key, const char * lv_value); | |
| static inline sp_RbVal sp_ActionDispatch_Flash_fetch(sp_ActionDispatch_Flash *self, const char * lv_key, sp_RbVal lv_default); | |
| static inline mrb_bool sp_ActionDispatch_Flash_key_p(sp_ActionDispatch_Flash *self, sp_RbVal lv_key); | |
| static inline mrb_bool sp_ActionDispatch_Flash_has_key_p(sp_ActionDispatch_Flash *self, sp_RbVal lv_key); | |
| static inline mrb_bool sp_ActionDispatch_Flash_include_p(sp_ActionDispatch_Flash *self, sp_RbVal lv_key); | |
| static const char * sp_ActionDispatch_Flash_delete(sp_ActionDispatch_Flash *self, sp_RbVal lv_key); | |
| static mrb_int sp_ActionDispatch_Flash_length(sp_ActionDispatch_Flash *self); | |
| static mrb_int sp_ActionDispatch_Flash_size(sp_ActionDispatch_Flash *self); | |
| static inline mrb_bool sp_ActionDispatch_Flash_empty_p(sp_ActionDispatch_Flash *self); | |
| static sp_StrArray * sp_ActionDispatch_Flash_keys(sp_ActionDispatch_Flash *self); | |
| static sp_StrArray * sp_ActionDispatch_Flash_values(sp_ActionDispatch_Flash *self); | |
| static sp_ActionDispatch_Flash * sp_ActionDispatch_Flash_each(sp_ActionDispatch_Flash *self, void (*_block)(const char *, const char *, void*), void *_benv); | |
| static sp_StrStrHash * sp_ActionDispatch_Flash_to_h(sp_ActionDispatch_Flash *self); | |
| static sp_ActionDispatch_Flash * sp_ActionDispatch_Flash_merge(sp_ActionDispatch_Flash *self, sp_StrStrHash * lv_other); | |
| static sp_ActionDispatch_Session *sp_ActionDispatch_Session_new(sp_RbVal lv_other); | |
| static inline void sp_ActionDispatch_Session_initialize(sp_ActionDispatch_Session *self, sp_RbVal lv_other); | |
| static sp_RbVal sp_ActionDispatch_Session__aref(sp_ActionDispatch_Session *self, sp_RbVal lv_key); | |
| static sp_RbVal sp_ActionDispatch_Session__aset(sp_ActionDispatch_Session *self, sp_RbVal lv_key, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_ActionDispatch_Session_fetch(sp_ActionDispatch_Session *self, const char * lv_key, sp_RbVal lv_default); | |
| static mrb_bool sp_ActionDispatch_Session_key_p(sp_ActionDispatch_Session *self, sp_RbVal lv_key); | |
| static inline mrb_bool sp_ActionDispatch_Session_has_key_p(sp_ActionDispatch_Session *self, sp_RbVal lv_key); | |
| static inline mrb_bool sp_ActionDispatch_Session_include_p(sp_ActionDispatch_Session *self, sp_RbVal lv_key); | |
| static sp_RbVal sp_ActionDispatch_Session_delete(sp_ActionDispatch_Session *self, sp_RbVal lv_key); | |
| static mrb_int sp_ActionDispatch_Session_length(sp_ActionDispatch_Session *self); | |
| static inline mrb_int sp_ActionDispatch_Session_size(sp_ActionDispatch_Session *self); | |
| static mrb_bool sp_ActionDispatch_Session_empty_p(sp_ActionDispatch_Session *self); | |
| static sp_StrArray * sp_ActionDispatch_Session_keys(sp_ActionDispatch_Session *self); | |
| static sp_PolyArray * sp_ActionDispatch_Session_values(sp_ActionDispatch_Session *self); | |
| static sp_ActionDispatch_Session * sp_ActionDispatch_Session_each(sp_ActionDispatch_Session *self, void (*_block)(const char *, sp_RbVal, void*), void *_benv); | |
| static inline sp_StrPolyHash * sp_ActionDispatch_Session_to_h(sp_ActionDispatch_Session *self); | |
| static inline sp_ActionDispatch_Session * sp_ActionDispatch_Session_merge(sp_ActionDispatch_Session *self, sp_StrPolyHash * lv_other); | |
| static sp_ActionView_Slots *sp_ActionView_Slots_new(void); | |
| static inline void sp_ActionView_Slots_initialize(sp_ActionView_Slots *self); | |
| static inline mrb_int sp_ActionView_Slots_reset_bang(sp_ActionView_Slots *self); | |
| static inline mrb_int sp_ActionView_Slots_set(sp_ActionView_Slots *self, sp_sym lv_slot, const char * lv_value); | |
| static inline const char * sp_ActionView_Slots_get(sp_ActionView_Slots *self, sp_sym lv_slot); | |
| static inline const char * sp_ActionView_Slots_bracket_get(sp_ActionView_Slots *self, sp_sym lv_slot); | |
| static inline const char * sp_ActionView_Slots_get_yield(sp_ActionView_Slots *self); | |
| static inline mrb_int sp_ActionView_Slots_set_yield(sp_ActionView_Slots *self, const char * lv_content); | |
| static sp_ActionController_Base *sp_ActionController_Base_new(void); | |
| static inline void sp_ActionController_Base_initialize(sp_ActionController_Base *self); | |
| static inline mrb_int sp_ActionController_Base_process_action(sp_ActionController_Base *self, sp_sym lv__action_name); | |
| static mrb_int sp_ActionController_Base_render(sp_ActionController_Base *self, const char * lv_body, sp_sym lv_status, const char * lv_content_type, const char * lv_location); | |
| static mrb_int sp_ActionController_Base_redirect_to(sp_ActionController_Base *self, const char * lv_path, const char * lv_notice, const char * lv_alert, sp_sym lv_status); | |
| static mrb_int sp_ActionController_Base_head(sp_ActionController_Base *self, sp_sym lv_status, const char * lv_content_type); | |
| static inline mrb_int sp_ActionController_Base_resolve_status(sp_ActionController_Base *self, sp_sym lv_s); | |
| static sp_Broadcasts_SeedTransport *sp_Broadcasts_SeedTransport_new(void); | |
| static inline mrb_int sp_Broadcasts_SeedTransport_broadcast(sp_Broadcasts_SeedTransport *self, const char * lv_stream, const char * lv_fragment); | |
| static sp_ActionDispatch_IntegrationTest *sp_ActionDispatch_IntegrationTest_new(void); | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_get(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_RbVal lv_params); | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_post(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_RbVal lv_params); | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_patch(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_RbVal lv_params); | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_delete(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_RbVal lv_params); | |
| static sp_ActionResponse * sp_ActionDispatch_IntegrationTest_dispatch_request(sp_ActionDispatch_IntegrationTest *self, const char * lv_method, const char * lv_path, sp_RbVal lv_params); | |
| static inline sp_StrPolyHash * sp_ActionDispatch_IntegrationTest_stringify_keys(sp_ActionDispatch_IntegrationTest *self, sp_RbVal lv_hash); | |
| static mrb_int sp_ActionDispatch_IntegrationTest_assert_response(sp_ActionDispatch_IntegrationTest *self, mrb_int lv_expected, sp_ActionResponse * lv_response); | |
| static inline mrb_int sp_ActionDispatch_IntegrationTest_assert_redirected_to(sp_ActionDispatch_IntegrationTest *self, mrb_int lv_expected_path, sp_ActionResponse * lv_response); | |
| static mrb_int sp_ActionDispatch_IntegrationTest_assert_select(sp_ActionDispatch_IntegrationTest *self, const char * lv_selector, mrb_int lv_content_or_opts, mrb_int lv_opts, sp_Proc * lv_block, void (*_block)(mrb_int, void*), void *_benv); | |
| static sp_Stmt *sp_Stmt_new(const char * lv_sql, void * lv_ptr); | |
| static inline void sp_Stmt_initialize(sp_Stmt *self, const char * lv_sql, void * lv_ptr); | |
| static inline const char * sp_Stmt_sql(sp_Stmt *self); | |
| static inline void * sp_Stmt_ptr(sp_Stmt *self); | |
| static sp_DbConn *sp_DbConn_new(void * lv_dbh); | |
| static inline void sp_DbConn_initialize(sp_DbConn *self, void * lv_dbh); | |
| static inline void * sp_DbConn_dbh(sp_DbConn *self); | |
| static void * sp_DbConn_prepare_cached(sp_DbConn *self, const char * lv_sql); | |
| static inline mrb_int sp_DbConn_finalize_all(sp_DbConn *self); | |
| static sp_DbPool *sp_DbPool_new(const char * lv_path, mrb_int lv_n); | |
| static inline void sp_DbPool_initialize(sp_DbPool *self, const char * lv_path, mrb_int lv_n); | |
| static inline mrb_int sp_DbPool_available(sp_DbPool *self); | |
| static inline mrb_int sp_DbPool_lease(sp_DbPool *self); | |
| static inline sp_IntArray * sp_DbPool_release(sp_DbPool *self, mrb_int lv_idx); | |
| static inline sp_DbConn * sp_DbPool_conn(sp_DbPool *self, mrb_int lv_idx); | |
| static inline sp_DbConn * sp_DbPool_first(sp_DbPool *self); | |
| static inline mrb_int sp_DbPool_close_all(sp_DbPool *self); | |
| static sp_ApplicationController *sp_ApplicationController_new(void); | |
| static sp_ApplicationRecord *sp_ApplicationRecord_new(sp_SymPolyHash * lv__attrs); | |
| static mrb_int sp_ApplicationRecord_cls_schema_columns(void); | |
| static sp_CommentRow *sp_CommentRow_new(void); | |
| static inline void sp_CommentRow_initialize(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_id(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_id_eq(sp_CommentRow *self, mrb_int lv_value); | |
| static inline mrb_int sp_CommentRow_article_id(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_article_id_eq(sp_CommentRow *self, mrb_int lv_value); | |
| static inline const char * sp_CommentRow_body(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_body_eq(sp_CommentRow *self, const char * lv_value); | |
| static inline const char * sp_CommentRow_commenter(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_commenter_eq(sp_CommentRow *self, const char * lv_value); | |
| static inline const char * sp_CommentRow_created_at(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_created_at_eq(sp_CommentRow *self, const char * lv_value); | |
| static inline const char * sp_CommentRow_updated_at(sp_CommentRow *self); | |
| static inline mrb_int sp_CommentRow_updated_at_eq(sp_CommentRow *self, const char * lv_value); | |
| static sp_CommentRow * sp_CommentRow_cls_from_raw(sp_StrPolyHash * lv_row); | |
| static sp_Comment *sp_Comment_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Comment_initialize(sp_Comment *self, sp_StrIntHash * lv_attrs); | |
| static inline sp_RbVal sp_Comment_id(sp_Comment *self); | |
| static inline mrb_int sp_Comment_id_eq(sp_Comment *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Comment_article_id(sp_Comment *self); | |
| static inline mrb_int sp_Comment_article_id_eq(sp_Comment *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Comment_body(sp_Comment *self); | |
| static inline mrb_int sp_Comment_body_eq(sp_Comment *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Comment_commenter(sp_Comment *self); | |
| static inline mrb_int sp_Comment_commenter_eq(sp_Comment *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Comment_created_at(sp_Comment *self); | |
| static inline mrb_int sp_Comment_created_at_eq(sp_Comment *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Comment_updated_at(sp_Comment *self); | |
| static inline mrb_int sp_Comment_updated_at_eq(sp_Comment *self, sp_RbVal lv_value); | |
| static mrb_int sp_Comment_assign_from_row(sp_Comment *self, sp_StrPolyHash * lv_row); | |
| static inline sp_SymPolyHash * sp_Comment_attributes(sp_Comment *self); | |
| static inline sp_RbVal sp_Comment__aref(sp_Comment *self, sp_sym lv_name); | |
| static inline sp_RbVal sp_Comment__aset(sp_Comment *self, sp_sym lv_name, sp_RbVal lv_value); | |
| static inline mrb_bool sp_Comment_update(sp_Comment *self, sp_CommentParams * lv_p); | |
| static inline mrb_int sp_Comment__adapter_insert(sp_Comment *self); | |
| static inline mrb_int sp_Comment__adapter_update(sp_Comment *self); | |
| static inline mrb_int sp_Comment__adapter_delete(sp_Comment *self); | |
| static sp_Comment * sp_Comment__adapter_reload(sp_Comment *self); | |
| static inline mrb_int sp_Comment_validate(sp_Comment *self); | |
| static inline sp_Article * sp_Comment_article(sp_Comment *self); | |
| static inline const char * sp_Comment_dom_prefix(sp_Comment *self); | |
| static mrb_int sp_Comment_after_create_commit(sp_Comment *self); | |
| static inline mrb_int sp_Comment_after_update_commit(sp_Comment *self); | |
| static mrb_int sp_Comment_after_destroy_commit(sp_Comment *self); | |
| static sp_IntArray * sp_Comment_cls_schema_columns(void); | |
| static sp_Comment * sp_Comment_cls_from_row(sp_CommentRow * lv_row); | |
| static sp_Comment * sp_Comment_cls_from_stmt(sp_RbVal lv_stmt); | |
| static sp_Comment * sp_Comment_cls__adapter_find_by_id(mrb_int lv_id); | |
| static mrb_int sp_Comment_cls__adapter_count(void); | |
| static mrb_int sp_Comment_cls__adapter_truncate(void); | |
| static sp_Comment * sp_Comment_cls_from_params(sp_CommentParams * lv_p); | |
| static sp_Comment * sp_Comment_cls_find(mrb_int lv_id); | |
| static mrb_int sp_Comment_cls_count(void); | |
| static sp_ArticleRow *sp_ArticleRow_new(void); | |
| static inline void sp_ArticleRow_initialize(sp_ArticleRow *self); | |
| static inline mrb_int sp_ArticleRow_id(sp_ArticleRow *self); | |
| static inline mrb_int sp_ArticleRow_id_eq(sp_ArticleRow *self, mrb_int lv_value); | |
| static inline const char * sp_ArticleRow_body(sp_ArticleRow *self); | |
| static inline mrb_int sp_ArticleRow_body_eq(sp_ArticleRow *self, const char * lv_value); | |
| static inline const char * sp_ArticleRow_created_at(sp_ArticleRow *self); | |
| static inline mrb_int sp_ArticleRow_created_at_eq(sp_ArticleRow *self, const char * lv_value); | |
| static inline const char * sp_ArticleRow_title(sp_ArticleRow *self); | |
| static inline mrb_int sp_ArticleRow_title_eq(sp_ArticleRow *self, const char * lv_value); | |
| static inline const char * sp_ArticleRow_updated_at(sp_ArticleRow *self); | |
| static inline mrb_int sp_ArticleRow_updated_at_eq(sp_ArticleRow *self, const char * lv_value); | |
| static sp_ArticleRow * sp_ArticleRow_cls_from_raw(sp_StrPolyHash * lv_row); | |
| static sp_Article *sp_Article_new(sp_SymPolyHash * lv_attrs); | |
| static inline void sp_Article_initialize(sp_Article *self, sp_SymPolyHash * lv_attrs); | |
| static sp_IntArray * sp_Article_cls_schema_columns(void); | |
| static sp_Article * sp_Article_cls_from_row(sp_ArticleRow * lv_row); | |
| static sp_Article * sp_Article_cls_from_stmt(sp_RbVal lv_stmt); | |
| static sp_Article * sp_Article_cls__adapter_find_by_id(mrb_int lv_id); | |
| static mrb_bool sp_Article_cls__adapter_exists_by_id_p(mrb_int lv_id); | |
| static mrb_int sp_Article_cls__adapter_truncate(void); | |
| static sp_Article * sp_Article_cls_from_params(sp_ArticleParams * lv_p); | |
| static sp_Article__implicit_6906 * sp_Article_cls_find(mrb_int lv_id); | |
| static mrb_bool sp_Article_cls_exists_p(sp_RbVal lv_id); | |
| static sp_ArticleParams *sp_ArticleParams_new(void); | |
| static inline void sp_ArticleParams_initialize(sp_ArticleParams *self); | |
| static inline sp_RbVal sp_ArticleParams_title(sp_ArticleParams *self); | |
| static inline mrb_int sp_ArticleParams_title_eq(sp_ArticleParams *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_ArticleParams_body(sp_ArticleParams *self); | |
| static inline mrb_int sp_ArticleParams_body_eq(sp_ArticleParams *self, sp_RbVal lv_value); | |
| static inline sp_StrStrHash * sp_ArticleParams_to_h(sp_ArticleParams *self); | |
| static sp_ArticleParams * sp_ArticleParams_cls_from_raw(sp_StrPolyHash * lv_params); | |
| static sp_ArticlesController *sp_ArticlesController_new(void); | |
| static inline mrb_int sp_ArticlesController_process_action(sp_ArticlesController *self, sp_sym lv_action_name); | |
| static mrb_int sp_ArticlesController_index(sp_ArticlesController *self); | |
| static mrb_int sp_ArticlesController_show(sp_ArticlesController *self); | |
| static inline mrb_int sp_ArticlesController_new_action(sp_ArticlesController *self); | |
| static mrb_int sp_ArticlesController_edit(sp_ArticlesController *self); | |
| static inline mrb_int sp_ArticlesController_create(sp_ArticlesController *self); | |
| static inline mrb_int sp_ArticlesController_update(sp_ArticlesController *self); | |
| static mrb_int sp_ArticlesController_destroy(sp_ArticlesController *self); | |
| static inline sp_ArticleParams * sp_ArticlesController_article_params(sp_ArticlesController *self); | |
| static sp_CommentParams *sp_CommentParams_new(void); | |
| static inline void sp_CommentParams_initialize(sp_CommentParams *self); | |
| static inline sp_RbVal sp_CommentParams_commenter(sp_CommentParams *self); | |
| static inline mrb_int sp_CommentParams_commenter_eq(sp_CommentParams *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_CommentParams_body(sp_CommentParams *self); | |
| static inline mrb_int sp_CommentParams_body_eq(sp_CommentParams *self, sp_RbVal lv_value); | |
| static inline sp_StrStrHash * sp_CommentParams_to_h(sp_CommentParams *self); | |
| static sp_CommentParams * sp_CommentParams_cls_from_raw(sp_StrPolyHash * lv_params); | |
| static sp_CommentsController *sp_CommentsController_new(void); | |
| static inline mrb_int sp_CommentsController_process_action(sp_CommentsController *self, sp_sym lv_action_name); | |
| static mrb_int sp_CommentsController_create(sp_CommentsController *self); | |
| static mrb_int sp_CommentsController_destroy(sp_CommentsController *self); | |
| static inline sp_CommentParams * sp_CommentsController_comment_params(sp_CommentsController *self); | |
| static sp_ActionResponse *sp_ActionResponse_new(mrb_int lv_status, const char * lv_body, const char * lv_location, sp_ActionDispatch_Flash * lv_flash); | |
| static inline void sp_ActionResponse_initialize(sp_ActionResponse *self, mrb_int lv_status, const char * lv_body, const char * lv_location, sp_ActionDispatch_Flash * lv_flash); | |
| static inline mrb_bool sp_ActionResponse_redirect_p(sp_ActionResponse *self); | |
| static inline mrb_bool sp_ActionResponse_success_p(sp_ActionResponse *self); | |
| static inline mrb_bool sp_ActionResponse_unprocessable_p(sp_ActionResponse *self); | |
| static sp_TestBase *sp_TestBase_new(void); | |
| static inline void sp_TestBase_initialize(sp_TestBase *self); | |
| static inline mrb_int sp_TestBase_setup(sp_TestBase *self); | |
| static inline mrb_int sp_TestBase_teardown(sp_TestBase *self); | |
| static inline mrb_int sp_TestBase_assert_match(sp_TestBase *self, mrb_int lv_pattern, mrb_int lv_value, mrb_int lv_msg); | |
| static sp_ArticleTest *sp_ArticleTest_new(void); | |
| static inline mrb_int sp_ArticleTest_test_creates_an_article_with_valid_attributes(sp_ArticleTest *self); | |
| static inline mrb_int sp_ArticleTest_test_validates_title_presence(sp_ArticleTest *self); | |
| static inline mrb_int sp_ArticleTest_test_validates_body_minimum_length(sp_ArticleTest *self); | |
| static mrb_int sp_ArticleTest_test_destroys_comments_when_article_is_destroyed(sp_ArticleTest *self); | |
| static sp_Method *sp_Method_new(sp_Method * lv_self_obj, mrb_int lv_fn_ptr, const char * lv_name); | |
| static inline void sp_Method_initialize(sp_Method *self, sp_Method * lv_self_obj, mrb_int lv_fn_ptr, const char * lv_name); | |
| static sp_Article__implicit_6872 *sp_Article__implicit_6872_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Article__implicit_6872_initialize(sp_Article__implicit_6872 *self, sp_StrIntHash * lv_attrs); | |
| static inline sp_RbVal sp_Article__implicit_6872_id(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_id_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6872_body(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_body_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6872_created_at(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_created_at_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6872_title(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_title_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6872_updated_at(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_updated_at_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value); | |
| static mrb_int sp_Article__implicit_6872_assign_from_row(sp_Article__implicit_6872 *self, sp_StrPolyHash * lv_row); | |
| static inline sp_RbVal sp_Article__implicit_6872_attributes(sp_Article__implicit_6872 *self); | |
| static inline sp_RbVal sp_Article__implicit_6872__aref(sp_Article__implicit_6872 *self, sp_RbVal lv_name); | |
| static inline mrb_int sp_Article__implicit_6872__aset(sp_Article__implicit_6872 *self, sp_sym lv_name, sp_RbVal lv_value); | |
| static inline mrb_bool sp_Article__implicit_6872_update(sp_Article__implicit_6872 *self, mrb_int lv_p); | |
| static inline mrb_int sp_Article__implicit_6872__adapter_insert(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872__adapter_update(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872__adapter_delete(sp_Article__implicit_6872 *self); | |
| static sp_RbVal sp_Article__implicit_6872__adapter_reload(sp_Article__implicit_6872 *self); | |
| static inline sp_StrArray * sp_Article__implicit_6872_validate(sp_Article__implicit_6872 *self); | |
| static sp_RbVal sp_Article__implicit_6872_comments(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872__preload_comments(sp_Article__implicit_6872 *self, mrb_int lv_list); | |
| static inline sp_RbVal sp_Article__implicit_6872_before_destroy(sp_Article__implicit_6872 *self); | |
| static inline const char * sp_Article__implicit_6872_dom_prefix(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_after_create_commit(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_after_update_commit(sp_Article__implicit_6872 *self); | |
| static inline mrb_int sp_Article__implicit_6872_after_destroy_commit(sp_Article__implicit_6872 *self); | |
| static sp_IntArray * sp_Article__implicit_6872_cls_schema_columns(void); | |
| static sp_Article__implicit_6906 *sp_Article__implicit_6906_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Article__implicit_6906_initialize(sp_Article__implicit_6906 *self, sp_StrIntHash * lv_attrs); | |
| static inline sp_RbVal sp_Article__implicit_6906_id(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_id_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6906_body(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_body_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6906_created_at(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_created_at_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6906_title(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_title_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_6906_updated_at(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_updated_at_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value); | |
| static mrb_int sp_Article__implicit_6906_assign_from_row(sp_Article__implicit_6906 *self, sp_StrPolyHash * lv_row); | |
| static inline sp_RbVal sp_Article__implicit_6906_attributes(sp_Article__implicit_6906 *self); | |
| static inline sp_RbVal sp_Article__implicit_6906__aref(sp_Article__implicit_6906 *self, sp_RbVal lv_name); | |
| static inline mrb_int sp_Article__implicit_6906__aset(sp_Article__implicit_6906 *self, sp_sym lv_name, sp_RbVal lv_value); | |
| static inline mrb_bool sp_Article__implicit_6906_update(sp_Article__implicit_6906 *self, mrb_int lv_p); | |
| static inline mrb_int sp_Article__implicit_6906__adapter_insert(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906__adapter_update(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906__adapter_delete(sp_Article__implicit_6906 *self); | |
| static sp_RbVal sp_Article__implicit_6906__adapter_reload(sp_Article__implicit_6906 *self); | |
| static inline sp_StrArray * sp_Article__implicit_6906_validate(sp_Article__implicit_6906 *self); | |
| static sp_RbVal sp_Article__implicit_6906_comments(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906__preload_comments(sp_Article__implicit_6906 *self, sp_PtrArray * lv_list); | |
| static inline sp_RbVal sp_Article__implicit_6906_before_destroy(sp_Article__implicit_6906 *self); | |
| static inline const char * sp_Article__implicit_6906_dom_prefix(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_after_create_commit(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_after_update_commit(sp_Article__implicit_6906 *self); | |
| static inline mrb_int sp_Article__implicit_6906_after_destroy_commit(sp_Article__implicit_6906 *self); | |
| static sp_IntArray * sp_Article__implicit_6906_cls_schema_columns(void); | |
| static sp_Article__implicit_7484 *sp_Article__implicit_7484_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Article__implicit_7484_initialize(sp_Article__implicit_7484 *self, sp_StrIntHash * lv_attrs); | |
| static inline sp_RbVal sp_Article__implicit_7484_id(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_id_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7484_body(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_body_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7484_created_at(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_created_at_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7484_title(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_title_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7484_updated_at(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_updated_at_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value); | |
| static mrb_int sp_Article__implicit_7484_assign_from_row(sp_Article__implicit_7484 *self, sp_StrPolyHash * lv_row); | |
| static inline sp_RbVal sp_Article__implicit_7484_attributes(sp_Article__implicit_7484 *self); | |
| static inline sp_RbVal sp_Article__implicit_7484__aref(sp_Article__implicit_7484 *self, sp_RbVal lv_name); | |
| static inline mrb_int sp_Article__implicit_7484__aset(sp_Article__implicit_7484 *self, sp_sym lv_name, sp_RbVal lv_value); | |
| static inline mrb_bool sp_Article__implicit_7484_update(sp_Article__implicit_7484 *self, sp_ArticleParams * lv_p); | |
| static inline mrb_int sp_Article__implicit_7484__adapter_insert(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484__adapter_update(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484__adapter_delete(sp_Article__implicit_7484 *self); | |
| static sp_RbVal sp_Article__implicit_7484__adapter_reload(sp_Article__implicit_7484 *self); | |
| static inline sp_StrArray * sp_Article__implicit_7484_validate(sp_Article__implicit_7484 *self); | |
| static sp_RbVal sp_Article__implicit_7484_comments(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484__preload_comments(sp_Article__implicit_7484 *self, mrb_int lv_list); | |
| static inline sp_RbVal sp_Article__implicit_7484_before_destroy(sp_Article__implicit_7484 *self); | |
| static inline const char * sp_Article__implicit_7484_dom_prefix(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_after_create_commit(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_after_update_commit(sp_Article__implicit_7484 *self); | |
| static inline mrb_int sp_Article__implicit_7484_after_destroy_commit(sp_Article__implicit_7484 *self); | |
| static sp_IntArray * sp_Article__implicit_7484_cls_schema_columns(void); | |
| static sp_Article__implicit_7995 *sp_Article__implicit_7995_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Article__implicit_7995_initialize(sp_Article__implicit_7995 *self, sp_StrIntHash * lv_attrs); | |
| static inline sp_RbVal sp_Article__implicit_7995_id(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_id_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7995_body(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_body_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7995_created_at(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_created_at_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7995_title(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_title_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_7995_updated_at(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_updated_at_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value); | |
| static mrb_int sp_Article__implicit_7995_assign_from_row(sp_Article__implicit_7995 *self, sp_StrPolyHash * lv_row); | |
| static inline sp_RbVal sp_Article__implicit_7995_attributes(sp_Article__implicit_7995 *self); | |
| static inline sp_RbVal sp_Article__implicit_7995__aref(sp_Article__implicit_7995 *self, sp_RbVal lv_name); | |
| static inline mrb_int sp_Article__implicit_7995__aset(sp_Article__implicit_7995 *self, sp_sym lv_name, sp_RbVal lv_value); | |
| static inline mrb_bool sp_Article__implicit_7995_update(sp_Article__implicit_7995 *self, sp_ArticleParams * lv_p); | |
| static inline mrb_int sp_Article__implicit_7995__adapter_insert(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995__adapter_update(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995__adapter_delete(sp_Article__implicit_7995 *self); | |
| static sp_RbVal sp_Article__implicit_7995__adapter_reload(sp_Article__implicit_7995 *self); | |
| static inline sp_StrArray * sp_Article__implicit_7995_validate(sp_Article__implicit_7995 *self); | |
| static sp_RbVal sp_Article__implicit_7995_comments(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995__preload_comments(sp_Article__implicit_7995 *self, mrb_int lv_list); | |
| static inline sp_RbVal sp_Article__implicit_7995_before_destroy(sp_Article__implicit_7995 *self); | |
| static inline const char * sp_Article__implicit_7995_dom_prefix(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_after_create_commit(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_after_update_commit(sp_Article__implicit_7995 *self); | |
| static inline mrb_int sp_Article__implicit_7995_after_destroy_commit(sp_Article__implicit_7995 *self); | |
| static sp_IntArray * sp_Article__implicit_7995_cls_schema_columns(void); | |
| static sp_Article__implicit_9355 *sp_Article__implicit_9355_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Article__implicit_9355_initialize(sp_Article__implicit_9355 *self, sp_StrIntHash * lv_attrs); | |
| static inline sp_RbVal sp_Article__implicit_9355_id(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_id_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9355_body(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_body_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9355_created_at(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_created_at_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9355_title(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_title_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9355_updated_at(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_updated_at_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value); | |
| static mrb_int sp_Article__implicit_9355_assign_from_row(sp_Article__implicit_9355 *self, sp_StrPolyHash * lv_row); | |
| static inline sp_RbVal sp_Article__implicit_9355_attributes(sp_Article__implicit_9355 *self); | |
| static inline sp_RbVal sp_Article__implicit_9355__aref(sp_Article__implicit_9355 *self, sp_RbVal lv_name); | |
| static inline mrb_int sp_Article__implicit_9355__aset(sp_Article__implicit_9355 *self, sp_sym lv_name, sp_RbVal lv_value); | |
| static inline mrb_bool sp_Article__implicit_9355_update(sp_Article__implicit_9355 *self, mrb_int lv_p); | |
| static inline mrb_int sp_Article__implicit_9355__adapter_insert(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355__adapter_update(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355__adapter_delete(sp_Article__implicit_9355 *self); | |
| static sp_RbVal sp_Article__implicit_9355__adapter_reload(sp_Article__implicit_9355 *self); | |
| static inline sp_StrArray * sp_Article__implicit_9355_validate(sp_Article__implicit_9355 *self); | |
| static sp_RbVal sp_Article__implicit_9355_comments(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355__preload_comments(sp_Article__implicit_9355 *self, mrb_int lv_list); | |
| static inline sp_RbVal sp_Article__implicit_9355_before_destroy(sp_Article__implicit_9355 *self); | |
| static inline const char * sp_Article__implicit_9355_dom_prefix(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_after_create_commit(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_after_update_commit(sp_Article__implicit_9355 *self); | |
| static inline mrb_int sp_Article__implicit_9355_after_destroy_commit(sp_Article__implicit_9355 *self); | |
| static sp_IntArray * sp_Article__implicit_9355_cls_schema_columns(void); | |
| static sp_Article__implicit_9372 *sp_Article__implicit_9372_new(sp_StrIntHash * lv_attrs); | |
| static inline void sp_Article__implicit_9372_initialize(sp_Article__implicit_9372 *self, sp_StrIntHash * lv_attrs); | |
| static inline sp_RbVal sp_Article__implicit_9372_id(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_id_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9372_body(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9372_created_at(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9372_title(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| static inline sp_RbVal sp_Article__implicit_9372_updated_at(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value); | |
| static mrb_int sp_Article__implicit_9372_assign_from_row(sp_Article__implicit_9372 *self, sp_StrPolyHash * lv_row); | |
| static inline sp_RbVal sp_Article__implicit_9372_attributes(sp_Article__implicit_9372 *self); | |
| static inline sp_RbVal sp_Article__implicit_9372__aref(sp_Article__implicit_9372 *self, sp_RbVal lv_name); | |
| static inline mrb_int sp_Article__implicit_9372__aset(sp_Article__implicit_9372 *self, sp_sym lv_name, sp_RbVal lv_value); | |
| static inline mrb_bool sp_Article__implicit_9372_update(sp_Article__implicit_9372 *self, mrb_int lv_p); | |
| static inline mrb_int sp_Article__implicit_9372__adapter_insert(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372__adapter_update(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372__adapter_delete(sp_Article__implicit_9372 *self); | |
| static sp_RbVal sp_Article__implicit_9372__adapter_reload(sp_Article__implicit_9372 *self); | |
| static inline sp_StrArray * sp_Article__implicit_9372_validate(sp_Article__implicit_9372 *self); | |
| static sp_RbVal sp_Article__implicit_9372_comments(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372__preload_comments(sp_Article__implicit_9372 *self, mrb_int lv_list); | |
| static inline sp_RbVal sp_Article__implicit_9372_before_destroy(sp_Article__implicit_9372 *self); | |
| static inline const char * sp_Article__implicit_9372_dom_prefix(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_after_create_commit(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_after_update_commit(sp_Article__implicit_9372 *self); | |
| static inline mrb_int sp_Article__implicit_9372_after_destroy_commit(sp_Article__implicit_9372 *self); | |
| static sp_IntArray * sp_Article__implicit_9372_cls_schema_columns(void); | |
| static const char * cst_Base64_ALPHABET = (&("\xff")[1]); | |
| static mrb_int cst_SQL_OK = 0; | |
| static mrb_int cst_SQL_ROW = 0; | |
| static mrb_int cst_SQL_DONE = 0; | |
| static sp_DbPool * cst_Db_pool = NULL; | |
| static sp_RbVal cst_Db_query_log = {SP_TAG_NIL, 0, {0}}; | |
| static sp_StrPolyHash * cst_ActiveRecord_Registry_entries = NULL; | |
| static sp_RbVal cst_ActiveRecord_adapter = {SP_TAG_NIL, 0, {0}}; | |
| static sp_SymStrHash * cst_ActionView_ViewHelpers_slots = NULL; | |
| static sp_StrStrHash * cst_ActionView_ViewHelpers_HTML_ESCAPES = NULL; | |
| static mrb_regexp_pattern * cst_ActionView_ViewHelpers_HTML_ESCAPE_PATTERN = NULL; | |
| static sp_SymIntHash * cst_ActionController_STATUS_CODES = NULL; | |
| static sp_StrStrHash * cst_JsonBuilder_ESCAPES = NULL; | |
| static mrb_regexp_pattern * cst_JsonBuilder_ESCAPE_PATTERN = NULL; | |
| static sp_PolyArray * cst_Broadcasts_LOG = NULL; | |
| static sp_IntArray * cst_Broadcasts_TRANSPORTS = NULL; | |
| static sp_SymPolyHash * cst_RequestDispatch_STATUS_SYMBOLS = NULL; | |
| static mrb_int cst_DbConn_CAP = 0; | |
| SP_POOL_DEFINE(ActiveRecord_RecordNotFound) | |
| static inline sp_ActiveRecord_RecordNotFound *sp_ActiveRecord_RecordNotFound_new(const char * lv_message) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_message); | |
| sp_ActiveRecord_RecordNotFound *self = SP_POOL_NEW(ActiveRecord_RecordNotFound, NULL); | |
| self->cls_id = 49LL; | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_message); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActiveRecord_RecordNotFound_initialize(sp_ActiveRecord_RecordNotFound *self, const char * lv_message) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_message); | |
| } | |
| SP_POOL_DEFINE(ActiveRecord_RecordInvalid) | |
| static inline sp_ActiveRecord_RecordInvalid *sp_ActiveRecord_RecordInvalid_new(sp_ActiveRecord_Base * lv_record) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_record); | |
| sp_ActiveRecord_RecordInvalid *self = SP_POOL_NEW(ActiveRecord_RecordInvalid, sp_ActiveRecord_RecordInvalid_gc_scan); | |
| self->cls_id = 50LL; | |
| SP_GC_ROOT(self); | |
| self->iv_record = NULL; | |
| SP_GC_ROOT(lv_record); | |
| self->iv_record = lv_record; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActiveRecord_RecordInvalid_initialize(sp_ActiveRecord_RecordInvalid *self, sp_ActiveRecord_Base * lv_record) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_record); | |
| #line 15 "test/models/../../runtime/active_record/errors.rb" | |
| self->iv_record = lv_record; | |
| } | |
| SP_POOL_DEFINE(ActiveRecord_ConnectionAdapters_ConnectionPool) | |
| static inline sp_ActiveRecord_ConnectionAdapters_ConnectionPool *sp_ActiveRecord_ConnectionAdapters_ConnectionPool_new(mrb_int lv_size, sp_Proc *_ctor_blk) { | |
| SP_GC_SAVE(); | |
| sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self = SP_POOL_NEW(ActiveRecord_ConnectionAdapters_ConnectionPool, sp_ActiveRecord_ConnectionAdapters_ConnectionPool_gc_scan); | |
| self->cls_id = 51LL; | |
| SP_GC_ROOT(self); | |
| self->iv_free = NULL; | |
| mrb_int lv_i = 0; | |
| self->iv_size = lv_size; | |
| self->iv_free = sp_IntArray_new(); | |
| #line 42 "test/models/../../runtime/active_record/connection_pool.rb" | |
| lv_i = 0LL; | |
| #line 43 "test/models/../../runtime/active_record/connection_pool.rb" | |
| while ((lv_i < lv_size)) { | |
| sp_redo_1: ; | |
| #line 44 "test/models/../../runtime/active_record/connection_pool.rb" | |
| sp_IntArray_push(self->iv_free, sp_proc_call(_ctor_blk, (mrb_int[]){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})); | |
| #line 45 "test/models/../../runtime/active_record/connection_pool.rb" | |
| lv_i += 1LL; | |
| } | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActiveRecord_ConnectionAdapters_ConnectionPool_initialize(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self, mrb_int lv_size) { | |
| mrb_int lv_i = 0; | |
| #line 40 "test/models/../../runtime/active_record/connection_pool.rb" | |
| self->iv_size = lv_size; | |
| #line 41 "test/models/../../runtime/active_record/connection_pool.rb" | |
| self->iv_free = sp_IntArray_new(); | |
| #line 42 "test/models/../../runtime/active_record/connection_pool.rb" | |
| lv_i = 0LL; | |
| #line 43 "test/models/../../runtime/active_record/connection_pool.rb" | |
| while ((lv_i < lv_size)) { | |
| sp_redo_2: ; | |
| #line 44 "test/models/../../runtime/active_record/connection_pool.rb" | |
| sp_IntArray_push(self->iv_free, 0); | |
| #line 45 "test/models/../../runtime/active_record/connection_pool.rb" | |
| lv_i += 1LL; | |
| } | |
| } | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_checkout(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_checkin(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self, mrb_int lv_handle) { | |
| (void)lv_handle; | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_wait_for_handle(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 66 "test/models/../../runtime/active_record/connection_pool.rb" | |
| const char * _t1 = (&("\xff" "ConnectionPool exhausted (size=")[1]); | |
| SP_GC_ROOT(_t1); | |
| const char * _t2 = sp_int_to_s(self->iv_size); | |
| SP_GC_ROOT(_t2); | |
| const char * _t3 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t3); | |
| sp_raise(sp_str_concat3(_t1, _t2, _t3)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_available_count(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_ConnectionAdapters_ConnectionPool_in_use_count(sp_ActiveRecord_ConnectionAdapters_ConnectionPool *self) { | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(ActiveRecord_Base) | |
| static inline sp_ActiveRecord_Base *sp_ActiveRecord_Base_new(sp_SymPolyHash * lv__attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv__attrs); | |
| sp_ActiveRecord_Base *self = SP_POOL_NEW(ActiveRecord_Base, sp_ActiveRecord_Base_gc_scan); | |
| self->cls_id = 52LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_id = sp_box_nil(); | |
| SP_GC_ROOT(lv__attrs); | |
| self->iv_id = sp_box_int(0LL); | |
| self->iv_errors = sp_StrArray_new(); | |
| self->iv_persisted = FALSE; | |
| self->iv_destroyed = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActiveRecord_Base_initialize(sp_ActiveRecord_Base *self, sp_SymPolyHash * lv__attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv__attrs); | |
| #line 41 "test/models/../../runtime/active_record/base.rb" | |
| self->iv_id = sp_box_int(0LL); | |
| #line 42 "test/models/../../runtime/active_record/base.rb" | |
| self->iv_errors = sp_StrArray_new(); | |
| #line 43 "test/models/../../runtime/active_record/base.rb" | |
| self->iv_persisted = FALSE; | |
| #line 44 "test/models/../../runtime/active_record/base.rb" | |
| self->iv_destroyed = FALSE; | |
| } | |
| static inline sp_StrArray * sp_ActiveRecord_Base_errors(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 30 "test/models/../../runtime/active_record/base.rb" | |
| return self->iv_errors; | |
| return NULL; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base__adapter_insert(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base__adapter_update(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base__adapter_delete(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline sp_ActiveRecord_Base * sp_ActiveRecord_Base__adapter_reload(sp_ActiveRecord_Base *self) { | |
| return NULL; | |
| } | |
| static inline sp_SymPolyHash * sp_ActiveRecord_Base_attributes(sp_ActiveRecord_Base *self) { | |
| return NULL; | |
| } | |
| static inline sp_RbVal sp_ActiveRecord_Base__aref(sp_ActiveRecord_Base *self, sp_sym lv__name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 140 "test/models/../../runtime/active_record/base.rb" | |
| sp_raise_cls("NotImplementedError", (&("\xff" "[] must be overridden by subclass")[1])); | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_ActiveRecord_Base__aset(sp_ActiveRecord_Base *self, sp_sym lv__name, sp_RbVal lv__value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv__value); | |
| SP_GC_ROOT(self); | |
| #line 144 "test/models/../../runtime/active_record/base.rb" | |
| sp_raise_cls("NotImplementedError", (&("\xff" "[]= must be overridden by subclass")[1])); | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_assign_from_row(sp_ActiveRecord_Base *self, sp_StrPolyHash * lv__row) { | |
| (void)lv__row; | |
| return 0; | |
| } | |
| static inline const char * sp_ActiveRecord_Base_dom_prefix(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 165 "test/models/../../runtime/active_record/base.rb" | |
| sp_raise_cls("NotImplementedError", (&("\xff" "dom_prefix must be overridden by subclass")[1])); | |
| return (&("\xff")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_bool sp_ActiveRecord_Base_persisted_p(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 171 "test/models/../../runtime/active_record/base.rb" | |
| return self->iv_persisted; | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActiveRecord_Base_new_record_p(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 175 "test/models/../../runtime/active_record/base.rb" | |
| return (!self->iv_persisted); | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActiveRecord_Base_destroyed_p(sp_ActiveRecord_Base *self) { | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_mark_persisted_bang(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 183 "test/models/../../runtime/active_record/base.rb" | |
| self->iv_persisted = TRUE; | |
| #line 184 "test/models/../../runtime/active_record/base.rb" | |
| self->iv_destroyed = FALSE; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_bool sp_ActiveRecord_Base_save(sp_ActiveRecord_Base *self) { | |
| mrb_bool lv_ok = FALSE; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 274 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_before_validation(self); | |
| #line 275 "test/models/../../runtime/active_record/base.rb" | |
| lv_ok = sp_ActiveRecord_Base_valid_p(self); | |
| #line 276 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_after_validation(self); | |
| #line 277 "test/models/../../runtime/active_record/base.rb" | |
| if (!(lv_ok)) { | |
| mrb_bool _t4 = FALSE; | |
| SP_GC_RESTORE(); | |
| return _t4; | |
| } | |
| #line 279 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_before_save(self); | |
| #line 280 "test/models/../../runtime/active_record/base.rb" | |
| if (sp_ActiveRecord_Base_new_record_p(self)) { | |
| #line 281 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_before_create(self); | |
| #line 282 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_fill_timestamps(self, TRUE); | |
| #line 283 "test/models/../../runtime/active_record/base.rb" | |
| mrb_int _t5 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t5 = sp_Comment__adapter_insert((sp_Comment *)self); break; | |
| case 78LL: _t5 = sp_Article__implicit_6872__adapter_insert((sp_Article__implicit_6872 *)self); break; | |
| case 79LL: _t5 = sp_Article__implicit_6906__adapter_insert((sp_Article__implicit_6906 *)self); break; | |
| case 80LL: _t5 = sp_Article__implicit_7484__adapter_insert((sp_Article__implicit_7484 *)self); break; | |
| case 81LL: _t5 = sp_Article__implicit_7995__adapter_insert((sp_Article__implicit_7995 *)self); break; | |
| case 82LL: _t5 = sp_Article__implicit_9355__adapter_insert((sp_Article__implicit_9355 *)self); break; | |
| case 83LL: _t5 = sp_Article__implicit_9372__adapter_insert((sp_Article__implicit_9372 *)self); break; | |
| default: _t5 = sp_ActiveRecord_Base__adapter_insert(self); break; | |
| } | |
| self->iv_id = sp_box_int(_t5); | |
| #line 284 "test/models/../../runtime/active_record/base.rb" | |
| self->iv_persisted = TRUE; | |
| #line 285 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_after_create(self); | |
| #line 286 "test/models/../../runtime/active_record/base.rb" | |
| mrb_int _t6 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t6 = sp_Comment_after_create_commit((sp_Comment *)self); break; | |
| case 78LL: _t6 = sp_Article__implicit_6872_after_create_commit((sp_Article__implicit_6872 *)self); break; | |
| case 79LL: _t6 = sp_Article__implicit_6906_after_create_commit((sp_Article__implicit_6906 *)self); break; | |
| case 80LL: _t6 = sp_Article__implicit_7484_after_create_commit((sp_Article__implicit_7484 *)self); break; | |
| case 81LL: _t6 = sp_Article__implicit_7995_after_create_commit((sp_Article__implicit_7995 *)self); break; | |
| case 82LL: _t6 = sp_Article__implicit_9355_after_create_commit((sp_Article__implicit_9355 *)self); break; | |
| case 83LL: _t6 = sp_Article__implicit_9372_after_create_commit((sp_Article__implicit_9372 *)self); break; | |
| default: _t6 = sp_ActiveRecord_Base_after_create_commit(self); break; | |
| } | |
| _t6; | |
| } else { | |
| #line 288 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_before_update(self); | |
| #line 289 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_fill_timestamps(self, FALSE); | |
| #line 290 "test/models/../../runtime/active_record/base.rb" | |
| mrb_int _t7 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t7 = sp_Comment__adapter_update((sp_Comment *)self); break; | |
| case 78LL: _t7 = sp_Article__implicit_6872__adapter_update((sp_Article__implicit_6872 *)self); break; | |
| case 79LL: _t7 = sp_Article__implicit_6906__adapter_update((sp_Article__implicit_6906 *)self); break; | |
| case 80LL: _t7 = sp_Article__implicit_7484__adapter_update((sp_Article__implicit_7484 *)self); break; | |
| case 81LL: _t7 = sp_Article__implicit_7995__adapter_update((sp_Article__implicit_7995 *)self); break; | |
| case 82LL: _t7 = sp_Article__implicit_9355__adapter_update((sp_Article__implicit_9355 *)self); break; | |
| case 83LL: _t7 = sp_Article__implicit_9372__adapter_update((sp_Article__implicit_9372 *)self); break; | |
| default: _t7 = sp_ActiveRecord_Base__adapter_update(self); break; | |
| } | |
| _t7; | |
| #line 291 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_after_update(self); | |
| #line 292 "test/models/../../runtime/active_record/base.rb" | |
| mrb_int _t8 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t8 = sp_Comment_after_update_commit((sp_Comment *)self); break; | |
| case 78LL: _t8 = sp_Article__implicit_6872_after_update_commit((sp_Article__implicit_6872 *)self); break; | |
| case 79LL: _t8 = sp_Article__implicit_6906_after_update_commit((sp_Article__implicit_6906 *)self); break; | |
| case 80LL: _t8 = sp_Article__implicit_7484_after_update_commit((sp_Article__implicit_7484 *)self); break; | |
| case 81LL: _t8 = sp_Article__implicit_7995_after_update_commit((sp_Article__implicit_7995 *)self); break; | |
| case 82LL: _t8 = sp_Article__implicit_9355_after_update_commit((sp_Article__implicit_9355 *)self); break; | |
| case 83LL: _t8 = sp_Article__implicit_9372_after_update_commit((sp_Article__implicit_9372 *)self); break; | |
| default: _t8 = sp_ActiveRecord_Base_after_update_commit(self); break; | |
| } | |
| _t8; | |
| } | |
| #line 294 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_after_save(self); | |
| #line 295 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_after_save_commit(self); | |
| #line 296 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_after_commit(self); | |
| #line 297 "test/models/../../runtime/active_record/base.rb" | |
| return TRUE; | |
| return FALSE; | |
| } | |
| static inline sp_ActiveRecord_Base * sp_ActiveRecord_Base_save_bang(sp_ActiveRecord_Base *self) { | |
| return NULL; | |
| } | |
| static sp_ActiveRecord_Base * sp_ActiveRecord_Base_destroy(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 306 "test/models/../../runtime/active_record/base.rb" | |
| if (!(sp_ActiveRecord_Base_persisted_p(self))) { | |
| sp_ActiveRecord_Base * _t9 = self; | |
| SP_GC_RESTORE(); | |
| return _t9; | |
| } | |
| #line 307 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_before_destroy(self); | |
| #line 308 "test/models/../../runtime/active_record/base.rb" | |
| mrb_int _t10 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t10 = sp_Comment__adapter_delete((sp_Comment *)self); break; | |
| case 78LL: _t10 = sp_Article__implicit_6872__adapter_delete((sp_Article__implicit_6872 *)self); break; | |
| case 79LL: _t10 = sp_Article__implicit_6906__adapter_delete((sp_Article__implicit_6906 *)self); break; | |
| case 80LL: _t10 = sp_Article__implicit_7484__adapter_delete((sp_Article__implicit_7484 *)self); break; | |
| case 81LL: _t10 = sp_Article__implicit_7995__adapter_delete((sp_Article__implicit_7995 *)self); break; | |
| case 82LL: _t10 = sp_Article__implicit_9355__adapter_delete((sp_Article__implicit_9355 *)self); break; | |
| case 83LL: _t10 = sp_Article__implicit_9372__adapter_delete((sp_Article__implicit_9372 *)self); break; | |
| default: _t10 = sp_ActiveRecord_Base__adapter_delete(self); break; | |
| } | |
| _t10; | |
| #line 309 "test/models/../../runtime/active_record/base.rb" | |
| self->iv_persisted = FALSE; | |
| #line 310 "test/models/../../runtime/active_record/base.rb" | |
| self->iv_destroyed = TRUE; | |
| #line 311 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_after_destroy(self); | |
| #line 312 "test/models/../../runtime/active_record/base.rb" | |
| mrb_int _t11 = 0; | |
| switch (self->cls_id) { | |
| case 67LL: _t11 = sp_Comment_after_destroy_commit((sp_Comment *)self); break; | |
| case 78LL: _t11 = sp_Article__implicit_6872_after_destroy_commit((sp_Article__implicit_6872 *)self); break; | |
| case 79LL: _t11 = sp_Article__implicit_6906_after_destroy_commit((sp_Article__implicit_6906 *)self); break; | |
| case 80LL: _t11 = sp_Article__implicit_7484_after_destroy_commit((sp_Article__implicit_7484 *)self); break; | |
| case 81LL: _t11 = sp_Article__implicit_7995_after_destroy_commit((sp_Article__implicit_7995 *)self); break; | |
| case 82LL: _t11 = sp_Article__implicit_9355_after_destroy_commit((sp_Article__implicit_9355 *)self); break; | |
| case 83LL: _t11 = sp_Article__implicit_9372_after_destroy_commit((sp_Article__implicit_9372 *)self); break; | |
| default: _t11 = sp_ActiveRecord_Base_after_destroy_commit(self); break; | |
| } | |
| _t11; | |
| #line 313 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_after_commit(self); | |
| #line 314 "test/models/../../runtime/active_record/base.rb" | |
| return self; | |
| return NULL; | |
| } | |
| static inline sp_ActiveRecord_Base * sp_ActiveRecord_Base_reload(sp_ActiveRecord_Base *self) { | |
| return NULL; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_before_validation(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_validation(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_before_save(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_save(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_before_create(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_create(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_before_update(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_update(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_before_destroy(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_destroy(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_commit(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_create_commit(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_update_commit(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_destroy_commit(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_save_commit(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_after_touch(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Base_validate(sp_ActiveRecord_Base *self) { | |
| return 0; | |
| } | |
| static mrb_int sp_ActiveRecord_Base_fill_timestamps(sp_ActiveRecord_Base *self, mrb_bool lv_creating) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_cols = sp_box_nil(); | |
| const char * lv_now = (&("\xff")[1]); | |
| SP_GC_ROOT_RBVAL(lv_cols); | |
| SP_GC_ROOT(lv_now); | |
| SP_GC_ROOT(self); | |
| #line 374 "test/models/../../runtime/active_record/base.rb" | |
| sp_RbVal _t12 = sp_box_nil(); | |
| switch (self->cls_id) { | |
| case 65LL: _t12 = sp_box_int(sp_ApplicationRecord_cls_schema_columns()); break; | |
| case 67LL: _t12 = sp_box_sym_array(sp_Comment_cls_schema_columns()); break; | |
| case 69LL: _t12 = sp_box_sym_array(sp_Article_cls_schema_columns()); break; | |
| case 78LL: _t12 = sp_box_sym_array(sp_Article__implicit_6872_cls_schema_columns()); break; | |
| case 79LL: _t12 = sp_box_sym_array(sp_Article__implicit_6906_cls_schema_columns()); break; | |
| case 80LL: _t12 = sp_box_sym_array(sp_Article__implicit_7484_cls_schema_columns()); break; | |
| case 81LL: _t12 = sp_box_sym_array(sp_Article__implicit_7995_cls_schema_columns()); break; | |
| case 82LL: _t12 = sp_box_sym_array(sp_Article__implicit_9355_cls_schema_columns()); break; | |
| case 83LL: _t12 = sp_box_sym_array(sp_Article__implicit_9372_cls_schema_columns()); break; | |
| default: _t12 = sp_box_sym_array(sp_ActiveRecord_Base_cls_schema_columns()); break; | |
| } | |
| lv_cols = _t12; | |
| #line 375 "test/models/../../runtime/active_record/base.rb" | |
| lv_now = sp_time_iso8601(sp_time_utc(sp_time_now())); | |
| #line 376 "test/models/../../runtime/active_record/base.rb" | |
| sp_RbVal _t13 = lv_cols; | |
| mrb_bool _t14 = FALSE; | |
| if (_t13.tag == SP_TAG_OBJ) { | |
| if (_t13.cls_id == 55) _t14 = sp_ActionDispatch_Flash_include_p((sp_ActionDispatch_Flash *)_t13.v.p, sp_box_sym(SPS_updated_at)); | |
| if (_t13.cls_id == 56) _t14 = sp_ActionDispatch_Session_include_p((sp_ActionDispatch_Session *)_t13.v.p, sp_box_sym(SPS_updated_at)); | |
| if (_t13.cls_id == SP_BUILTIN_SYM_ARRAY) _t14 = sp_IntArray_include((sp_IntArray *)_t13.v.p, (mrb_int)(SPS_updated_at)); | |
| if (_t13.cls_id == SP_BUILTIN_SYM_INT_HASH) _t14 = sp_SymIntHash_has_key((sp_SymIntHash *)_t13.v.p, SPS_updated_at); | |
| if (_t13.cls_id == SP_BUILTIN_SYM_STR_HASH) _t14 = sp_SymStrHash_has_key((sp_SymStrHash *)_t13.v.p, SPS_updated_at); | |
| if (_t13.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t14 = sp_SymPolyHash_has_key((sp_SymPolyHash *)_t13.v.p, SPS_updated_at); | |
| } | |
| if (_t14) { | |
| switch (self->cls_id) { | |
| case 67LL: sp_Comment__aset((sp_Comment *)self, SPS_updated_at, sp_box_str(lv_now)); break; | |
| case 78LL: sp_Article__implicit_6872__aset((sp_Article__implicit_6872 *)self, SPS_updated_at, sp_box_str(lv_now)); break; | |
| case 79LL: sp_Article__implicit_6906__aset((sp_Article__implicit_6906 *)self, SPS_updated_at, sp_box_str(lv_now)); break; | |
| case 80LL: sp_Article__implicit_7484__aset((sp_Article__implicit_7484 *)self, SPS_updated_at, sp_box_str(lv_now)); break; | |
| case 81LL: sp_Article__implicit_7995__aset((sp_Article__implicit_7995 *)self, SPS_updated_at, sp_box_str(lv_now)); break; | |
| case 82LL: sp_Article__implicit_9355__aset((sp_Article__implicit_9355 *)self, SPS_updated_at, sp_box_str(lv_now)); break; | |
| case 83LL: sp_Article__implicit_9372__aset((sp_Article__implicit_9372 *)self, SPS_updated_at, sp_box_str(lv_now)); break; | |
| default: sp_ActiveRecord_Base__aset(self, SPS_updated_at, sp_box_str(lv_now)); break; | |
| } | |
| } | |
| #line 377 "test/models/../../runtime/active_record/base.rb" | |
| mrb_bool _t16 = lv_creating; | |
| mrb_bool _t17 = FALSE; | |
| if (_t16) { | |
| sp_RbVal _t18 = lv_cols; | |
| mrb_bool _t19 = FALSE; | |
| if (_t18.tag == SP_TAG_OBJ) { | |
| if (_t18.cls_id == 55) _t19 = sp_ActionDispatch_Flash_include_p((sp_ActionDispatch_Flash *)_t18.v.p, sp_box_sym(SPS_created_at)); | |
| if (_t18.cls_id == 56) _t19 = sp_ActionDispatch_Session_include_p((sp_ActionDispatch_Session *)_t18.v.p, sp_box_sym(SPS_created_at)); | |
| if (_t18.cls_id == SP_BUILTIN_SYM_ARRAY) _t19 = sp_IntArray_include((sp_IntArray *)_t18.v.p, (mrb_int)(SPS_created_at)); | |
| if (_t18.cls_id == SP_BUILTIN_SYM_INT_HASH) _t19 = sp_SymIntHash_has_key((sp_SymIntHash *)_t18.v.p, SPS_created_at); | |
| if (_t18.cls_id == SP_BUILTIN_SYM_STR_HASH) _t19 = sp_SymStrHash_has_key((sp_SymStrHash *)_t18.v.p, SPS_created_at); | |
| if (_t18.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t19 = sp_SymPolyHash_has_key((sp_SymPolyHash *)_t18.v.p, SPS_created_at); | |
| } | |
| _t17 = _t19; | |
| } else { | |
| _t17 = _t16; | |
| } | |
| mrb_bool _t15 = _t17; | |
| mrb_bool _t20 = FALSE; | |
| if (_t15) { | |
| _t20 = sp_poly_nil_p(sp_ActiveRecord_Base__aref(self, SPS_created_at)); | |
| } else { | |
| _t20 = _t15; | |
| } | |
| if (_t20) { | |
| switch (self->cls_id) { | |
| case 67LL: sp_Comment__aset((sp_Comment *)self, SPS_created_at, sp_box_str(lv_now)); break; | |
| case 78LL: sp_Article__implicit_6872__aset((sp_Article__implicit_6872 *)self, SPS_created_at, sp_box_str(lv_now)); break; | |
| case 79LL: sp_Article__implicit_6906__aset((sp_Article__implicit_6906 *)self, SPS_created_at, sp_box_str(lv_now)); break; | |
| case 80LL: sp_Article__implicit_7484__aset((sp_Article__implicit_7484 *)self, SPS_created_at, sp_box_str(lv_now)); break; | |
| case 81LL: sp_Article__implicit_7995__aset((sp_Article__implicit_7995 *)self, SPS_created_at, sp_box_str(lv_now)); break; | |
| case 82LL: sp_Article__implicit_9355__aset((sp_Article__implicit_9355 *)self, SPS_created_at, sp_box_str(lv_now)); break; | |
| case 83LL: sp_Article__implicit_9372__aset((sp_Article__implicit_9372 *)self, SPS_created_at, sp_box_str(lv_now)); break; | |
| default: sp_ActiveRecord_Base__aset(self, SPS_created_at, sp_box_str(lv_now)); break; | |
| } | |
| return 0; | |
| } else { | |
| return 0; | |
| } | |
| return 0; | |
| } | |
| static inline mrb_bool sp_ActiveRecord_Base_valid_p(sp_ActiveRecord_Base *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 381 "test/models/../../runtime/active_record/base.rb" | |
| self->iv_errors = sp_StrArray_new(); | |
| #line 382 "test/models/../../runtime/active_record/base.rb" | |
| sp_ActiveRecord_Base_validate(self); | |
| #line 383 "test/models/../../runtime/active_record/base.rb" | |
| return sp_StrArray_empty(self->iv_errors); | |
| return FALSE; | |
| } | |
| static sp_IntArray * sp_ActiveRecord_Base_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| #line 56 "test/models/../../runtime/active_record/base.rb" | |
| sp_raise_cls("NotImplementedError", sp_sprintf("%s.schema_columns must be overridden", sp_class_to_s(((sp_Class){52LL})))); | |
| return NULL; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(ActionDispatch_Router_Route) | |
| static inline sp_ActionDispatch_Router_Route *sp_ActionDispatch_Router_Route_new(const char * lv_verb, const char * lv_pattern, sp_sym lv_controller, sp_sym lv_action) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_verb); | |
| SP_GC_ROOT(lv_pattern); | |
| sp_ActionDispatch_Router_Route *self = SP_POOL_NEW(ActionDispatch_Router_Route, sp_ActionDispatch_Router_Route_gc_scan); | |
| self->cls_id = 53LL; | |
| SP_GC_ROOT(self); | |
| self->iv_verb = NULL; | |
| self->iv_pattern = NULL; | |
| SP_GC_ROOT(lv_verb); | |
| SP_GC_ROOT(lv_pattern); | |
| self->iv_verb = lv_verb; | |
| self->iv_pattern = lv_pattern; | |
| self->iv_controller = lv_controller; | |
| self->iv_action = lv_action; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionDispatch_Router_Route_initialize(sp_ActionDispatch_Router_Route *self, const char * lv_verb, const char * lv_pattern, sp_sym lv_controller, sp_sym lv_action) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_verb); | |
| SP_GC_ROOT(lv_pattern); | |
| #line 30 "test/models/../../runtime/action_dispatch/router.rb" | |
| self->iv_verb = lv_verb; | |
| #line 31 "test/models/../../runtime/action_dispatch/router.rb" | |
| self->iv_pattern = lv_pattern; | |
| #line 32 "test/models/../../runtime/action_dispatch/router.rb" | |
| self->iv_controller = lv_controller; | |
| #line 33 "test/models/../../runtime/action_dispatch/router.rb" | |
| self->iv_action = lv_action; | |
| } | |
| SP_POOL_DEFINE(ActionDispatch_Router_MatchResult) | |
| static inline sp_ActionDispatch_Router_MatchResult *sp_ActionDispatch_Router_MatchResult_new(sp_sym lv_controller, sp_sym lv_action, sp_StrStrHash * lv_path_params) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path_params); | |
| sp_ActionDispatch_Router_MatchResult *self = SP_POOL_NEW(ActionDispatch_Router_MatchResult, sp_ActionDispatch_Router_MatchResult_gc_scan); | |
| self->cls_id = 54LL; | |
| SP_GC_ROOT(self); | |
| self->iv_path_params = NULL; | |
| SP_GC_ROOT(lv_path_params); | |
| self->iv_controller = lv_controller; | |
| self->iv_action = lv_action; | |
| self->iv_path_params = lv_path_params; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionDispatch_Router_MatchResult_initialize(sp_ActionDispatch_Router_MatchResult *self, sp_sym lv_controller, sp_sym lv_action, sp_StrStrHash * lv_path_params) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path_params); | |
| #line 45 "test/models/../../runtime/action_dispatch/router.rb" | |
| self->iv_controller = lv_controller; | |
| #line 46 "test/models/../../runtime/action_dispatch/router.rb" | |
| self->iv_action = lv_action; | |
| #line 47 "test/models/../../runtime/action_dispatch/router.rb" | |
| self->iv_path_params = lv_path_params; | |
| } | |
| SP_POOL_DEFINE(ActionDispatch_Flash) | |
| static inline sp_ActionDispatch_Flash *sp_ActionDispatch_Flash_new(sp_RbVal lv_other) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_other); | |
| sp_ActionDispatch_Flash *self = SP_POOL_NEW(ActionDispatch_Flash, sp_ActionDispatch_Flash_gc_scan); | |
| self->cls_id = 55LL; | |
| SP_GC_ROOT(self); | |
| self->iv_notice = NULL; | |
| self->iv_alert = NULL; | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT_RBVAL(lv_other); | |
| self->iv_notice = 0; | |
| self->iv_alert = 0; | |
| #line 25 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if (sp_poly_nil_p(lv_other)) { | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| #line 26 "test/models/../../runtime/action_dispatch/flash.rb" | |
| sp_RbVal _t21 = lv_other; | |
| sp_RbVal _t22 = sp_box_nil(); | |
| if (_t21.tag == SP_TAG_OBJ) { | |
| if (_t21.cls_id == 55) _t22 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t21.v.p, sp_box_str((&("\xff" "notice")[1])))); | |
| if (_t21.cls_id == 56) _t22 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t21.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t21.cls_id == 78) _t22 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t21.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t21.cls_id == 79) _t22 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t21.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t21.cls_id == 80) _t22 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t21.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t21.cls_id == 81) _t22 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t21.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t21.cls_id == 82) _t22 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t21.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t21.cls_id == 83) _t22 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t21.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t21.cls_id == SP_BUILTIN_STR_INT_HASH) _t22 = sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t21.v.p, (&("\xff" "notice")[1]))); | |
| if (_t21.cls_id == SP_BUILTIN_STR_STR_HASH) _t22 = sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t21.v.p, (&("\xff" "notice")[1]))); | |
| if (_t21.cls_id == SP_BUILTIN_STR_POLY_HASH) _t22 = sp_StrPolyHash_get((sp_StrPolyHash *)_t21.v.p, (&("\xff" "notice")[1])); | |
| } | |
| lv_v = _t22; | |
| #line 27 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!sp_poly_nil_p(lv_v))) { | |
| self->iv_notice = (lv_v).v.s; | |
| } | |
| #line 28 "test/models/../../runtime/action_dispatch/flash.rb" | |
| sp_RbVal _t23 = lv_other; | |
| sp_RbVal _t24 = sp_box_nil(); | |
| if (_t23.tag == SP_TAG_OBJ) { | |
| if (_t23.cls_id == 55) _t24 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t23.v.p, sp_box_str((&("\xff" "alert")[1])))); | |
| if (_t23.cls_id == 56) _t24 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t23.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t23.cls_id == 78) _t24 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t23.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t23.cls_id == 79) _t24 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t23.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t23.cls_id == 80) _t24 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t23.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t23.cls_id == 81) _t24 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t23.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t23.cls_id == 82) _t24 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t23.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t23.cls_id == 83) _t24 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t23.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t23.cls_id == SP_BUILTIN_STR_INT_HASH) _t24 = sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t23.v.p, (&("\xff" "alert")[1]))); | |
| if (_t23.cls_id == SP_BUILTIN_STR_STR_HASH) _t24 = sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t23.v.p, (&("\xff" "alert")[1]))); | |
| if (_t23.cls_id == SP_BUILTIN_STR_POLY_HASH) _t24 = sp_StrPolyHash_get((sp_StrPolyHash *)_t23.v.p, (&("\xff" "alert")[1])); | |
| } | |
| lv_v = _t24; | |
| #line 29 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!sp_poly_nil_p(lv_v))) { | |
| self->iv_alert = (lv_v).v.s; | |
| } | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionDispatch_Flash_initialize(sp_ActionDispatch_Flash *self, sp_RbVal lv_other) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT_RBVAL(lv_other); | |
| #line 23 "test/models/../../runtime/action_dispatch/flash.rb" | |
| self->iv_notice = 0; | |
| #line 24 "test/models/../../runtime/action_dispatch/flash.rb" | |
| self->iv_alert = 0; | |
| #line 25 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if (sp_poly_nil_p(lv_other)) { | |
| SP_GC_RESTORE(); | |
| return; | |
| } | |
| #line 26 "test/models/../../runtime/action_dispatch/flash.rb" | |
| sp_RbVal _t25 = lv_other; | |
| sp_RbVal _t26 = sp_box_nil(); | |
| if (_t25.tag == SP_TAG_OBJ) { | |
| if (_t25.cls_id == 55) _t26 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t25.v.p, sp_box_str((&("\xff" "notice")[1])))); | |
| if (_t25.cls_id == 56) _t26 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 78) _t26 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 79) _t26 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 80) _t26 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 81) _t26 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 82) _t26 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == 83) _t26 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t25.v.p, sp_box_str((&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == SP_BUILTIN_STR_INT_HASH) _t26 = sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t25.v.p, (&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == SP_BUILTIN_STR_STR_HASH) _t26 = sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t25.v.p, (&("\xff" "notice")[1]))); | |
| if (_t25.cls_id == SP_BUILTIN_STR_POLY_HASH) _t26 = sp_StrPolyHash_get((sp_StrPolyHash *)_t25.v.p, (&("\xff" "notice")[1])); | |
| } | |
| lv_v = _t26; | |
| #line 27 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!sp_poly_nil_p(lv_v))) { | |
| self->iv_notice = (lv_v).v.s; | |
| } | |
| #line 28 "test/models/../../runtime/action_dispatch/flash.rb" | |
| sp_RbVal _t27 = lv_other; | |
| sp_RbVal _t28 = sp_box_nil(); | |
| if (_t27.tag == SP_TAG_OBJ) { | |
| if (_t27.cls_id == 55) _t28 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t27.v.p, sp_box_str((&("\xff" "alert")[1])))); | |
| if (_t27.cls_id == 56) _t28 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 78) _t28 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 79) _t28 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 80) _t28 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 81) _t28 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 82) _t28 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == 83) _t28 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t27.v.p, sp_box_str((&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == SP_BUILTIN_STR_INT_HASH) _t28 = sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t27.v.p, (&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == SP_BUILTIN_STR_STR_HASH) _t28 = sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t27.v.p, (&("\xff" "alert")[1]))); | |
| if (_t27.cls_id == SP_BUILTIN_STR_POLY_HASH) _t28 = sp_StrPolyHash_get((sp_StrPolyHash *)_t27.v.p, (&("\xff" "alert")[1])); | |
| } | |
| lv_v = _t28; | |
| #line 29 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!sp_poly_nil_p(lv_v))) { | |
| self->iv_alert = (lv_v).v.s; | |
| } | |
| } | |
| static const char * sp_ActionDispatch_Flash__aref(sp_ActionDispatch_Flash *self, sp_RbVal lv_key) { | |
| SP_GC_SAVE(); | |
| const char * lv_k = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT(self); | |
| #line 37 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_k = sp_poly_to_s(lv_key); | |
| #line 38 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if (sp_str_eq(lv_k, (&("\xff" "notice")[1]))) { | |
| const char * _t29 = self->iv_notice; | |
| SP_GC_RESTORE(); | |
| return _t29; | |
| } | |
| #line 39 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if (sp_str_eq(lv_k, (&("\xff" "alert")[1]))) { | |
| const char * _t30 = self->iv_alert; | |
| SP_GC_RESTORE(); | |
| return _t30; | |
| } | |
| #line 40 "test/models/../../runtime/action_dispatch/flash.rb" | |
| return 0; | |
| return NULL; | |
| } | |
| static inline const char * sp_ActionDispatch_Flash__aset(sp_ActionDispatch_Flash *self, sp_RbVal lv_key, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| const char * lv_k = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| #line 44 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_k = sp_poly_to_s(lv_key); | |
| #line 45 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if (sp_str_eq(lv_k, (&("\xff" "notice")[1]))) { | |
| #line 46 "test/models/../../runtime/action_dispatch/flash.rb" | |
| self->iv_notice = lv_value; | |
| } else { | |
| if (sp_str_eq(lv_k, (&("\xff" "alert")[1]))) { | |
| #line 48 "test/models/../../runtime/action_dispatch/flash.rb" | |
| self->iv_alert = lv_value; | |
| } | |
| } | |
| #line 50 "test/models/../../runtime/action_dispatch/flash.rb" | |
| return (const char *)lv_value; | |
| return NULL; | |
| } | |
| static inline sp_RbVal sp_ActionDispatch_Flash_fetch(sp_ActionDispatch_Flash *self, const char * lv_key, sp_RbVal lv_default) { | |
| SP_GC_SAVE(); | |
| const char * lv_v = NULL; | |
| SP_GC_ROOT(lv_v); | |
| SP_GC_ROOT(lv_key); | |
| SP_GC_ROOT_RBVAL(lv_default); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_key); | |
| #line 54 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_v = sp_ActionDispatch_Flash__aref(self, sp_box_str(lv_key)); | |
| #line 55 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!(lv_v == NULL))) { | |
| sp_RbVal _t31 = sp_box_nullable_str(lv_v); | |
| SP_GC_RESTORE(); | |
| return _t31; | |
| } | |
| #line 56 "test/models/../../runtime/action_dispatch/flash.rb" | |
| sp_RbVal _t32 = lv_default; | |
| SP_GC_RESTORE(); | |
| return _t32; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_bool sp_ActionDispatch_Flash_key_p(sp_ActionDispatch_Flash *self, sp_RbVal lv_key) { | |
| SP_GC_SAVE(); | |
| const char * lv_v = NULL; | |
| SP_GC_ROOT(lv_v); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT(self); | |
| #line 60 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_v = sp_ActionDispatch_Flash__aref(self, lv_key); | |
| #line 61 "test/models/../../runtime/action_dispatch/flash.rb" | |
| return (!(lv_v == NULL)); | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActionDispatch_Flash_has_key_p(sp_ActionDispatch_Flash *self, sp_RbVal lv_key) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT(self); | |
| #line 65 "test/models/../../runtime/action_dispatch/flash.rb" | |
| return sp_ActionDispatch_Flash_key_p(self, lv_key); | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActionDispatch_Flash_include_p(sp_ActionDispatch_Flash *self, sp_RbVal lv_key) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT(self); | |
| #line 69 "test/models/../../runtime/action_dispatch/flash.rb" | |
| return sp_ActionDispatch_Flash_key_p(self, lv_key); | |
| return FALSE; | |
| } | |
| static const char * sp_ActionDispatch_Flash_delete(sp_ActionDispatch_Flash *self, sp_RbVal lv_key) { | |
| SP_GC_SAVE(); | |
| const char * lv_k = (&("\xff")[1]); | |
| const char * lv_v = NULL; | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT(lv_v); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT(self); | |
| #line 73 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_k = sp_poly_to_s(lv_key); | |
| #line 74 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if (sp_str_eq(lv_k, (&("\xff" "notice")[1]))) { | |
| #line 75 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_v = self->iv_notice; | |
| #line 76 "test/models/../../runtime/action_dispatch/flash.rb" | |
| self->iv_notice = 0; | |
| #line 77 "test/models/../../runtime/action_dispatch/flash.rb" | |
| const char * _t33 = lv_v; | |
| SP_GC_RESTORE(); | |
| return _t33; | |
| } | |
| #line 79 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if (sp_str_eq(lv_k, (&("\xff" "alert")[1]))) { | |
| #line 80 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_v = self->iv_alert; | |
| #line 81 "test/models/../../runtime/action_dispatch/flash.rb" | |
| self->iv_alert = 0; | |
| #line 82 "test/models/../../runtime/action_dispatch/flash.rb" | |
| const char * _t34 = lv_v; | |
| SP_GC_RESTORE(); | |
| return _t34; | |
| } | |
| #line 84 "test/models/../../runtime/action_dispatch/flash.rb" | |
| return 0; | |
| return NULL; | |
| } | |
| static mrb_int sp_ActionDispatch_Flash_length(sp_ActionDispatch_Flash *self) { | |
| mrb_int lv_n = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 92 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_n = 0LL; | |
| #line 93 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!(self->iv_notice == NULL))) { | |
| lv_n += 1LL; | |
| } | |
| #line 94 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!(self->iv_alert == NULL))) { | |
| lv_n += 1LL; | |
| } | |
| #line 95 "test/models/../../runtime/action_dispatch/flash.rb" | |
| return lv_n; | |
| return 0; | |
| } | |
| static mrb_int sp_ActionDispatch_Flash_size(sp_ActionDispatch_Flash *self) { | |
| mrb_int lv_n = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 99 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_n = 0LL; | |
| #line 100 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!(self->iv_notice == NULL))) { | |
| lv_n += 1LL; | |
| } | |
| #line 101 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!(self->iv_alert == NULL))) { | |
| lv_n += 1LL; | |
| } | |
| #line 102 "test/models/../../runtime/action_dispatch/flash.rb" | |
| return lv_n; | |
| return 0; | |
| } | |
| static inline mrb_bool sp_ActionDispatch_Flash_empty_p(sp_ActionDispatch_Flash *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 106 "test/models/../../runtime/action_dispatch/flash.rb" | |
| mrb_bool _t35 = (self->iv_notice == NULL); | |
| mrb_bool _t36 = FALSE; | |
| if (_t35) { | |
| _t36 = (self->iv_alert == NULL); | |
| } else { | |
| _t36 = _t35; | |
| } | |
| return _t36; | |
| return FALSE; | |
| } | |
| static sp_StrArray * sp_ActionDispatch_Flash_keys(sp_ActionDispatch_Flash *self) { | |
| SP_GC_SAVE(); | |
| sp_StrArray * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| SP_GC_ROOT(self); | |
| #line 110 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_result = sp_StrArray_new(); | |
| #line 111 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!(self->iv_notice == NULL))) { | |
| sp_StrArray_push(lv_result, (&("\xff" "notice")[1])); | |
| } | |
| #line 112 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!(self->iv_alert == NULL))) { | |
| sp_StrArray_push(lv_result, (&("\xff" "alert")[1])); | |
| } | |
| #line 113 "test/models/../../runtime/action_dispatch/flash.rb" | |
| return (sp_StrArray *)lv_result; | |
| return NULL; | |
| } | |
| static sp_StrArray * sp_ActionDispatch_Flash_values(sp_ActionDispatch_Flash *self) { | |
| SP_GC_SAVE(); | |
| sp_StrArray * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| SP_GC_ROOT(self); | |
| #line 117 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_result = sp_StrArray_new(); | |
| #line 118 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!(self->iv_notice == NULL))) { | |
| sp_StrArray_push(lv_result, self->iv_notice); | |
| } | |
| #line 119 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!(self->iv_alert == NULL))) { | |
| sp_StrArray_push(lv_result, self->iv_alert); | |
| } | |
| #line 120 "test/models/../../runtime/action_dispatch/flash.rb" | |
| return (sp_StrArray *)lv_result; | |
| return NULL; | |
| } | |
| static sp_ActionDispatch_Flash * sp_ActionDispatch_Flash_each(sp_ActionDispatch_Flash *self, void (*_block)(const char *, const char *, void*), void *_benv) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 127 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!(self->iv_notice == NULL))) { | |
| if (_block) _block((&("\xff" "notice")[1]), self->iv_notice, _benv); | |
| } | |
| #line 128 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!(self->iv_alert == NULL))) { | |
| if (_block) _block((&("\xff" "alert")[1]), self->iv_alert, _benv); | |
| } | |
| #line 129 "test/models/../../runtime/action_dispatch/flash.rb" | |
| return self; | |
| return NULL; | |
| } | |
| static sp_StrStrHash * sp_ActionDispatch_Flash_to_h(sp_ActionDispatch_Flash *self) { | |
| SP_GC_SAVE(); | |
| sp_StrPolyHash * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| SP_GC_ROOT(self); | |
| #line 136 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_result = sp_StrPolyHash_new(); | |
| #line 137 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!(self->iv_notice == NULL))) { | |
| if (sp_gc_is_frozen(lv_result)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(lv_result, (&("\xff" "notice")[1]), sp_box_nullable_str(self->iv_notice)); | |
| } | |
| #line 138 "test/models/../../runtime/action_dispatch/flash.rb" | |
| if ((!(self->iv_alert == NULL))) { | |
| if (sp_gc_is_frozen(lv_result)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(lv_result, (&("\xff" "alert")[1]), sp_box_nullable_str(self->iv_alert)); | |
| } | |
| #line 139 "test/models/../../runtime/action_dispatch/flash.rb" | |
| return (sp_StrStrHash *)(lv_result); | |
| return NULL; | |
| } | |
| static sp_ActionDispatch_Flash * sp_ActionDispatch_Flash_merge(sp_ActionDispatch_Flash *self, sp_StrStrHash * lv_other) { | |
| SP_GC_SAVE(); | |
| sp_ActionDispatch_Flash * lv_result = NULL; | |
| const char * lv_k = (&("\xff")[1]); | |
| const char * lv_v = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_result); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT(lv_v); | |
| SP_GC_ROOT(lv_other); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_other); | |
| #line 146 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_result = sp_ActionDispatch_Flash_new(((void)(0), sp_box_nil())); | |
| #line 147 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_result->iv_notice = self->iv_notice; | |
| #line 148 "test/models/../../runtime/action_dispatch/flash.rb" | |
| lv_result->iv_alert = self->iv_alert; | |
| #line 149 "test/models/../../runtime/action_dispatch/flash.rb" | |
| for (mrb_int _t37 = 0; _t37 < lv_other->len; _t37++) { | |
| lv_k = lv_other->order[_t37]; | |
| lv_v = sp_StrStrHash_get(lv_other, lv_other->order[_t37]); | |
| sp_redo_3: ; | |
| #line 150 "test/models/../../runtime/action_dispatch/flash.rb" | |
| sp_ActionDispatch_Flash__aset(lv_result, sp_box_str(lv_k), lv_v); | |
| } | |
| #line 152 "test/models/../../runtime/action_dispatch/flash.rb" | |
| return (sp_ActionDispatch_Flash *)lv_result; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(ActionDispatch_Session) | |
| static inline sp_ActionDispatch_Session *sp_ActionDispatch_Session_new(sp_RbVal lv_other) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_other); | |
| sp_ActionDispatch_Session *self = SP_POOL_NEW(ActionDispatch_Session, sp_ActionDispatch_Session_gc_scan); | |
| self->cls_id = 56LL; | |
| SP_GC_ROOT(self); | |
| self->iv_data = NULL; | |
| sp_StrArray * lv_keys = NULL; | |
| mrb_int lv_i = 0; | |
| const char * lv_k = (&("\xff")[1]); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT(lv_keys); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT_RBVAL(lv_other); | |
| self->iv_data = sp_StrPolyHash_new(); | |
| #line 15 "test/models/../../runtime/action_dispatch/session.rb" | |
| if (sp_poly_nil_p(lv_other)) { | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| #line 16 "test/models/../../runtime/action_dispatch/session.rb" | |
| sp_RbVal _t38 = lv_other; | |
| sp_StrArray * _t39 = NULL; | |
| if (_t38.tag == SP_TAG_OBJ) { | |
| if (_t38.cls_id == 55) _t39 = sp_ActionDispatch_Flash_keys((sp_ActionDispatch_Flash *)_t38.v.p); | |
| if (_t38.cls_id == 56) _t39 = sp_ActionDispatch_Session_keys((sp_ActionDispatch_Session *)_t38.v.p); | |
| } | |
| lv_keys = _t39; | |
| #line 17 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_i = 0LL; | |
| #line 18 "test/models/../../runtime/action_dispatch/session.rb" | |
| mrb_int _t40 = sp_StrArray_length(lv_keys); | |
| while ((lv_i < sp_StrArray_length(lv_keys))) { | |
| sp_redo_4: ; | |
| #line 19 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_k = sp_StrArray_get(lv_keys, lv_i); | |
| #line 20 "test/models/../../runtime/action_dispatch/session.rb" | |
| sp_RbVal _t41 = lv_other; | |
| sp_RbVal _t42 = sp_box_nil(); | |
| if (_t41.tag == SP_TAG_OBJ) { | |
| if (_t41.cls_id == 55) _t42 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t41.v.p, sp_box_str(lv_k))); | |
| if (_t41.cls_id == 56) _t42 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t41.v.p, sp_box_str(lv_k)); | |
| if (_t41.cls_id == 78) _t42 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t41.v.p, sp_box_str(lv_k)); | |
| if (_t41.cls_id == 79) _t42 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t41.v.p, sp_box_str(lv_k)); | |
| if (_t41.cls_id == 80) _t42 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t41.v.p, sp_box_str(lv_k)); | |
| if (_t41.cls_id == 81) _t42 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t41.v.p, sp_box_str(lv_k)); | |
| if (_t41.cls_id == 82) _t42 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t41.v.p, sp_box_str(lv_k)); | |
| if (_t41.cls_id == 83) _t42 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t41.v.p, sp_box_str(lv_k)); | |
| if (_t41.cls_id == SP_BUILTIN_STR_INT_HASH) _t42 = sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t41.v.p, lv_k)); | |
| if (_t41.cls_id == SP_BUILTIN_STR_STR_HASH) _t42 = sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t41.v.p, lv_k)); | |
| if (_t41.cls_id == SP_BUILTIN_STR_POLY_HASH) _t42 = sp_StrPolyHash_get((sp_StrPolyHash *)_t41.v.p, lv_k); | |
| } | |
| lv_v = _t42; | |
| #line 21 "test/models/../../runtime/action_dispatch/session.rb" | |
| if (sp_gc_is_frozen(self->iv_data)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(self->iv_data, lv_k, lv_v); | |
| #line 22 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_i += 1LL; | |
| } | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionDispatch_Session_initialize(sp_ActionDispatch_Session *self, sp_RbVal lv_other) { | |
| SP_GC_SAVE(); | |
| sp_StrArray * lv_keys = NULL; | |
| mrb_int lv_i = 0; | |
| const char * lv_k = (&("\xff")[1]); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT(lv_keys); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT_RBVAL(lv_other); | |
| #line 14 "test/models/../../runtime/action_dispatch/session.rb" | |
| self->iv_data = sp_StrPolyHash_new(); | |
| #line 15 "test/models/../../runtime/action_dispatch/session.rb" | |
| if (sp_poly_nil_p(lv_other)) { | |
| SP_GC_RESTORE(); | |
| return; | |
| } | |
| #line 16 "test/models/../../runtime/action_dispatch/session.rb" | |
| sp_RbVal _t43 = lv_other; | |
| sp_StrArray * _t44 = NULL; | |
| if (_t43.tag == SP_TAG_OBJ) { | |
| if (_t43.cls_id == 55) _t44 = sp_ActionDispatch_Flash_keys((sp_ActionDispatch_Flash *)_t43.v.p); | |
| if (_t43.cls_id == 56) _t44 = sp_ActionDispatch_Session_keys((sp_ActionDispatch_Session *)_t43.v.p); | |
| } | |
| lv_keys = _t44; | |
| #line 17 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_i = 0LL; | |
| #line 18 "test/models/../../runtime/action_dispatch/session.rb" | |
| mrb_int _t45 = sp_StrArray_length(lv_keys); | |
| while ((lv_i < sp_StrArray_length(lv_keys))) { | |
| sp_redo_5: ; | |
| #line 19 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_k = sp_StrArray_get(lv_keys, lv_i); | |
| #line 20 "test/models/../../runtime/action_dispatch/session.rb" | |
| sp_RbVal _t46 = lv_other; | |
| sp_RbVal _t47 = sp_box_nil(); | |
| if (_t46.tag == SP_TAG_OBJ) { | |
| if (_t46.cls_id == 55) _t47 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t46.v.p, sp_box_str(lv_k))); | |
| if (_t46.cls_id == 56) _t47 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 78) _t47 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 79) _t47 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 80) _t47 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 81) _t47 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 82) _t47 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == 83) _t47 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t46.v.p, sp_box_str(lv_k)); | |
| if (_t46.cls_id == SP_BUILTIN_STR_INT_HASH) _t47 = sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t46.v.p, lv_k)); | |
| if (_t46.cls_id == SP_BUILTIN_STR_STR_HASH) _t47 = sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t46.v.p, lv_k)); | |
| if (_t46.cls_id == SP_BUILTIN_STR_POLY_HASH) _t47 = sp_StrPolyHash_get((sp_StrPolyHash *)_t46.v.p, lv_k); | |
| } | |
| lv_v = _t47; | |
| #line 21 "test/models/../../runtime/action_dispatch/session.rb" | |
| if (sp_gc_is_frozen(self->iv_data)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(self->iv_data, lv_k, lv_v); | |
| #line 22 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_i += 1LL; | |
| } | |
| } | |
| static sp_RbVal sp_ActionDispatch_Session__aref(sp_ActionDispatch_Session *self, sp_RbVal lv_key) { | |
| SP_GC_SAVE(); | |
| const char * lv_k = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT(self); | |
| #line 27 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_k = sp_poly_to_s(lv_key); | |
| #line 28 "test/models/../../runtime/action_dispatch/session.rb" | |
| if (sp_StrPolyHash_has_key(self->iv_data, lv_k)) { | |
| sp_RbVal _t48 = sp_StrPolyHash_get(self->iv_data, lv_k); | |
| SP_GC_RESTORE(); | |
| return _t48; | |
| } | |
| #line 29 "test/models/../../runtime/action_dispatch/session.rb" | |
| sp_RbVal _t49 = ((void)(0), sp_box_nil()); | |
| SP_GC_RESTORE(); | |
| return _t49; | |
| return sp_box_nil(); | |
| } | |
| static sp_RbVal sp_ActionDispatch_Session__aset(sp_ActionDispatch_Session *self, sp_RbVal lv_key, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 33 "test/models/../../runtime/action_dispatch/session.rb" | |
| if (sp_gc_is_frozen(self->iv_data)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(self->iv_data, sp_poly_to_s(lv_key), lv_value); | |
| #line 34 "test/models/../../runtime/action_dispatch/session.rb" | |
| sp_RbVal _t50 = lv_value; | |
| SP_GC_RESTORE(); | |
| return _t50; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_ActionDispatch_Session_fetch(sp_ActionDispatch_Session *self, const char * lv_key, sp_RbVal lv_default) { | |
| SP_GC_SAVE(); | |
| const char * lv_k = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT(lv_key); | |
| SP_GC_ROOT_RBVAL(lv_default); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_key); | |
| #line 38 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_k = lv_key; | |
| #line 39 "test/models/../../runtime/action_dispatch/session.rb" | |
| if (sp_StrPolyHash_has_key(self->iv_data, lv_k)) { | |
| sp_RbVal _t51 = sp_StrPolyHash_get(self->iv_data, lv_k); | |
| SP_GC_RESTORE(); | |
| return _t51; | |
| } | |
| #line 40 "test/models/../../runtime/action_dispatch/session.rb" | |
| sp_RbVal _t52 = lv_default; | |
| SP_GC_RESTORE(); | |
| return _t52; | |
| return sp_box_nil(); | |
| } | |
| static mrb_bool sp_ActionDispatch_Session_key_p(sp_ActionDispatch_Session *self, sp_RbVal lv_key) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT(self); | |
| #line 44 "test/models/../../runtime/action_dispatch/session.rb" | |
| return sp_StrPolyHash_has_key(self->iv_data, sp_poly_to_s(lv_key)); | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActionDispatch_Session_has_key_p(sp_ActionDispatch_Session *self, sp_RbVal lv_key) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT(self); | |
| #line 48 "test/models/../../runtime/action_dispatch/session.rb" | |
| return sp_StrPolyHash_has_key(self->iv_data, sp_poly_to_s(lv_key)); | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActionDispatch_Session_include_p(sp_ActionDispatch_Session *self, sp_RbVal lv_key) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT(self); | |
| #line 52 "test/models/../../runtime/action_dispatch/session.rb" | |
| return sp_StrPolyHash_has_key(self->iv_data, sp_poly_to_s(lv_key)); | |
| return FALSE; | |
| } | |
| static sp_RbVal sp_ActionDispatch_Session_delete(sp_ActionDispatch_Session *self, sp_RbVal lv_key) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_key); | |
| SP_GC_ROOT(self); | |
| #line 56 "test/models/../../runtime/action_dispatch/session.rb" | |
| ({ sp_raise_cls("NoMethodError", "undefined method 'delete' for str_poly_hash"); (mrb_int)0; }); | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static mrb_int sp_ActionDispatch_Session_length(sp_ActionDispatch_Session *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 60 "test/models/../../runtime/action_dispatch/session.rb" | |
| return sp_StrPolyHash_length(self->iv_data); | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActionDispatch_Session_size(sp_ActionDispatch_Session *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 64 "test/models/../../runtime/action_dispatch/session.rb" | |
| return sp_StrPolyHash_length(self->iv_data); | |
| return 0; | |
| } | |
| static mrb_bool sp_ActionDispatch_Session_empty_p(sp_ActionDispatch_Session *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 68 "test/models/../../runtime/action_dispatch/session.rb" | |
| return (sp_StrPolyHash_length(self->iv_data) == 0); | |
| return FALSE; | |
| } | |
| static sp_StrArray * sp_ActionDispatch_Session_keys(sp_ActionDispatch_Session *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 72 "test/models/../../runtime/action_dispatch/session.rb" | |
| return sp_StrPolyHash_keys(self->iv_data); | |
| return NULL; | |
| } | |
| static sp_PolyArray * sp_ActionDispatch_Session_values(sp_ActionDispatch_Session *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 76 "test/models/../../runtime/action_dispatch/session.rb" | |
| return sp_StrPolyHash_values(self->iv_data); | |
| return NULL; | |
| } | |
| static sp_ActionDispatch_Session * sp_ActionDispatch_Session_each(sp_ActionDispatch_Session *self, void (*_block)(const char *, sp_RbVal, void*), void *_benv) { | |
| SP_GC_SAVE(); | |
| sp_StrArray * lv_keys = NULL; | |
| mrb_int lv_i = 0; | |
| const char * lv_k = (&("\xff")[1]); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT(lv_keys); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT(self); | |
| #line 80 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_keys = sp_StrPolyHash_keys(self->iv_data); | |
| #line 81 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_i = 0LL; | |
| #line 82 "test/models/../../runtime/action_dispatch/session.rb" | |
| mrb_int _t53 = sp_StrArray_length(lv_keys); | |
| while ((lv_i < sp_StrArray_length(lv_keys))) { | |
| sp_redo_6: ; | |
| #line 83 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_k = sp_StrArray_get(lv_keys, lv_i); | |
| #line 84 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_v = sp_StrPolyHash_get(self->iv_data, lv_k); | |
| #line 85 "test/models/../../runtime/action_dispatch/session.rb" | |
| if (_block) _block(lv_k, lv_v, _benv); | |
| #line 86 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_i += 1LL; | |
| } | |
| #line 88 "test/models/../../runtime/action_dispatch/session.rb" | |
| return self; | |
| return NULL; | |
| } | |
| static inline sp_StrPolyHash * sp_ActionDispatch_Session_to_h(sp_ActionDispatch_Session *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 92 "test/models/../../runtime/action_dispatch/session.rb" | |
| return self->iv_data; | |
| return NULL; | |
| } | |
| static inline sp_ActionDispatch_Session * sp_ActionDispatch_Session_merge(sp_ActionDispatch_Session *self, sp_StrPolyHash * lv_other) { | |
| SP_GC_SAVE(); | |
| sp_ActionDispatch_Session * lv_result = NULL; | |
| const char * lv_k = (&("\xff")[1]); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| SP_GC_ROOT(lv_result); | |
| SP_GC_ROOT(lv_k); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| SP_GC_ROOT(lv_other); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_other); | |
| #line 96 "test/models/../../runtime/action_dispatch/session.rb" | |
| lv_result = sp_ActionDispatch_Session_new(sp_box_obj((void *)(sp_ActionDispatch_Session_to_h(self)), SP_BUILTIN_STR_POLY_HASH)); | |
| #line 97 "test/models/../../runtime/action_dispatch/session.rb" | |
| for (mrb_int _t54 = 0; _t54 < lv_other->len; _t54++) { | |
| lv_k = lv_other->order[_t54]; | |
| lv_v = sp_StrPolyHash_get(lv_other, lv_other->order[_t54]); | |
| sp_redo_7: ; | |
| #line 98 "test/models/../../runtime/action_dispatch/session.rb" | |
| sp_ActionDispatch_Session__aset(lv_result, sp_box_str(lv_k), lv_v); | |
| } | |
| #line 100 "test/models/../../runtime/action_dispatch/session.rb" | |
| return (sp_ActionDispatch_Session *)lv_result; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(ActionView_Slots) | |
| static inline sp_ActionView_Slots *sp_ActionView_Slots_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ActionView_Slots *self = SP_POOL_NEW(ActionView_Slots, sp_ActionView_Slots_gc_scan); | |
| self->cls_id = 57LL; | |
| SP_GC_ROOT(self); | |
| self->iv_slots = NULL; | |
| self->iv_slots = sp_SymStrHash_new(); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionView_Slots_initialize(sp_ActionView_Slots *self) { | |
| #line 20 "test/models/../../runtime/action_controller/../action_view/slots.rb" | |
| self->iv_slots = sp_SymStrHash_new(); | |
| } | |
| static inline mrb_int sp_ActionView_Slots_reset_bang(sp_ActionView_Slots *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 24 "test/models/../../runtime/action_controller/../action_view/slots.rb" | |
| self->iv_slots = sp_SymStrHash_new(); | |
| #line 25 "test/models/../../runtime/action_controller/../action_view/slots.rb" | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActionView_Slots_set(sp_ActionView_Slots *self, sp_sym lv_slot, const char * lv_value) { | |
| (void)lv_slot; | |
| (void)lv_value; | |
| return 0; | |
| } | |
| static inline const char * sp_ActionView_Slots_get(sp_ActionView_Slots *self, sp_sym lv_slot) { | |
| (void)lv_slot; | |
| return NULL; | |
| } | |
| static inline const char * sp_ActionView_Slots_bracket_get(sp_ActionView_Slots *self, sp_sym lv_slot) { | |
| (void)lv_slot; | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_Slots_get_yield(sp_ActionView_Slots *self) { | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_ActionView_Slots_set_yield(sp_ActionView_Slots *self, const char * lv_content) { | |
| (void)lv_content; | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(ActionController_Base) | |
| static inline sp_ActionController_Base *sp_ActionController_Base_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ActionController_Base *self = SP_POOL_NEW(ActionController_Base, sp_ActionController_Base_gc_scan); | |
| self->cls_id = 58LL; | |
| SP_GC_ROOT(self); | |
| self->iv_params = sp_box_nil(); | |
| self->iv_session = NULL; | |
| self->iv_flash = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_location = NULL; | |
| self->iv_content_type = NULL; | |
| self->iv_request_method = NULL; | |
| self->iv_request_path = NULL; | |
| self->iv_params = sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH); | |
| self->iv_session = sp_ActionDispatch_Session_new(((void)(0), sp_box_nil())); | |
| self->iv_flash = sp_box_obj(sp_ActionDispatch_Flash_new(((void)(0), sp_box_nil())), 55); | |
| self->iv_status = 200LL; | |
| self->iv_body = sp_box_str((&("\xff" "")[1])); | |
| self->iv_location = 0; | |
| self->iv_request_format = SPS_html; | |
| self->iv_content_type = (&("\xff" "text/html; charset=utf-8")[1]); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionController_Base_initialize(sp_ActionController_Base *self) { | |
| #line 40 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_params = sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH); | |
| #line 41 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_session = sp_ActionDispatch_Session_new(((void)(0), sp_box_nil())); | |
| #line 42 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_flash = sp_box_obj(sp_ActionDispatch_Flash_new(((void)(0), sp_box_nil())), 55); | |
| #line 43 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_status = 200LL; | |
| #line 44 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_body = sp_box_str((&("\xff" "")[1])); | |
| #line 45 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_location = 0; | |
| #line 46 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_request_format = SPS_html; | |
| #line 47 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_content_type = (&("\xff" "text/html; charset=utf-8")[1]); | |
| } | |
| static inline mrb_int sp_ActionController_Base_process_action(sp_ActionController_Base *self, sp_sym lv__action_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 54 "test/models/../../runtime/action_controller/base.rb" | |
| sp_raise_cls("NotImplementedError", (&("\xff" "process_action must be overridden by subclass")[1])); | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_ActionController_Base_render(sp_ActionController_Base *self, const char * lv_body, sp_sym lv_status, const char * lv_content_type, const char * lv_location) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_body); | |
| SP_GC_ROOT(lv_content_type); | |
| SP_GC_ROOT(lv_location); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_body); | |
| SP_GC_ROOT(lv_content_type); | |
| SP_GC_ROOT(lv_location); | |
| #line 67 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_body = sp_box_str(lv_body); | |
| #line 68 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_status = sp_ActionController_Base_resolve_status(self, lv_status); | |
| #line 69 "test/models/../../runtime/action_controller/base.rb" | |
| if (!((lv_content_type == NULL))) { | |
| self->iv_content_type = lv_content_type; | |
| } | |
| #line 70 "test/models/../../runtime/action_controller/base.rb" | |
| if (!((lv_location == NULL))) { | |
| self->iv_location = lv_location; | |
| } | |
| #line 71 "test/models/../../runtime/action_controller/base.rb" | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_ActionController_Base_redirect_to(sp_ActionController_Base *self, const char * lv_path, const char * lv_notice, const char * lv_alert, sp_sym lv_status) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| #line 79 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_location = lv_path; | |
| #line 80 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_status = sp_ActionController_Base_resolve_status(self, lv_status); | |
| #line 81 "test/models/../../runtime/action_controller/base.rb" | |
| if (!((lv_notice == NULL))) { | |
| sp_RbVal _t55 = sp_box_nullable_str(lv_notice); | |
| sp_RbVal _t56 = self->iv_flash; | |
| if (_t56.cls_id == SP_BUILTIN_SYM_INT_HASH) sp_SymIntHash_set((sp_SymIntHash *)_t56.v.p, (sp_sym)(SPS_notice), _t55.v.i); | |
| else if (_t56.cls_id == SP_BUILTIN_SYM_POLY_HASH) sp_SymPolyHash_set((sp_SymPolyHash *)_t56.v.p, (sp_sym)(SPS_notice), _t55); | |
| } | |
| #line 82 "test/models/../../runtime/action_controller/base.rb" | |
| if (!((lv_alert == NULL))) { | |
| sp_RbVal _t57 = sp_box_nullable_str(lv_alert); | |
| sp_RbVal _t58 = self->iv_flash; | |
| if (_t58.cls_id == SP_BUILTIN_SYM_INT_HASH) sp_SymIntHash_set((sp_SymIntHash *)_t58.v.p, (sp_sym)(SPS_alert), _t57.v.i); | |
| else if (_t58.cls_id == SP_BUILTIN_SYM_POLY_HASH) sp_SymPolyHash_set((sp_SymPolyHash *)_t58.v.p, (sp_sym)(SPS_alert), _t57); | |
| } | |
| #line 83 "test/models/../../runtime/action_controller/base.rb" | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_ActionController_Base_head(sp_ActionController_Base *self, sp_sym lv_status, const char * lv_content_type) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_content_type); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_content_type); | |
| #line 94 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_status = sp_ActionController_Base_resolve_status(self, lv_status); | |
| #line 95 "test/models/../../runtime/action_controller/base.rb" | |
| self->iv_body = sp_box_str((&("\xff" "")[1])); | |
| #line 96 "test/models/../../runtime/action_controller/base.rb" | |
| if (!((lv_content_type == NULL))) { | |
| self->iv_content_type = lv_content_type; | |
| } | |
| #line 97 "test/models/../../runtime/action_controller/base.rb" | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActionController_Base_resolve_status(sp_ActionController_Base *self, sp_sym lv_s) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 104 "test/models/../../runtime/action_controller/base.rb" | |
| return (sp_SymIntHash_has_key(cst_ActionController_STATUS_CODES, lv_s) ? sp_SymIntHash_get(cst_ActionController_STATUS_CODES, lv_s) : 200LL); | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(Broadcasts_SeedTransport) | |
| static inline sp_Broadcasts_SeedTransport *sp_Broadcasts_SeedTransport_new(void) { | |
| SP_GC_SAVE(); | |
| sp_Broadcasts_SeedTransport *self = SP_POOL_NEW(Broadcasts_SeedTransport, NULL); | |
| self->cls_id = 59LL; | |
| SP_GC_ROOT(self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline mrb_int sp_Broadcasts_SeedTransport_broadcast(sp_Broadcasts_SeedTransport *self, const char * lv_stream, const char * lv_fragment) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_fragment); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_fragment); | |
| #line 26 "test/models/../../runtime/broadcasts.rb" | |
| return 0; | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(ActionDispatch_IntegrationTest) | |
| static inline sp_ActionDispatch_IntegrationTest *sp_ActionDispatch_IntegrationTest_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ActionDispatch_IntegrationTest *self = SP_POOL_NEW(ActionDispatch_IntegrationTest, sp_ActionDispatch_IntegrationTest_gc_scan); | |
| self->cls_id = 60LL; | |
| SP_GC_ROOT(self); | |
| self->iv___session = NULL; | |
| self->iv___flash = sp_box_nil(); | |
| self->iv___response = NULL; | |
| sp_TestBase_initialize((sp_TestBase *)self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_get(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_RbVal lv_params) { | |
| (void)lv_path; | |
| (void)lv_params; | |
| return NULL; | |
| } | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_post(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_RbVal lv_params) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT_RBVAL(lv_params); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_path); | |
| #line 196 "test/models/../test_helper.rb" | |
| return sp_ActionDispatch_IntegrationTest_dispatch_request(self, (&("\xff" "POST")[1]), lv_path, lv_params); | |
| return NULL; | |
| } | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_patch(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_RbVal lv_params) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT_RBVAL(lv_params); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_path); | |
| #line 200 "test/models/../test_helper.rb" | |
| return sp_ActionDispatch_IntegrationTest_dispatch_request(self, (&("\xff" "PATCH")[1]), lv_path, lv_params); | |
| return NULL; | |
| } | |
| static inline sp_ActionResponse * sp_ActionDispatch_IntegrationTest_delete(sp_ActionDispatch_IntegrationTest *self, const char * lv_path, sp_RbVal lv_params) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT_RBVAL(lv_params); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_path); | |
| #line 204 "test/models/../test_helper.rb" | |
| return sp_ActionDispatch_IntegrationTest_dispatch_request(self, (&("\xff" "DELETE")[1]), lv_path, lv_params); | |
| return NULL; | |
| } | |
| static sp_ActionResponse * sp_ActionDispatch_IntegrationTest_dispatch_request(sp_ActionDispatch_IntegrationTest *self, const char * lv_method, const char * lv_path, sp_RbVal lv_params) { | |
| SP_GC_SAVE(); | |
| sp_ActionDispatch_Router_MatchResult * lv_matched = NULL; | |
| sp_RbVal lv_controller = sp_box_nil(); | |
| sp_StrPolyHash * lv_merged = NULL; | |
| mrb_int lv_k = 0; | |
| mrb_int lv_v = 0; | |
| SP_GC_ROOT(lv_matched); | |
| SP_GC_ROOT_RBVAL(lv_controller); | |
| SP_GC_ROOT(lv_merged); | |
| SP_GC_ROOT(lv_method); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT_RBVAL(lv_params); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_method); | |
| SP_GC_ROOT(lv_path); | |
| #line 208 "test/models/../test_helper.rb" | |
| #line 209 "test/models/../test_helper.rb" | |
| sp_ActionView_ViewHelpers_cls_reset_slots_bang(); | |
| #line 210 "test/models/../test_helper.rb" | |
| lv_matched = sp_ActionDispatch_Router_cls_match((const char *)lv_method, (const char *)lv_path, sp_Routes_cls_table()); | |
| #line 211 "test/models/../test_helper.rb" | |
| if ((lv_matched == NULL)) { | |
| sp_raise(sp_sprintf("No route matches %s %s", lv_method, lv_path)); | |
| } | |
| #line 212 "test/models/../test_helper.rb" | |
| sp_RbVal _t59 = sp_box_nil(); | |
| sp_sym _t60 = lv_matched->iv_controller; | |
| if (_t60 == SPS_articles) { | |
| _t59 = sp_box_obj(sp_ArticlesController_new(), 71); | |
| } else if (_t60 == SPS_comments) { | |
| _t59 = sp_box_obj(sp_CommentsController_new(), 73); | |
| } | |
| lv_controller = _t59; | |
| #line 228 "test/models/../test_helper.rb" | |
| lv_merged = sp_ActionDispatch_IntegrationTest_stringify_keys(self, sp_box_nullable_obj((void *)(lv_matched->iv_path_params), SP_BUILTIN_STR_STR_HASH)); | |
| #line 229 "test/models/../test_helper.rb" | |
| sp_RbVal _t61 = lv_params; | |
| SP_GC_ROOT_RBVAL(_t61); | |
| if (_t61.tag == SP_TAG_OBJ) { | |
| mrb_int _t62_len = 0; | |
| if (_t61.cls_id == SP_BUILTIN_RANGE) _t62_len = ((sp_Range *)_t61.v.p)->last - ((sp_Range *)_t61.v.p)->first + 1; | |
| else if (_t61.cls_id == SP_BUILTIN_INT_ARRAY) _t62_len = sp_IntArray_length((sp_IntArray *)_t61.v.p); | |
| else if (_t61.cls_id == SP_BUILTIN_FLT_ARRAY) _t62_len = sp_FloatArray_length((sp_FloatArray *)_t61.v.p); | |
| else if (_t61.cls_id == SP_BUILTIN_STR_ARRAY) _t62_len = sp_StrArray_length((sp_StrArray *)_t61.v.p); | |
| else if (_t61.cls_id == SP_BUILTIN_SYM_ARRAY) _t62_len = sp_IntArray_length((sp_IntArray *)_t61.v.p); | |
| else if (_t61.cls_id == SP_BUILTIN_PTR_ARRAY) _t62_len = sp_PtrArray_length((sp_PtrArray *)_t61.v.p); | |
| else if (_t61.cls_id == SP_BUILTIN_POLY_ARRAY) _t62_len = sp_PolyArray_length((sp_PolyArray *)_t61.v.p); | |
| else if (_t61.cls_id == SP_BUILTIN_STR_INT_HASH) _t62_len = ((sp_StrIntHash *)_t61.v.p)->len; | |
| else if (_t61.cls_id == SP_BUILTIN_STR_STR_HASH) _t62_len = ((sp_StrStrHash *)_t61.v.p)->len; | |
| else if (_t61.cls_id == SP_BUILTIN_INT_STR_HASH) _t62_len = ((sp_IntStrHash *)_t61.v.p)->len; | |
| else if (_t61.cls_id == SP_BUILTIN_SYM_INT_HASH) _t62_len = ((sp_SymIntHash *)_t61.v.p)->len; | |
| else if (_t61.cls_id == SP_BUILTIN_SYM_STR_HASH) _t62_len = ((sp_SymStrHash *)_t61.v.p)->len; | |
| else if (_t61.cls_id == SP_BUILTIN_STR_POLY_HASH) _t62_len = ((sp_StrPolyHash *)_t61.v.p)->len; | |
| else if (_t61.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t62_len = ((sp_SymPolyHash *)_t61.v.p)->len; | |
| else if (_t61.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t62_len = ((sp_PolyPolyHash *)_t61.v.p)->len; | |
| for (mrb_int _t62 = 0; _t62 < _t62_len; _t62++) { | |
| sp_RbVal _t63 = sp_box_nil(); | |
| if (_t61.cls_id == SP_BUILTIN_RANGE) _t63 = sp_box_int(((sp_Range *)_t61.v.p)->first + _t62); | |
| else if (_t61.cls_id == SP_BUILTIN_INT_ARRAY) _t63 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t61.v.p, _t62)); | |
| else if (_t61.cls_id == SP_BUILTIN_FLT_ARRAY) _t63 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t61.v.p, _t62)); | |
| else if (_t61.cls_id == SP_BUILTIN_STR_ARRAY) _t63 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t61.v.p, _t62)); | |
| else if (_t61.cls_id == SP_BUILTIN_SYM_ARRAY) _t63 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t61.v.p, _t62)); | |
| else if (_t61.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t61.v.p, _t62); _t63 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t61.cls_id == SP_BUILTIN_POLY_ARRAY) _t63 = sp_PolyArray_get((sp_PolyArray *)_t61.v.p, _t62); | |
| else if (_t61.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t61.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t62])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t62]))); _t63 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t61.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t61.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t62])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t62]))); _t63 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t61.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t61.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t62])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t62]))); _t63 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t61.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t61.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t62])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t62]))); _t63 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t61.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t61.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t62])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t62]))); _t63 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t61.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t61.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t62])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t62])); _t63 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t61.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t61.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t62])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t62])); _t63 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t61.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t61.v.p; mrb_int _pk = _sh->order[_t62]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t63 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_k = sp_box_nil(); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| if (_t63.tag == SP_TAG_OBJ && _t63.cls_id == SP_BUILTIN_POLY_ARRAY) { | |
| sp_PolyArray *_pa = (sp_PolyArray *)_t63.v.p; | |
| if (sp_PolyArray_length(_pa) > 0) lv_k = sp_PolyArray_get(_pa, 0); | |
| if (sp_PolyArray_length(_pa) > 1) lv_v = sp_PolyArray_get(_pa, 1); | |
| } else if (_t63.tag == SP_TAG_OBJ && _t63.cls_id == SP_BUILTIN_INT_ARRAY) { | |
| sp_IntArray *_ia = (sp_IntArray *)_t63.v.p; | |
| if (sp_IntArray_length(_ia) > 0) lv_k = sp_box_int(sp_IntArray_get(_ia, 0)); | |
| if (sp_IntArray_length(_ia) > 1) lv_v = sp_box_int(sp_IntArray_get(_ia, 1)); | |
| } else { | |
| lv_k = _t63; | |
| } | |
| sp_redo_8: ; | |
| #line 230 "test/models/../test_helper.rb" | |
| sp_RbVal _t64 = lv_v; | |
| if ((_t64.tag == SP_TAG_OBJ && (_t64.cls_id == SP_BUILTIN_STR_INT_HASH || _t64.cls_id == SP_BUILTIN_STR_STR_HASH || _t64.cls_id == SP_BUILTIN_INT_STR_HASH || _t64.cls_id == SP_BUILTIN_SYM_INT_HASH || _t64.cls_id == SP_BUILTIN_SYM_STR_HASH || _t64.cls_id == SP_BUILTIN_STR_POLY_HASH || _t64.cls_id == SP_BUILTIN_SYM_POLY_HASH))) { | |
| #line 231 "test/models/../test_helper.rb" | |
| if (sp_gc_is_frozen(lv_merged)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(lv_merged, sp_poly_to_s(lv_k), sp_box_obj((void *)(sp_ActionDispatch_IntegrationTest_stringify_keys(self, lv_v)), SP_BUILTIN_STR_POLY_HASH)); | |
| } else { | |
| #line 233 "test/models/../test_helper.rb" | |
| if (sp_gc_is_frozen(lv_merged)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(lv_merged, sp_poly_to_s(lv_k), lv_v); | |
| } | |
| } | |
| } | |
| #line 236 "test/models/../test_helper.rb" | |
| sp_RbVal _t65 = lv_controller; | |
| sp_RbVal _t66 = sp_box_nil(); | |
| if (_t65.tag == SP_TAG_OBJ) { | |
| if (_t65.cls_id == 58) { ((sp_ActionController_Base *)_t65.v.p)->iv_params = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); _t66 = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); } | |
| if (_t65.cls_id == 64) { ((sp_ApplicationController *)_t65.v.p)->iv_params = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); _t66 = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); } | |
| if (_t65.cls_id == 71) { ((sp_ArticlesController *)_t65.v.p)->iv_params = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); _t66 = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); } | |
| if (_t65.cls_id == 73) { ((sp_CommentsController *)_t65.v.p)->iv_params = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); _t66 = sp_box_obj((void *)(lv_merged), SP_BUILTIN_STR_POLY_HASH); } | |
| } | |
| _t66; | |
| #line 237 "test/models/../test_helper.rb" | |
| sp_RbVal _t67 = lv_controller; | |
| if (!(self->iv___session)) { | |
| self->iv___session = sp_ActionDispatch_Session_new(((void)(0), sp_box_nil())); | |
| } | |
| sp_ActionDispatch_Session * _t68 = NULL; | |
| if (_t67.tag == SP_TAG_OBJ) { | |
| if (_t67.cls_id == 58) { ((sp_ActionController_Base *)_t67.v.p)->iv_session = self->iv___session; _t68 = self->iv___session; } | |
| if (_t67.cls_id == 64) { ((sp_ApplicationController *)_t67.v.p)->iv_session = self->iv___session; _t68 = self->iv___session; } | |
| if (_t67.cls_id == 71) { ((sp_ArticlesController *)_t67.v.p)->iv_session = self->iv___session; _t68 = self->iv___session; } | |
| if (_t67.cls_id == 73) { ((sp_CommentsController *)_t67.v.p)->iv_session = self->iv___session; _t68 = self->iv___session; } | |
| } | |
| _t68; | |
| #line 238 "test/models/../test_helper.rb" | |
| sp_RbVal _t69 = lv_controller; | |
| if ((self->iv___flash).tag == SP_TAG_NIL || ((self->iv___flash).tag == SP_TAG_BOOL && (self->iv___flash).v.i == 0)) { | |
| self->iv___flash = sp_box_obj(sp_ActionDispatch_Flash_new(((void)(0), sp_box_nil())), 55); | |
| } | |
| sp_RbVal _t70 = sp_box_nil(); | |
| if (_t69.tag == SP_TAG_OBJ) { | |
| if (_t69.cls_id == 58) { ((sp_ActionController_Base *)_t69.v.p)->iv_flash = self->iv___flash; _t70 = self->iv___flash; } | |
| if (_t69.cls_id == 64) { ((sp_ApplicationController *)_t69.v.p)->iv_flash = self->iv___flash; _t70 = self->iv___flash; } | |
| if (_t69.cls_id == 71) { ((sp_ArticlesController *)_t69.v.p)->iv_flash = self->iv___flash; _t70 = self->iv___flash; } | |
| if (_t69.cls_id == 73) { ((sp_CommentsController *)_t69.v.p)->iv_flash = self->iv___flash; _t70 = self->iv___flash; } | |
| } | |
| _t70; | |
| #line 239 "test/models/../test_helper.rb" | |
| sp_RbVal _t71 = lv_controller; | |
| const char * _t72 = (&("\xff")[1]); | |
| if (_t71.tag == SP_TAG_OBJ) { | |
| if (_t71.cls_id == 58) { ((sp_ActionController_Base *)_t71.v.p)->iv_request_method = lv_method; _t72 = lv_method; } | |
| if (_t71.cls_id == 64) { ((sp_ApplicationController *)_t71.v.p)->iv_request_method = lv_method; _t72 = lv_method; } | |
| if (_t71.cls_id == 71) { ((sp_ArticlesController *)_t71.v.p)->iv_request_method = lv_method; _t72 = lv_method; } | |
| if (_t71.cls_id == 73) { ((sp_CommentsController *)_t71.v.p)->iv_request_method = lv_method; _t72 = lv_method; } | |
| } | |
| _t72; | |
| #line 240 "test/models/../test_helper.rb" | |
| sp_RbVal _t73 = lv_controller; | |
| const char * _t74 = (&("\xff")[1]); | |
| if (_t73.tag == SP_TAG_OBJ) { | |
| if (_t73.cls_id == 58) { ((sp_ActionController_Base *)_t73.v.p)->iv_request_path = lv_path; _t74 = lv_path; } | |
| if (_t73.cls_id == 64) { ((sp_ApplicationController *)_t73.v.p)->iv_request_path = lv_path; _t74 = lv_path; } | |
| if (_t73.cls_id == 71) { ((sp_ArticlesController *)_t73.v.p)->iv_request_path = lv_path; _t74 = lv_path; } | |
| if (_t73.cls_id == 73) { ((sp_CommentsController *)_t73.v.p)->iv_request_path = lv_path; _t74 = lv_path; } | |
| } | |
| _t74; | |
| #line 241 "test/models/../test_helper.rb" | |
| sp_RbVal _t75 = lv_controller; | |
| mrb_int _t76 = 0; | |
| if (_t75.tag == SP_TAG_OBJ) { | |
| if (_t75.cls_id == 58) _t76 = sp_ActionController_Base_process_action((sp_ActionController_Base *)_t75.v.p, lv_matched->iv_action); | |
| if (_t75.cls_id == 64) _t76 = sp_ActionController_Base_process_action((sp_ActionController_Base *)_t75.v.p, lv_matched->iv_action); | |
| if (_t75.cls_id == 71) _t76 = sp_ArticlesController_process_action((sp_ArticlesController *)_t75.v.p, lv_matched->iv_action); | |
| if (_t75.cls_id == 73) _t76 = sp_CommentsController_process_action((sp_CommentsController *)_t75.v.p, lv_matched->iv_action); | |
| } | |
| _t76; | |
| #line 242 "test/models/../test_helper.rb" | |
| sp_RbVal _t77 = lv_controller; | |
| sp_RbVal _t78 = sp_box_nil(); | |
| if (_t77.tag == SP_TAG_OBJ) { | |
| if (_t77.cls_id == 58) _t78 = ((sp_ActionController_Base *)_t77.v.p)->iv_flash; | |
| if (_t77.cls_id == 64) _t78 = ((sp_ApplicationController *)_t77.v.p)->iv_flash; | |
| if (_t77.cls_id == 71) _t78 = ((sp_ArticlesController *)_t77.v.p)->iv_flash; | |
| if (_t77.cls_id == 73) _t78 = ((sp_CommentsController *)_t77.v.p)->iv_flash; | |
| if (_t77.cls_id == 74) _t78 = ((sp_ActionResponse *)_t77.v.p)->iv_flash; | |
| } | |
| self->iv___flash = _t78; | |
| #line 243 "test/models/../test_helper.rb" | |
| sp_RbVal _t79 = lv_controller; | |
| mrb_int _t80 = 0; | |
| if (_t79.tag == SP_TAG_OBJ) { | |
| if (_t79.cls_id == 58) _t80 = ((sp_ActionController_Base *)_t79.v.p)->iv_status; | |
| if (_t79.cls_id == 64) _t80 = ((sp_ApplicationController *)_t79.v.p)->iv_status; | |
| if (_t79.cls_id == 71) _t80 = ((sp_ArticlesController *)_t79.v.p)->iv_status; | |
| if (_t79.cls_id == 73) _t80 = ((sp_CommentsController *)_t79.v.p)->iv_status; | |
| if (_t79.cls_id == 74) _t80 = ((sp_ActionResponse *)_t79.v.p)->iv_status; | |
| } | |
| sp_RbVal _t81 = lv_controller; | |
| sp_RbVal _t82 = sp_box_nil(); | |
| if (_t81.tag == SP_TAG_OBJ) { | |
| if (_t81.cls_id == 58) _t82 = ((sp_ActionController_Base *)_t81.v.p)->iv_body; | |
| if (_t81.cls_id == 64) _t82 = ((sp_ApplicationController *)_t81.v.p)->iv_body; | |
| if (_t81.cls_id == 66) _t82 = sp_box_str(sp_CommentRow_body((sp_CommentRow *)_t81.v.p)); | |
| if (_t81.cls_id == 67) _t82 = sp_Comment_body((sp_Comment *)_t81.v.p); | |
| if (_t81.cls_id == 68) _t82 = sp_box_str(sp_ArticleRow_body((sp_ArticleRow *)_t81.v.p)); | |
| if (_t81.cls_id == 70) _t82 = sp_ArticleParams_body((sp_ArticleParams *)_t81.v.p); | |
| if (_t81.cls_id == 71) _t82 = ((sp_ArticlesController *)_t81.v.p)->iv_body; | |
| if (_t81.cls_id == 72) _t82 = sp_CommentParams_body((sp_CommentParams *)_t81.v.p); | |
| if (_t81.cls_id == 73) _t82 = ((sp_CommentsController *)_t81.v.p)->iv_body; | |
| if (_t81.cls_id == 74) _t82 = ((sp_ActionResponse *)_t81.v.p)->iv_body; | |
| if (_t81.cls_id == 78) _t82 = sp_Article__implicit_6872_body((sp_Article__implicit_6872 *)_t81.v.p); | |
| if (_t81.cls_id == 79) _t82 = sp_Article__implicit_6906_body((sp_Article__implicit_6906 *)_t81.v.p); | |
| if (_t81.cls_id == 80) _t82 = sp_Article__implicit_7484_body((sp_Article__implicit_7484 *)_t81.v.p); | |
| if (_t81.cls_id == 81) _t82 = sp_Article__implicit_7995_body((sp_Article__implicit_7995 *)_t81.v.p); | |
| if (_t81.cls_id == 82) _t82 = sp_Article__implicit_9355_body((sp_Article__implicit_9355 *)_t81.v.p); | |
| if (_t81.cls_id == 83) _t82 = sp_Article__implicit_9372_body((sp_Article__implicit_9372 *)_t81.v.p); | |
| } | |
| sp_RbVal _t83 = lv_controller; | |
| sp_RbVal _t84 = sp_box_nil(); | |
| if (_t83.tag == SP_TAG_OBJ) { | |
| if (_t83.cls_id == 58) _t84 = sp_box_nullable_str(((sp_ActionController_Base *)_t83.v.p)->iv_location); | |
| if (_t83.cls_id == 64) _t84 = sp_box_nullable_str(((sp_ApplicationController *)_t83.v.p)->iv_location); | |
| if (_t83.cls_id == 71) _t84 = sp_box_nullable_str(((sp_ArticlesController *)_t83.v.p)->iv_location); | |
| if (_t83.cls_id == 73) _t84 = sp_box_nullable_str(((sp_CommentsController *)_t83.v.p)->iv_location); | |
| if (_t83.cls_id == 74) _t84 = ((sp_ActionResponse *)_t83.v.p)->iv_location; | |
| } | |
| sp_RbVal _t85 = lv_controller; | |
| sp_RbVal _t86 = sp_box_nil(); | |
| if (_t85.tag == SP_TAG_OBJ) { | |
| if (_t85.cls_id == 58) _t86 = ((sp_ActionController_Base *)_t85.v.p)->iv_flash; | |
| if (_t85.cls_id == 64) _t86 = ((sp_ApplicationController *)_t85.v.p)->iv_flash; | |
| if (_t85.cls_id == 71) _t86 = ((sp_ArticlesController *)_t85.v.p)->iv_flash; | |
| if (_t85.cls_id == 73) _t86 = ((sp_CommentsController *)_t85.v.p)->iv_flash; | |
| if (_t85.cls_id == 74) _t86 = ((sp_ActionResponse *)_t85.v.p)->iv_flash; | |
| } | |
| self->iv___response = sp_ActionResponse_new(_t80, (_t82).v.s, (_t84).v.s, ((sp_ActionDispatch_Flash *)(_t86).v.p)); | |
| #line 249 "test/models/../test_helper.rb" | |
| return self->iv___response; | |
| return NULL; | |
| } | |
| static inline sp_StrPolyHash * sp_ActionDispatch_IntegrationTest_stringify_keys(sp_ActionDispatch_IntegrationTest *self, sp_RbVal lv_hash) { | |
| SP_GC_SAVE(); | |
| sp_StrPolyHash * lv_out = NULL; | |
| mrb_int lv_k = 0; | |
| mrb_int lv_v = 0; | |
| SP_GC_ROOT(lv_out); | |
| SP_GC_ROOT_RBVAL(lv_hash); | |
| SP_GC_ROOT(self); | |
| #line 264 "test/models/../test_helper.rb" | |
| lv_out = sp_StrPolyHash_new(); | |
| #line 265 "test/models/../test_helper.rb" | |
| sp_RbVal _t87 = lv_hash; | |
| SP_GC_ROOT_RBVAL(_t87); | |
| if (_t87.tag == SP_TAG_OBJ) { | |
| mrb_int _t88_len = 0; | |
| if (_t87.cls_id == SP_BUILTIN_RANGE) _t88_len = ((sp_Range *)_t87.v.p)->last - ((sp_Range *)_t87.v.p)->first + 1; | |
| else if (_t87.cls_id == SP_BUILTIN_INT_ARRAY) _t88_len = sp_IntArray_length((sp_IntArray *)_t87.v.p); | |
| else if (_t87.cls_id == SP_BUILTIN_FLT_ARRAY) _t88_len = sp_FloatArray_length((sp_FloatArray *)_t87.v.p); | |
| else if (_t87.cls_id == SP_BUILTIN_STR_ARRAY) _t88_len = sp_StrArray_length((sp_StrArray *)_t87.v.p); | |
| else if (_t87.cls_id == SP_BUILTIN_SYM_ARRAY) _t88_len = sp_IntArray_length((sp_IntArray *)_t87.v.p); | |
| else if (_t87.cls_id == SP_BUILTIN_PTR_ARRAY) _t88_len = sp_PtrArray_length((sp_PtrArray *)_t87.v.p); | |
| else if (_t87.cls_id == SP_BUILTIN_POLY_ARRAY) _t88_len = sp_PolyArray_length((sp_PolyArray *)_t87.v.p); | |
| else if (_t87.cls_id == SP_BUILTIN_STR_INT_HASH) _t88_len = ((sp_StrIntHash *)_t87.v.p)->len; | |
| else if (_t87.cls_id == SP_BUILTIN_STR_STR_HASH) _t88_len = ((sp_StrStrHash *)_t87.v.p)->len; | |
| else if (_t87.cls_id == SP_BUILTIN_INT_STR_HASH) _t88_len = ((sp_IntStrHash *)_t87.v.p)->len; | |
| else if (_t87.cls_id == SP_BUILTIN_SYM_INT_HASH) _t88_len = ((sp_SymIntHash *)_t87.v.p)->len; | |
| else if (_t87.cls_id == SP_BUILTIN_SYM_STR_HASH) _t88_len = ((sp_SymStrHash *)_t87.v.p)->len; | |
| else if (_t87.cls_id == SP_BUILTIN_STR_POLY_HASH) _t88_len = ((sp_StrPolyHash *)_t87.v.p)->len; | |
| else if (_t87.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t88_len = ((sp_SymPolyHash *)_t87.v.p)->len; | |
| else if (_t87.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t88_len = ((sp_PolyPolyHash *)_t87.v.p)->len; | |
| for (mrb_int _t88 = 0; _t88 < _t88_len; _t88++) { | |
| sp_RbVal _t89 = sp_box_nil(); | |
| if (_t87.cls_id == SP_BUILTIN_RANGE) _t89 = sp_box_int(((sp_Range *)_t87.v.p)->first + _t88); | |
| else if (_t87.cls_id == SP_BUILTIN_INT_ARRAY) _t89 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t87.v.p, _t88)); | |
| else if (_t87.cls_id == SP_BUILTIN_FLT_ARRAY) _t89 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t87.v.p, _t88)); | |
| else if (_t87.cls_id == SP_BUILTIN_STR_ARRAY) _t89 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t87.v.p, _t88)); | |
| else if (_t87.cls_id == SP_BUILTIN_SYM_ARRAY) _t89 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t87.v.p, _t88)); | |
| else if (_t87.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t87.v.p, _t88); _t89 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t87.cls_id == SP_BUILTIN_POLY_ARRAY) _t89 = sp_PolyArray_get((sp_PolyArray *)_t87.v.p, _t88); | |
| else if (_t87.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t87.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t88])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t88]))); _t89 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t87.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t87.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t88])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t88]))); _t89 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t87.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t87.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t88])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t88]))); _t89 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t87.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t87.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t88])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t88]))); _t89 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t87.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t87.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t88])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t88]))); _t89 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t87.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t87.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t88])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t88])); _t89 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t87.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t87.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t88])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t88])); _t89 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t87.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t87.v.p; mrb_int _pk = _sh->order[_t88]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t89 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_k = sp_box_nil(); | |
| sp_RbVal lv_v = sp_box_nil(); | |
| if (_t89.tag == SP_TAG_OBJ && _t89.cls_id == SP_BUILTIN_POLY_ARRAY) { | |
| sp_PolyArray *_pa = (sp_PolyArray *)_t89.v.p; | |
| if (sp_PolyArray_length(_pa) > 0) lv_k = sp_PolyArray_get(_pa, 0); | |
| if (sp_PolyArray_length(_pa) > 1) lv_v = sp_PolyArray_get(_pa, 1); | |
| } else if (_t89.tag == SP_TAG_OBJ && _t89.cls_id == SP_BUILTIN_INT_ARRAY) { | |
| sp_IntArray *_ia = (sp_IntArray *)_t89.v.p; | |
| if (sp_IntArray_length(_ia) > 0) lv_k = sp_box_int(sp_IntArray_get(_ia, 0)); | |
| if (sp_IntArray_length(_ia) > 1) lv_v = sp_box_int(sp_IntArray_get(_ia, 1)); | |
| } else { | |
| lv_k = _t89; | |
| } | |
| sp_redo_9: ; | |
| #line 266 "test/models/../test_helper.rb" | |
| sp_RbVal _t90 = lv_v; | |
| if ((_t90.tag == SP_TAG_OBJ && (_t90.cls_id == SP_BUILTIN_STR_INT_HASH || _t90.cls_id == SP_BUILTIN_STR_STR_HASH || _t90.cls_id == SP_BUILTIN_INT_STR_HASH || _t90.cls_id == SP_BUILTIN_SYM_INT_HASH || _t90.cls_id == SP_BUILTIN_SYM_STR_HASH || _t90.cls_id == SP_BUILTIN_STR_POLY_HASH || _t90.cls_id == SP_BUILTIN_SYM_POLY_HASH))) { | |
| #line 267 "test/models/../test_helper.rb" | |
| if (sp_gc_is_frozen(lv_out)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(lv_out, sp_poly_to_s(lv_k), sp_box_obj((void *)(sp_ActionDispatch_IntegrationTest_stringify_keys(self, lv_v)), SP_BUILTIN_STR_POLY_HASH)); | |
| } else { | |
| #line 269 "test/models/../test_helper.rb" | |
| if (sp_gc_is_frozen(lv_out)) sp_raise_frozen_hash(); | |
| sp_StrPolyHash_set(lv_out, sp_poly_to_s(lv_k), lv_v); | |
| } | |
| } | |
| } | |
| #line 272 "test/models/../test_helper.rb" | |
| return (sp_StrPolyHash *)lv_out; | |
| return NULL; | |
| } | |
| static mrb_int sp_ActionDispatch_IntegrationTest_assert_response(sp_ActionDispatch_IntegrationTest *self, mrb_int lv_expected, sp_ActionResponse * lv_response) { | |
| (void)lv_expected; | |
| (void)lv_response; | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_ActionDispatch_IntegrationTest_assert_redirected_to(sp_ActionDispatch_IntegrationTest *self, mrb_int lv_expected_path, sp_ActionResponse * lv_response) { | |
| (void)lv_expected_path; | |
| (void)lv_response; | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_ActionDispatch_IntegrationTest_assert_select(sp_ActionDispatch_IntegrationTest *self, const char * lv_selector, mrb_int lv_content_or_opts, mrb_int lv_opts, sp_Proc * lv_block, void (*_block)(mrb_int, void*), void *_benv) { | |
| (void)lv_selector; | |
| (void)lv_content_or_opts; | |
| (void)lv_opts; | |
| (void)lv_block; | |
| return SP_INT_NIL; | |
| } | |
| SP_POOL_DEFINE(Stmt) | |
| static inline sp_Stmt *sp_Stmt_new(const char * lv_sql, void * lv_ptr) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_sql); | |
| sp_Stmt *self = SP_POOL_NEW(Stmt, sp_Stmt_gc_scan); | |
| self->cls_id = 61LL; | |
| SP_GC_ROOT(self); | |
| self->iv_sql = NULL; | |
| SP_GC_ROOT(lv_sql); | |
| self->iv_sql = lv_sql; | |
| self->iv_ptr = lv_ptr; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Stmt_initialize(sp_Stmt *self, const char * lv_sql, void * lv_ptr) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_sql); | |
| #line 100 "test/models/../../runtime/db.rb" | |
| self->iv_sql = lv_sql; | |
| #line 101 "test/models/../../runtime/db.rb" | |
| self->iv_ptr = lv_ptr; | |
| } | |
| static inline const char * sp_Stmt_sql(sp_Stmt *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 105 "test/models/../../runtime/db.rb" | |
| return self->iv_sql; | |
| return (&("\xff")[1]); | |
| } | |
| static inline void * sp_Stmt_ptr(sp_Stmt *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 109 "test/models/../../runtime/db.rb" | |
| return self->iv_ptr; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(DbConn) | |
| static inline sp_DbConn *sp_DbConn_new(void * lv_dbh) { | |
| SP_GC_SAVE(); | |
| sp_DbConn *self = SP_POOL_NEW(DbConn, sp_DbConn_gc_scan); | |
| self->cls_id = 62LL; | |
| SP_GC_ROOT(self); | |
| self->iv_entries = NULL; | |
| self->iv_dbh = lv_dbh; | |
| self->iv_entries = sp_PtrArray_new(); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_DbConn_initialize(sp_DbConn *self, void * lv_dbh) { | |
| #line 117 "test/models/../../runtime/db.rb" | |
| self->iv_dbh = lv_dbh; | |
| #line 118 "test/models/../../runtime/db.rb" | |
| self->iv_entries = sp_PtrArray_new(); | |
| } | |
| static inline void * sp_DbConn_dbh(sp_DbConn *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 122 "test/models/../../runtime/db.rb" | |
| return self->iv_dbh; | |
| return NULL; | |
| } | |
| static void * sp_DbConn_prepare_cached(sp_DbConn *self, const char * lv_sql) { | |
| SP_GC_SAVE(); | |
| mrb_int lv_i = 0; | |
| sp_Stmt * lv_e = NULL; | |
| mrb_int lv_rc = 0; | |
| void * lv_st = NULL; | |
| SP_GC_ROOT(lv_e); | |
| SP_GC_ROOT(lv_sql); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_sql); | |
| #line 129 "test/models/../../runtime/db.rb" | |
| lv_i = 0LL; | |
| #line 130 "test/models/../../runtime/db.rb" | |
| while ((lv_i < sp_PtrArray_length(self->iv_entries))) { | |
| sp_redo_10: ; | |
| #line 131 "test/models/../../runtime/db.rb" | |
| lv_e = ((sp_Stmt *)sp_PtrArray_get(self->iv_entries, lv_i)); | |
| #line 132 "test/models/../../runtime/db.rb" | |
| if (sp_str_eq(lv_e->iv_sql, lv_sql)) { | |
| void * _t91 = lv_e->iv_ptr; | |
| SP_GC_RESTORE(); | |
| return _t91; | |
| } | |
| #line 133 "test/models/../../runtime/db.rb" | |
| lv_i += 1LL; | |
| } | |
| #line 135 "test/models/../../runtime/db.rb" | |
| lv_rc = sqlite3_prepare_v2(((void *)(uintptr_t)self->iv_dbh), lv_sql, ((int)(-1LL)), ((void *)(uintptr_t)((void *)sp_ffi_buf_SQL_stmt_out)), ((void *)(uintptr_t)0)); | |
| #line 136 "test/models/../../runtime/db.rb" | |
| if ((lv_rc != cst_SQL_OK)) { | |
| #line 137 "test/models/../../runtime/db.rb" | |
| const char * _t92 = (&("\xff" "Db.prepare failed (")[1]); | |
| SP_GC_ROOT(_t92); | |
| const char * _t93 = sp_int_to_s(lv_rc); | |
| SP_GC_ROOT(_t93); | |
| const char * _t94 = (&("\xff" "): ")[1]); | |
| SP_GC_ROOT(_t94); | |
| const char * _t95 = sp_str_dup_external(sqlite3_errmsg(((void *)(uintptr_t)self->iv_dbh))); | |
| SP_GC_ROOT(_t95); | |
| const char * _t96 = (&("\xff" " \xE2\x80\x94 sql: ")[1]); | |
| SP_GC_ROOT(_t96); | |
| const char * _t97 = lv_sql; | |
| SP_GC_ROOT(_t97); | |
| sp_raise(sp_str_concat_arr((const char *const[]){_t92, _t93, _t94, _t95, _t96, _t97}, 6)); | |
| } | |
| #line 139 "test/models/../../runtime/db.rb" | |
| lv_st = ((void *)(*((void * *)((char *)((void *)sp_ffi_buf_SQL_stmt_out) + 0)))); | |
| #line 140 "test/models/../../runtime/db.rb" | |
| if ((sp_PtrArray_length(self->iv_entries) < 128)) { | |
| sp_PtrArray_push(self->iv_entries, sp_Stmt_new(lv_sql, lv_st)); | |
| } | |
| #line 141 "test/models/../../runtime/db.rb" | |
| return lv_st; | |
| return NULL; | |
| } | |
| static inline mrb_int sp_DbConn_finalize_all(sp_DbConn *self) { | |
| mrb_int lv_i = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 146 "test/models/../../runtime/db.rb" | |
| lv_i = 0LL; | |
| #line 147 "test/models/../../runtime/db.rb" | |
| while ((lv_i < sp_PtrArray_length(self->iv_entries))) { | |
| sp_redo_11: ; | |
| #line 148 "test/models/../../runtime/db.rb" | |
| sp_Stmt * _t98 = ((sp_Stmt *)sp_PtrArray_get(self->iv_entries, lv_i)); | |
| SP_GC_ROOT(_t98); | |
| sqlite3_finalize(((void *)(uintptr_t)_t98->iv_ptr)); | |
| #line 149 "test/models/../../runtime/db.rb" | |
| lv_i += 1LL; | |
| } | |
| return 0; | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(DbPool) | |
| static inline sp_DbPool *sp_DbPool_new(const char * lv_path, mrb_int lv_n) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_path); | |
| sp_DbPool *self = SP_POOL_NEW(DbPool, sp_DbPool_gc_scan); | |
| self->cls_id = 63LL; | |
| SP_GC_ROOT(self); | |
| self->iv_conns = NULL; | |
| self->iv_free = NULL; | |
| mrb_int lv_i = 0; | |
| mrb_int lv_rc = 0; | |
| SP_GC_ROOT(lv_path); | |
| self->iv_conns = sp_PtrArray_new(); | |
| self->iv_free = sp_IntArray_new(); | |
| #line 162 "test/models/../../runtime/db.rb" | |
| lv_i = 0LL; | |
| #line 163 "test/models/../../runtime/db.rb" | |
| while ((lv_i < lv_n)) { | |
| sp_redo_12: ; | |
| #line 164 "test/models/../../runtime/db.rb" | |
| lv_rc = sqlite3_open(lv_path, ((void *)(uintptr_t)((void *)sp_ffi_buf_SQL_db_out))); | |
| #line 165 "test/models/../../runtime/db.rb" | |
| if ((lv_rc != cst_SQL_OK)) { | |
| #line 169 "test/models/../../runtime/db.rb" | |
| const char * _t99 = (&("\xff" "Db.configure: sqlite3_open(")[1]); | |
| SP_GC_ROOT(_t99); | |
| const char * _t100 = lv_path; | |
| SP_GC_ROOT(_t100); | |
| const char * _t101 = (&("\xff" ") failed (")[1]); | |
| SP_GC_ROOT(_t101); | |
| const char * _t102 = sp_int_to_s(lv_rc); | |
| SP_GC_ROOT(_t102); | |
| const char * _t103 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t103); | |
| sp_raise(sp_str_concat_arr((const char *const[]){_t99, _t100, _t101, _t102, _t103}, 5)); | |
| } | |
| #line 171 "test/models/../../runtime/db.rb" | |
| sp_PtrArray_push(self->iv_conns, sp_DbConn_new(((void *)(*((void * *)((char *)((void *)sp_ffi_buf_SQL_db_out) + 0)))))); | |
| #line 172 "test/models/../../runtime/db.rb" | |
| sp_IntArray_push(self->iv_free, lv_i); | |
| #line 173 "test/models/../../runtime/db.rb" | |
| lv_i += 1LL; | |
| } | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_DbPool_initialize(sp_DbPool *self, const char * lv_path, mrb_int lv_n) { | |
| SP_GC_SAVE(); | |
| mrb_int lv_i = 0; | |
| mrb_int lv_rc = 0; | |
| SP_GC_ROOT(lv_path); | |
| #line 160 "test/models/../../runtime/db.rb" | |
| self->iv_conns = sp_PtrArray_new(); | |
| #line 161 "test/models/../../runtime/db.rb" | |
| self->iv_free = sp_IntArray_new(); | |
| #line 162 "test/models/../../runtime/db.rb" | |
| lv_i = 0LL; | |
| #line 163 "test/models/../../runtime/db.rb" | |
| while ((lv_i < lv_n)) { | |
| sp_redo_13: ; | |
| #line 164 "test/models/../../runtime/db.rb" | |
| lv_rc = sqlite3_open(lv_path, ((void *)(uintptr_t)((void *)sp_ffi_buf_SQL_db_out))); | |
| #line 165 "test/models/../../runtime/db.rb" | |
| if ((lv_rc != cst_SQL_OK)) { | |
| #line 169 "test/models/../../runtime/db.rb" | |
| const char * _t104 = (&("\xff" "Db.configure: sqlite3_open(")[1]); | |
| SP_GC_ROOT(_t104); | |
| const char * _t105 = lv_path; | |
| SP_GC_ROOT(_t105); | |
| const char * _t106 = (&("\xff" ") failed (")[1]); | |
| SP_GC_ROOT(_t106); | |
| const char * _t107 = sp_int_to_s(lv_rc); | |
| SP_GC_ROOT(_t107); | |
| const char * _t108 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t108); | |
| sp_raise(sp_str_concat_arr((const char *const[]){_t104, _t105, _t106, _t107, _t108}, 5)); | |
| } | |
| #line 171 "test/models/../../runtime/db.rb" | |
| sp_PtrArray_push(self->iv_conns, sp_DbConn_new(((void *)(*((void * *)((char *)((void *)sp_ffi_buf_SQL_db_out) + 0)))))); | |
| #line 172 "test/models/../../runtime/db.rb" | |
| sp_IntArray_push(self->iv_free, lv_i); | |
| #line 173 "test/models/../../runtime/db.rb" | |
| lv_i += 1LL; | |
| } | |
| } | |
| static inline mrb_int sp_DbPool_available(sp_DbPool *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 178 "test/models/../../runtime/db.rb" | |
| return sp_IntArray_length(self->iv_free); | |
| return 0; | |
| } | |
| static inline mrb_int sp_DbPool_lease(sp_DbPool *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 183 "test/models/../../runtime/db.rb" | |
| return sp_IntArray_delete_at(self->iv_free, sp_int_sub(sp_IntArray_length(self->iv_free), 1LL)); | |
| return 0; | |
| } | |
| static inline sp_IntArray * sp_DbPool_release(sp_DbPool *self, mrb_int lv_idx) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 187 "test/models/../../runtime/db.rb" | |
| sp_IntArray_push(self->iv_free, lv_idx); | |
| return NULL; | |
| return NULL; | |
| } | |
| static inline sp_DbConn * sp_DbPool_conn(sp_DbPool *self, mrb_int lv_idx) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 191 "test/models/../../runtime/db.rb" | |
| return ((sp_DbConn *)sp_PtrArray_get(self->iv_conns, lv_idx)); | |
| return NULL; | |
| } | |
| static inline sp_DbConn * sp_DbPool_first(sp_DbPool *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 195 "test/models/../../runtime/db.rb" | |
| return ((sp_DbConn *)sp_PtrArray_get(self->iv_conns, 0LL)); | |
| return NULL; | |
| } | |
| static inline mrb_int sp_DbPool_close_all(sp_DbPool *self) { | |
| SP_GC_SAVE(); | |
| mrb_int lv_i = 0; | |
| sp_DbConn * lv_c = NULL; | |
| SP_GC_ROOT(lv_c); | |
| SP_GC_ROOT(self); | |
| #line 200 "test/models/../../runtime/db.rb" | |
| lv_i = 0LL; | |
| #line 201 "test/models/../../runtime/db.rb" | |
| while ((lv_i < sp_PtrArray_length(self->iv_conns))) { | |
| sp_redo_14: ; | |
| #line 202 "test/models/../../runtime/db.rb" | |
| lv_c = ((sp_DbConn *)sp_PtrArray_get(self->iv_conns, lv_i)); | |
| #line 203 "test/models/../../runtime/db.rb" | |
| sp_DbConn_finalize_all(lv_c); | |
| #line 204 "test/models/../../runtime/db.rb" | |
| sqlite3_close(((void *)(uintptr_t)lv_c->iv_dbh)); | |
| #line 205 "test/models/../../runtime/db.rb" | |
| lv_i += 1LL; | |
| } | |
| return 0; | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(ApplicationController) | |
| static inline sp_ApplicationController *sp_ApplicationController_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ApplicationController *self = SP_POOL_NEW(ApplicationController, sp_ApplicationController_gc_scan); | |
| self->cls_id = 64LL; | |
| SP_GC_ROOT(self); | |
| self->iv_params = sp_box_nil(); | |
| self->iv_session = NULL; | |
| self->iv_flash = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_location = NULL; | |
| self->iv_content_type = NULL; | |
| self->iv_request_method = NULL; | |
| self->iv_request_path = NULL; | |
| sp_ActionController_Base_initialize((sp_ActionController_Base *)self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| SP_POOL_DEFINE(ApplicationRecord) | |
| static inline sp_ApplicationRecord *sp_ApplicationRecord_new(sp_SymPolyHash * lv__attrs) { | |
| SP_GC_SAVE(); | |
| sp_ApplicationRecord *self = SP_POOL_NEW(ApplicationRecord, sp_ApplicationRecord_gc_scan); | |
| self->cls_id = 65LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_id = sp_box_nil(); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, lv__attrs); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static mrb_int sp_ApplicationRecord_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| #line 56 "test/models/../../runtime/active_record/base.rb" | |
| sp_raise_cls("NotImplementedError", sp_sprintf("%s.schema_columns must be overridden", sp_class_to_s(((sp_Class){65LL})))); | |
| return 0; | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(CommentRow) | |
| static inline sp_CommentRow *sp_CommentRow_new(void) { | |
| SP_GC_SAVE(); | |
| sp_CommentRow *self = SP_POOL_NEW(CommentRow, sp_CommentRow_gc_scan); | |
| self->cls_id = 66LL; | |
| SP_GC_ROOT(self); | |
| self->iv_body = NULL; | |
| self->iv_commenter = NULL; | |
| self->iv_created_at = NULL; | |
| self->iv_updated_at = NULL; | |
| self->iv_id = 0LL; | |
| self->iv_article_id = 0LL; | |
| self->iv_body = (&("\xff" "")[1]); | |
| self->iv_commenter = (&("\xff" "")[1]); | |
| self->iv_created_at = (&("\xff" "")[1]); | |
| self->iv_updated_at = (&("\xff" "")[1]); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_CommentRow_initialize(sp_CommentRow *self) { | |
| #line 51 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| self->iv_id = 0LL; | |
| #line 52 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| self->iv_article_id = 0LL; | |
| #line 53 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| self->iv_body = (&("\xff" "")[1]); | |
| #line 54 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| self->iv_commenter = (&("\xff" "")[1]); | |
| #line 55 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| self->iv_created_at = (&("\xff" "")[1]); | |
| #line 56 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| self->iv_updated_at = (&("\xff" "")[1]); | |
| } | |
| static inline mrb_int sp_CommentRow_id(sp_CommentRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 3 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| return self->iv_id; | |
| return 0; | |
| } | |
| static inline mrb_int sp_CommentRow_id_eq(sp_CommentRow *self, mrb_int lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 7 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| self->iv_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_CommentRow_article_id(sp_CommentRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 11 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| return self->iv_article_id; | |
| return 0; | |
| } | |
| static inline mrb_int sp_CommentRow_article_id_eq(sp_CommentRow *self, mrb_int lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 15 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| self->iv_article_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_CommentRow_body(sp_CommentRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 19 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| return self->iv_body; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_CommentRow_body_eq(sp_CommentRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| #line 23 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_CommentRow_commenter(sp_CommentRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 27 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| return self->iv_commenter; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_CommentRow_commenter_eq(sp_CommentRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| #line 31 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| self->iv_commenter = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_CommentRow_created_at(sp_CommentRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 35 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| return self->iv_created_at; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_CommentRow_created_at_eq(sp_CommentRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| #line 39 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_CommentRow_updated_at(sp_CommentRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 43 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| return self->iv_updated_at; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_CommentRow_updated_at_eq(sp_CommentRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| #line 47 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static sp_CommentRow * sp_CommentRow_cls_from_raw(sp_StrPolyHash * lv_row) { | |
| SP_GC_SAVE(); | |
| sp_CommentRow * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT(lv_row); | |
| SP_GC_ROOT(lv_row); | |
| #line 60 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| lv_instance = sp_CommentRow_new(); | |
| #line 61 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| sp_RbVal _t109 = sp_StrPolyHash_get(lv_row, (&("\xff" "id")[1])); | |
| sp_RbVal _t111 = (sp_poly_truthy(_t109) ? _t109 : sp_box_int(0LL)); | |
| mrb_int _t110 = (_t111.tag == SP_TAG_INT) ? _t111.v.i : 0; | |
| sp_CommentRow_id_eq(lv_instance, _t110); | |
| #line 62 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| sp_RbVal _t112 = sp_StrPolyHash_get(lv_row, (&("\xff" "article_id")[1])); | |
| sp_RbVal _t114 = (sp_poly_truthy(_t112) ? _t112 : sp_box_int(0LL)); | |
| mrb_int _t113 = (_t114.tag == SP_TAG_INT) ? _t114.v.i : 0; | |
| sp_CommentRow_article_id_eq(lv_instance, _t113); | |
| #line 63 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| sp_CommentRow_body_eq(lv_instance, sp_poly_to_s(sp_StrPolyHash_get(lv_row, (&("\xff" "body")[1])))); | |
| #line 64 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| sp_CommentRow_commenter_eq(lv_instance, sp_poly_to_s(sp_StrPolyHash_get(lv_row, (&("\xff" "commenter")[1])))); | |
| #line 65 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| sp_CommentRow_created_at_eq(lv_instance, sp_poly_to_s(sp_StrPolyHash_get(lv_row, (&("\xff" "created_at")[1])))); | |
| #line 66 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| sp_CommentRow_updated_at_eq(lv_instance, sp_poly_to_s(sp_StrPolyHash_get(lv_row, (&("\xff" "updated_at")[1])))); | |
| #line 67 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment_row.rb" | |
| return (sp_CommentRow *)lv_instance; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Comment) | |
| static inline sp_Comment *sp_Comment_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Comment *self = SP_POOL_NEW(Comment, sp_Comment_gc_scan); | |
| self->cls_id = 67LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_id = sp_box_nil(); | |
| self->iv_body = NULL; | |
| self->iv_commenter = NULL; | |
| self->iv_created_at = NULL; | |
| self->iv_updated_at = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| #line 103 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 104 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_article_id_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_article_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_article_id))) : sp_box_int(0LL))); | |
| #line 105 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); | |
| #line 106 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_commenter_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_commenter)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_commenter))) : sp_box_str((&("\xff" "")[1])))); | |
| #line 107 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); | |
| #line 108 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Comment_initialize(sp_Comment *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| #line 103 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 104 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_article_id_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_article_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_article_id))) : sp_box_int(0LL))); | |
| #line 105 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); | |
| #line 106 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_commenter_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_commenter)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_commenter))) : sp_box_str((&("\xff" "")[1])))); | |
| #line 107 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); | |
| #line 108 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); | |
| } | |
| static inline sp_RbVal sp_Comment_id(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 8 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t115 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t115; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Comment_id_eq(sp_Comment *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 12 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Comment_article_id(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 16 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t116 = sp_box_int(self->iv_article_id); | |
| SP_GC_RESTORE(); | |
| return _t116; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Comment_article_id_eq(sp_Comment *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 20 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_article_id = (lv_value).v.i; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Comment_body(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 24 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t117 = sp_box_str(self->iv_body); | |
| SP_GC_RESTORE(); | |
| return _t117; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Comment_body_eq(sp_Comment *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 28 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_body = (lv_value).v.s; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Comment_commenter(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 32 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t118 = sp_box_str(self->iv_commenter); | |
| SP_GC_RESTORE(); | |
| return _t118; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Comment_commenter_eq(sp_Comment *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 36 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_commenter = (lv_value).v.s; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Comment_created_at(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 40 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t119 = sp_box_str(self->iv_created_at); | |
| SP_GC_RESTORE(); | |
| return _t119; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Comment_created_at_eq(sp_Comment *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 44 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_created_at = (lv_value).v.s; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Comment_updated_at(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 48 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t120 = sp_box_str(self->iv_updated_at); | |
| SP_GC_RESTORE(); | |
| return _t120; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Comment_updated_at_eq(sp_Comment *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 52 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_updated_at = (lv_value).v.s; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Comment_assign_from_row(sp_Comment *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return 0; | |
| } | |
| static inline sp_SymPolyHash * sp_Comment_attributes(sp_Comment *self) { | |
| return NULL; | |
| } | |
| static inline sp_RbVal sp_Comment__aref(sp_Comment *self, sp_sym lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 116 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| mrb_int _t121 = lv_name; | |
| if (_t121 == SPS_id) { | |
| #line 118 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t122 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t122; | |
| } else if (_t121 == SPS_article_id) { | |
| #line 120 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t123 = sp_box_int(self->iv_article_id); | |
| SP_GC_RESTORE(); | |
| return _t123; | |
| } else if (_t121 == SPS_body) { | |
| #line 122 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t124 = sp_box_str(self->iv_body); | |
| SP_GC_RESTORE(); | |
| return _t124; | |
| } else if (_t121 == SPS_commenter) { | |
| #line 124 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t125 = sp_box_str(self->iv_commenter); | |
| SP_GC_RESTORE(); | |
| return _t125; | |
| } else if (_t121 == SPS_created_at) { | |
| #line 126 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t126 = sp_box_str(self->iv_created_at); | |
| SP_GC_RESTORE(); | |
| return _t126; | |
| } else if (_t121 == SPS_updated_at) { | |
| #line 128 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t127 = sp_box_str(self->iv_updated_at); | |
| SP_GC_RESTORE(); | |
| return _t127; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Comment__aset(sp_Comment *self, sp_sym lv_name, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 133 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| mrb_int _t128 = lv_name; | |
| if (_t128 == SPS_id) { | |
| #line 135 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t130 = lv_value; | |
| mrb_int _t129 = (_t130.tag == SP_TAG_INT) ? _t130.v.i : 0; | |
| self->iv_id = sp_box_int(_t129); | |
| return sp_box_nil(); | |
| } else if (_t128 == SPS_article_id) { | |
| #line 137 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_RbVal _t132 = lv_value; | |
| mrb_int _t131 = (_t132.tag == SP_TAG_INT) ? _t132.v.i : 0; | |
| self->iv_article_id = _t131; | |
| return sp_box_nil(); | |
| } else if (_t128 == SPS_body) { | |
| #line 139 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_body = sp_poly_to_s(lv_value); | |
| return sp_box_nil(); | |
| } else if (_t128 == SPS_commenter) { | |
| #line 141 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_commenter = sp_poly_to_s(lv_value); | |
| return sp_box_nil(); | |
| } else if (_t128 == SPS_created_at) { | |
| #line 143 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_created_at = sp_poly_to_s(lv_value); | |
| return sp_box_nil(); | |
| } else if (_t128 == SPS_updated_at) { | |
| #line 145 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_updated_at = sp_poly_to_s(lv_value); | |
| return sp_box_nil(); | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_bool sp_Comment_update(sp_Comment *self, sp_CommentParams * lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_p); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_p); | |
| #line 150 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| const char * _t133 = lv_p->iv_commenter; | |
| SP_GC_ROOT(_t133); | |
| if ((_t133 == NULL)) { | |
| #line 151 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| } else { | |
| #line 153 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_commenter_eq(self, sp_box_str(lv_p->iv_commenter)); | |
| } | |
| #line 155 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| const char * _t134 = lv_p->iv_body; | |
| SP_GC_ROOT(_t134); | |
| if ((_t134 == NULL)) { | |
| #line 156 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| } else { | |
| #line 158 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_body_eq(self, sp_box_str(lv_p->iv_body)); | |
| } | |
| #line 160 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Comment__adapter_insert(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 184 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| const char * _t135 = (&("\xff" "INSERT INTO comments (article_id, body, commenter, created_at, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t135); | |
| const char * _t136 = sp_Db_cls_escape_int(sp_box_int(self->iv_article_id)); | |
| SP_GC_ROOT(_t136); | |
| const char * _t137 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t137); | |
| const char * _t138 = sp_Db_cls_escape_string(sp_box_str(self->iv_body)); | |
| SP_GC_ROOT(_t138); | |
| const char * _t139 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t139); | |
| const char * _t140 = sp_Db_cls_escape_string(sp_box_str(self->iv_commenter)); | |
| SP_GC_ROOT(_t140); | |
| const char * _t141 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t141); | |
| const char * _t142 = sp_Db_cls_escape_string(sp_box_str(self->iv_created_at)); | |
| SP_GC_ROOT(_t142); | |
| const char * _t143 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t143); | |
| const char * _t144 = sp_Db_cls_escape_string(sp_box_str(self->iv_updated_at)); | |
| SP_GC_ROOT(_t144); | |
| const char * _t145 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t145); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t135, _t136, _t137, _t138, _t139, _t140, _t141, _t142, _t143, _t144, _t145}, 11)); | |
| #line 185 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| return sp_Db_cls_last_insert_rowid(); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Comment__adapter_update(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 189 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| const char * _t146 = (&("\xff" "UPDATE comments SET ")[1]); | |
| SP_GC_ROOT(_t146); | |
| const char * _t147 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t147); | |
| const char * _t148 = sp_Db_cls_escape_int(sp_box_int(self->iv_article_id)); | |
| SP_GC_ROOT(_t148); | |
| const char * _t149 = (&("\xff" ", body = ")[1]); | |
| SP_GC_ROOT(_t149); | |
| const char * _t150 = sp_Db_cls_escape_string(sp_box_str(self->iv_body)); | |
| SP_GC_ROOT(_t150); | |
| const char * _t151 = (&("\xff" ", commenter = ")[1]); | |
| SP_GC_ROOT(_t151); | |
| const char * _t152 = sp_Db_cls_escape_string(sp_box_str(self->iv_commenter)); | |
| SP_GC_ROOT(_t152); | |
| const char * _t153 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t153); | |
| const char * _t154 = sp_Db_cls_escape_string(sp_box_str(self->iv_created_at)); | |
| SP_GC_ROOT(_t154); | |
| const char * _t155 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t155); | |
| const char * _t156 = sp_Db_cls_escape_string(sp_box_str(self->iv_updated_at)); | |
| SP_GC_ROOT(_t156); | |
| const char * _t157 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t157); | |
| const char * _t158 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t158); | |
| const char * _t159 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t159); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t146, _t147, _t148, _t149, _t150, _t151, _t152, _t153, _t154, _t155, _t156, _t157, _t158, _t159}, 14)); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Comment__adapter_delete(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 193 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| const char * _t160 = (&("\xff" "DELETE FROM comments")[1]); | |
| SP_GC_ROOT(_t160); | |
| const char * _t161 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t161); | |
| const char * _t162 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t162); | |
| const char * _t163 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t163); | |
| return sp_Db_cls_exec(sp_str_concat4(_t160, _t161, _t162, _t163)); | |
| return 0; | |
| } | |
| static sp_Comment * sp_Comment__adapter_reload(sp_Comment *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 217 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| const char * _t164 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments WHERE id = ")[1]); | |
| SP_GC_ROOT(_t164); | |
| const char * _t165 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t165); | |
| const char * _t166 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t166); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t164, _t165, _t166)); | |
| #line 218 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| #line 219 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_id = sp_box_int(sp_Db_cls_column_int(sp_box_obj((void *)(lv_stmt), 0), 0LL)); | |
| #line 220 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_article_id = sp_Db_cls_column_int(sp_box_obj((void *)(lv_stmt), 0), 1LL); | |
| #line 221 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_body = sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 2LL); | |
| #line 222 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_commenter = sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 3LL); | |
| #line 223 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_created_at = sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 4LL); | |
| #line 224 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| self->iv_updated_at = sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 5LL); | |
| #line 225 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| #line 227 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 228 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| return self; | |
| return NULL; | |
| } | |
| static inline mrb_int sp_Comment_validate(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 239 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| if (((self->iv_commenter == NULL) || (strlen(self->iv_commenter) == 0))) { | |
| sp_StrArray * _t167 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t167); | |
| sp_StrArray_push(_t167, (&("\xff" "commenter can't be blank")[1])); | |
| } | |
| #line 240 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| if (((self->iv_body == NULL) || (strlen(self->iv_body) == 0))) { | |
| sp_StrArray * _t168 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t168); | |
| sp_StrArray_push(_t168, (&("\xff" "body can't be blank")[1])); | |
| } | |
| #line 241 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| if (((FALSE || (self->iv_article_id == 0LL)) || (!sp_Article_cls_exists_p(sp_box_int(self->iv_article_id))))) { | |
| sp_StrArray * _t169 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t169); | |
| sp_StrArray_push(_t169, (&("\xff" "article must exist")[1])); | |
| return 0; | |
| } else { | |
| return 0; | |
| } | |
| return 0; | |
| } | |
| static inline sp_Article * sp_Comment_article(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_Article * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| SP_GC_ROOT(self); | |
| #line 245 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| if ((self->iv_article_id == 0LL)) { | |
| #line 246 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| return 0; | |
| } else { | |
| #line 248 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| const char * _t170 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles")[1]); | |
| SP_GC_ROOT(_t170); | |
| const char * _t171 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t171); | |
| const char * _t172 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t172); | |
| const char * _t173 = sp_Db_cls_escape_int(sp_box_int(self->iv_article_id)); | |
| SP_GC_ROOT(_t173); | |
| const char * _t174 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t174); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat_arr((const char *const[]){_t170, _t171, _t172, _t173, _t174}, 5)); | |
| #line 249 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| lv_result = NULL; | |
| #line 250 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| #line 251 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| lv_result = sp_Article_cls_from_stmt(sp_box_obj((void *)(lv_stmt), 0)); | |
| } | |
| #line 253 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 254 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| return (sp_Article *)lv_result; | |
| } | |
| return NULL; | |
| } | |
| static inline const char * sp_Comment_dom_prefix(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 259 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| return (&("\xff" "comment")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static mrb_int sp_Comment_after_create_commit(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| sp_Article * lv_parent = NULL; | |
| SP_GC_ROOT(lv_parent); | |
| SP_GC_ROOT(self); | |
| #line 263 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| const char * _t175 = sp_sprintf("article_%lld_comments", (long long)self->iv_article_id); | |
| SP_GC_ROOT(_t175); | |
| sp_String * _t176 = sp_Views_Comments_cls_comment(self, 0, 0); | |
| SP_GC_ROOT(_t176); | |
| sp_Broadcasts_cls_append(_t175, (&("\xff" "comments")[1]), _t176); | |
| #line 264 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| lv_parent = sp_Comment_article(self); | |
| #line 265 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| if ((lv_parent == NULL)) { | |
| SP_GC_RESTORE(); | |
| return 0; | |
| } | |
| #line 266 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| const char * _t177 = sp_sprintf("article_%s", sp_poly_to_s(lv_parent->iv_id)); | |
| SP_GC_ROOT(_t177); | |
| sp_String * _t178 = sp_Views_Articles_cls_article(sp_box_nullable_obj(lv_parent, 69), 0, 0); | |
| SP_GC_ROOT(_t178); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t177, _t178); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Comment_after_update_commit(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 270 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| const char * _t179 = sp_sprintf("article_%lld_comments", (long long)self->iv_article_id); | |
| SP_GC_ROOT(_t179); | |
| const char * _t180 = sp_sprintf("comment_%s", sp_poly_to_s(self->iv_id)); | |
| SP_GC_ROOT(_t180); | |
| sp_String * _t181 = sp_Views_Comments_cls_comment(self, 0, 0); | |
| SP_GC_ROOT(_t181); | |
| return sp_Broadcasts_cls_replace(_t179, _t180, _t181); | |
| return 0; | |
| } | |
| static mrb_int sp_Comment_after_destroy_commit(sp_Comment *self) { | |
| SP_GC_SAVE(); | |
| sp_Article * lv_parent = NULL; | |
| SP_GC_ROOT(lv_parent); | |
| SP_GC_ROOT(self); | |
| #line 274 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| const char * _t182 = sp_sprintf("article_%lld_comments", (long long)self->iv_article_id); | |
| SP_GC_ROOT(_t182); | |
| const char * _t183 = sp_sprintf("comment_%s", sp_poly_to_s(self->iv_id)); | |
| SP_GC_ROOT(_t183); | |
| sp_Broadcasts_cls_remove(_t182, _t183); | |
| #line 275 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| lv_parent = sp_Comment_article(self); | |
| #line 276 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| if ((lv_parent == NULL)) { | |
| SP_GC_RESTORE(); | |
| return 0; | |
| } | |
| #line 277 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| const char * _t184 = sp_sprintf("article_%s", sp_poly_to_s(lv_parent->iv_id)); | |
| SP_GC_ROOT(_t184); | |
| sp_String * _t185 = sp_Views_Articles_cls_article(sp_box_nullable_obj(lv_parent, 69), 0, 0); | |
| SP_GC_ROOT(_t185); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t184, _t185); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Comment_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| #line 60 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_IntArray *_t186 = sp_IntArray_new(); | |
| sp_IntArray_push(_t186, SPS_id); | |
| sp_IntArray_push(_t186, SPS_article_id); | |
| sp_IntArray_push(_t186, SPS_body); | |
| sp_IntArray_push(_t186, SPS_commenter); | |
| sp_IntArray_push(_t186, SPS_created_at); | |
| sp_IntArray_push(_t186, SPS_updated_at); | |
| return _t186; | |
| return NULL; | |
| } | |
| static sp_Comment * sp_Comment_cls_from_row(sp_CommentRow * lv_row) { | |
| SP_GC_SAVE(); | |
| sp_Comment * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT(lv_row); | |
| SP_GC_ROOT(lv_row); | |
| #line 70 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_StrIntHash * _t187 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t187); | |
| lv_instance = sp_Comment_new(_t187); | |
| #line 71 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| lv_instance->iv_id = sp_box_int(lv_row->iv_id); | |
| #line 72 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_article_id_eq(lv_instance, sp_box_int(lv_row->iv_article_id)); | |
| #line 73 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_body_eq(lv_instance, sp_box_str(lv_row->iv_body)); | |
| #line 74 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_commenter_eq(lv_instance, sp_box_str(lv_row->iv_commenter)); | |
| #line 75 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_created_at_eq(lv_instance, sp_box_str(lv_row->iv_created_at)); | |
| #line 76 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_updated_at_eq(lv_instance, sp_box_str(lv_row->iv_updated_at)); | |
| #line 77 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| return (sp_Comment *)lv_instance; | |
| return NULL; | |
| } | |
| static sp_Comment * sp_Comment_cls_from_stmt(sp_RbVal lv_stmt) { | |
| SP_GC_SAVE(); | |
| sp_Comment * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT_RBVAL(lv_stmt); | |
| #line 81 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_StrIntHash * _t188 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t188); | |
| lv_instance = sp_Comment_new(_t188); | |
| #line 82 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| lv_instance->iv_id = sp_box_int(sp_Db_cls_column_int(lv_stmt, 0LL)); | |
| #line 83 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_article_id_eq(lv_instance, sp_box_int(sp_Db_cls_column_int(lv_stmt, 1LL))); | |
| #line 84 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_body_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 2LL))); | |
| #line 85 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_commenter_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 3LL))); | |
| #line 86 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_created_at_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 4LL))); | |
| #line 87 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_updated_at_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 5LL))); | |
| #line 88 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)lv_instance); | |
| #line 89 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| return (sp_Comment *)lv_instance; | |
| return NULL; | |
| } | |
| static sp_Comment * sp_Comment_cls__adapter_find_by_id(mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_Comment * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| #line 164 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| const char * _t189 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t189); | |
| const char * _t190 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t190); | |
| const char * _t191 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t191); | |
| const char * _t192 = sp_Db_cls_escape_int(sp_box_int(lv_id)); | |
| SP_GC_ROOT(_t192); | |
| const char * _t193 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t193); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat_arr((const char *const[]){_t189, _t190, _t191, _t192, _t193}, 5)); | |
| #line 165 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| lv_result = NULL; | |
| #line 166 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| #line 167 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| lv_result = sp_Comment_cls_from_stmt(sp_box_obj((void *)(lv_stmt), 0)); | |
| } | |
| #line 169 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 170 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| return (sp_Comment *)lv_result; | |
| return NULL; | |
| } | |
| static mrb_int sp_Comment_cls__adapter_count(void) { | |
| void * lv_stmt = NULL; | |
| mrb_int lv_result = 0; | |
| SP_GC_SAVE(); | |
| #line 197 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| lv_stmt = sp_Db_cls_prepare((&("\xff" "SELECT COUNT(*) FROM comments")[1])); | |
| #line 198 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Db_cls_step_p(lv_stmt); | |
| #line 199 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| lv_result = sp_Db_cls_column_int(sp_box_obj((void *)(lv_stmt), 0), 0LL); | |
| #line 200 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 201 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| return lv_result; | |
| return 0; | |
| } | |
| static mrb_int sp_Comment_cls__adapter_truncate(void) { | |
| SP_GC_SAVE(); | |
| #line 212 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Db_cls_exec((&("\xff" "DELETE FROM comments")[1])); | |
| #line 213 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| return sp_Db_cls_exec((&("\xff" "DELETE FROM sqlite_sequence WHERE name = 'comments'")[1])); | |
| return 0; | |
| } | |
| static sp_Comment * sp_Comment_cls_from_params(sp_CommentParams * lv_p) { | |
| SP_GC_SAVE(); | |
| sp_Comment * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT(lv_p); | |
| SP_GC_ROOT(lv_p); | |
| #line 232 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_StrIntHash * _t194 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t194); | |
| lv_instance = sp_Comment_new(_t194); | |
| #line 233 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_commenter_eq(lv_instance, sp_box_str(lv_p->iv_commenter)); | |
| #line 234 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| sp_Comment_body_eq(lv_instance, sp_box_str(lv_p->iv_body)); | |
| #line 235 "test/models/../../config/../app/controllers/../models/../views/articles/../../models/comment.rb" | |
| return (sp_Comment *)lv_instance; | |
| return NULL; | |
| } | |
| static sp_Comment * sp_Comment_cls_find(mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| sp_Comment * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| #line 194 "test/models/../../runtime/active_record/base.rb" | |
| lv_result = sp_Comment_cls__adapter_find_by_id(lv_id); | |
| #line 195 "test/models/../../runtime/active_record/base.rb" | |
| if ((lv_result == NULL)) { | |
| sp_raise_cls("RecordNotFound", sp_sprintf("Couldn't find %s with id=%lld", sp_class_to_s(((sp_Class){67LL})), (long long)lv_id)); | |
| } | |
| #line 196 "test/models/../../runtime/active_record/base.rb" | |
| return (sp_Comment *)lv_result; | |
| return NULL; | |
| } | |
| static mrb_int sp_Comment_cls_count(void) { | |
| SP_GC_SAVE(); | |
| #line 222 "test/models/../../runtime/active_record/base.rb" | |
| return sp_Comment_cls__adapter_count(); | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(ArticleRow) | |
| static inline sp_ArticleRow *sp_ArticleRow_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ArticleRow *self = SP_POOL_NEW(ArticleRow, sp_ArticleRow_gc_scan); | |
| self->cls_id = 68LL; | |
| SP_GC_ROOT(self); | |
| self->iv_body = NULL; | |
| self->iv_created_at = NULL; | |
| self->iv_title = NULL; | |
| self->iv_updated_at = NULL; | |
| self->iv_id = 0LL; | |
| self->iv_body = (&("\xff" "")[1]); | |
| self->iv_created_at = (&("\xff" "")[1]); | |
| self->iv_title = (&("\xff" "")[1]); | |
| self->iv_updated_at = (&("\xff" "")[1]); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ArticleRow_initialize(sp_ArticleRow *self) { | |
| #line 43 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| self->iv_id = 0LL; | |
| #line 44 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| self->iv_body = (&("\xff" "")[1]); | |
| #line 45 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| self->iv_created_at = (&("\xff" "")[1]); | |
| #line 46 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| self->iv_title = (&("\xff" "")[1]); | |
| #line 47 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| self->iv_updated_at = (&("\xff" "")[1]); | |
| } | |
| static inline mrb_int sp_ArticleRow_id(sp_ArticleRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 3 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| return self->iv_id; | |
| return 0; | |
| } | |
| static inline mrb_int sp_ArticleRow_id_eq(sp_ArticleRow *self, mrb_int lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 7 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| self->iv_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_ArticleRow_body(sp_ArticleRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 11 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| return self->iv_body; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_ArticleRow_body_eq(sp_ArticleRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| #line 15 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_ArticleRow_created_at(sp_ArticleRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 19 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| return self->iv_created_at; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_ArticleRow_created_at_eq(sp_ArticleRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| #line 23 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_ArticleRow_title(sp_ArticleRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 27 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| return self->iv_title; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_ArticleRow_title_eq(sp_ArticleRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| #line 31 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_ArticleRow_updated_at(sp_ArticleRow *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 35 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| return self->iv_updated_at; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_ArticleRow_updated_at_eq(sp_ArticleRow *self, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_value); | |
| #line 39 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static sp_ArticleRow * sp_ArticleRow_cls_from_raw(sp_StrPolyHash * lv_row) { | |
| SP_GC_SAVE(); | |
| sp_ArticleRow * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT(lv_row); | |
| SP_GC_ROOT(lv_row); | |
| #line 51 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| lv_instance = sp_ArticleRow_new(); | |
| #line 52 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| sp_RbVal _t195 = sp_StrPolyHash_get(lv_row, (&("\xff" "id")[1])); | |
| sp_RbVal _t197 = (sp_poly_truthy(_t195) ? _t195 : sp_box_int(0LL)); | |
| mrb_int _t196 = (_t197.tag == SP_TAG_INT) ? _t197.v.i : 0; | |
| sp_ArticleRow_id_eq(lv_instance, _t196); | |
| #line 53 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| sp_ArticleRow_body_eq(lv_instance, sp_poly_to_s(sp_StrPolyHash_get(lv_row, (&("\xff" "body")[1])))); | |
| #line 54 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| sp_ArticleRow_created_at_eq(lv_instance, sp_poly_to_s(sp_StrPolyHash_get(lv_row, (&("\xff" "created_at")[1])))); | |
| #line 55 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| sp_ArticleRow_title_eq(lv_instance, sp_poly_to_s(sp_StrPolyHash_get(lv_row, (&("\xff" "title")[1])))); | |
| #line 56 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| sp_ArticleRow_updated_at_eq(lv_instance, sp_poly_to_s(sp_StrPolyHash_get(lv_row, (&("\xff" "updated_at")[1])))); | |
| #line 57 "test/models/../../config/../app/controllers/../models/article_row.rb" | |
| return (sp_ArticleRow *)lv_instance; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Article) | |
| static inline sp_Article *sp_Article_new(sp_SymPolyHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article *self = SP_POOL_NEW(Article, sp_Article_gc_scan); | |
| self->cls_id = 69LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_id = sp_box_nil(); | |
| self->iv_body = NULL; | |
| self->iv_created_at = NULL; | |
| self->iv_title = NULL; | |
| self->iv_updated_at = NULL; | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t198 = sp_SymPolyHash_get((sp_SymPolyHash *)(lv_attrs), SPS_id); | |
| self->iv_id = ((!sp_int_is_nil(_t198)) ? sp_box_int(_t198) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t199 = sp_SymPolyHash_get((sp_SymPolyHash *)(lv_attrs), SPS_body); | |
| sp_Article__implicit_9372_body_eq(self, ((!sp_int_is_nil(_t199)) ? sp_box_int(_t199) : sp_box_str((&("\xff" "")[1])))); | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t200 = sp_SymPolyHash_get((sp_SymPolyHash *)(lv_attrs), SPS_created_at); | |
| sp_Article__implicit_9372_created_at_eq(self, ((!sp_int_is_nil(_t200)) ? sp_box_int(_t200) : sp_box_str((&("\xff" "")[1])))); | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t201 = sp_SymPolyHash_get((sp_SymPolyHash *)(lv_attrs), SPS_title); | |
| sp_Article__implicit_9372_title_eq(self, ((!sp_int_is_nil(_t201)) ? sp_box_int(_t201) : sp_box_str((&("\xff" "")[1])))); | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t202 = sp_SymPolyHash_get((sp_SymPolyHash *)(lv_attrs), SPS_updated_at); | |
| sp_Article__implicit_9372_updated_at_eq(self, ((!sp_int_is_nil(_t202)) ? sp_box_int(_t202) : sp_box_str((&("\xff" "")[1])))); | |
| self->iv_comments_cache = sp_PtrArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article_initialize(sp_Article *self, sp_SymPolyHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t203 = sp_SymPolyHash_get((sp_SymPolyHash *)(lv_attrs), SPS_id); | |
| self->iv_id = ((!sp_int_is_nil(_t203)) ? sp_box_int(_t203) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t204 = sp_SymPolyHash_get((sp_SymPolyHash *)(lv_attrs), SPS_body); | |
| sp_Article__implicit_9372_body_eq(self, ((!sp_int_is_nil(_t204)) ? sp_box_int(_t204) : sp_box_str((&("\xff" "")[1])))); | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t205 = sp_SymPolyHash_get((sp_SymPolyHash *)(lv_attrs), SPS_created_at); | |
| sp_Article__implicit_9372_created_at_eq(self, ((!sp_int_is_nil(_t205)) ? sp_box_int(_t205) : sp_box_str((&("\xff" "")[1])))); | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t206 = sp_SymPolyHash_get((sp_SymPolyHash *)(lv_attrs), SPS_title); | |
| sp_Article__implicit_9372_title_eq(self, ((!sp_int_is_nil(_t206)) ? sp_box_int(_t206) : sp_box_str((&("\xff" "")[1])))); | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t207 = sp_SymPolyHash_get((sp_SymPolyHash *)(lv_attrs), SPS_updated_at); | |
| sp_Article__implicit_9372_updated_at_eq(self, ((!sp_int_is_nil(_t207)) ? sp_box_int(_t207) : sp_box_str((&("\xff" "")[1])))); | |
| #line 97 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_cache = sp_PtrArray_new(); | |
| #line 98 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static sp_IntArray * sp_Article_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| #line 52 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_IntArray *_t208 = sp_IntArray_new(); | |
| sp_IntArray_push(_t208, SPS_id); | |
| sp_IntArray_push(_t208, SPS_body); | |
| sp_IntArray_push(_t208, SPS_created_at); | |
| sp_IntArray_push(_t208, SPS_title); | |
| sp_IntArray_push(_t208, SPS_updated_at); | |
| return _t208; | |
| return NULL; | |
| } | |
| static sp_Article * sp_Article_cls_from_row(sp_ArticleRow * lv_row) { | |
| SP_GC_SAVE(); | |
| sp_Article__implicit_6872 * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT(lv_row); | |
| SP_GC_ROOT(lv_row); | |
| #line 62 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_StrIntHash * _t209 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t209); | |
| lv_instance = sp_Article__implicit_6872_new(_t209); | |
| #line 63 "test/models/../../config/../app/controllers/../models/article.rb" | |
| lv_instance->iv_id = sp_box_int(lv_row->iv_id); | |
| #line 64 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_6872_body_eq(lv_instance, sp_box_str(lv_row->iv_body)); | |
| #line 65 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_6872_created_at_eq(lv_instance, sp_box_str(lv_row->iv_created_at)); | |
| #line 66 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_6872_title_eq(lv_instance, sp_box_str(lv_row->iv_title)); | |
| #line 67 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_6872_updated_at_eq(lv_instance, sp_box_str(lv_row->iv_updated_at)); | |
| #line 68 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return (sp_Article__implicit_6872 *)lv_instance; | |
| return NULL; | |
| } | |
| static sp_Article * sp_Article_cls_from_stmt(sp_RbVal lv_stmt) { | |
| SP_GC_SAVE(); | |
| sp_Article__implicit_6906 * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT_RBVAL(lv_stmt); | |
| #line 72 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_StrIntHash * _t210 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t210); | |
| lv_instance = sp_Article__implicit_6906_new(_t210); | |
| #line 73 "test/models/../../config/../app/controllers/../models/article.rb" | |
| lv_instance->iv_id = sp_box_int(sp_Db_cls_column_int(lv_stmt, 0LL)); | |
| #line 74 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_6906_body_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 1LL))); | |
| #line 75 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_6906_created_at_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 2LL))); | |
| #line 76 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_6906_title_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 3LL))); | |
| #line 77 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_6906_updated_at_eq(lv_instance, sp_box_str(sp_Db_cls_column_text(lv_stmt, 4LL))); | |
| #line 78 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)lv_instance); | |
| #line 79 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return (sp_Article__implicit_6906 *)lv_instance; | |
| return NULL; | |
| } | |
| static sp_Article * sp_Article_cls__adapter_find_by_id(mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_Article * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| #line 150 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t211 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles")[1]); | |
| SP_GC_ROOT(_t211); | |
| const char * _t212 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t212); | |
| const char * _t213 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t213); | |
| const char * _t214 = sp_Db_cls_escape_int(sp_box_int(lv_id)); | |
| SP_GC_ROOT(_t214); | |
| const char * _t215 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t215); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat_arr((const char *const[]){_t211, _t212, _t213, _t214, _t215}, 5)); | |
| #line 151 "test/models/../../config/../app/controllers/../models/article.rb" | |
| lv_result = NULL; | |
| #line 152 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| #line 153 "test/models/../../config/../app/controllers/../models/article.rb" | |
| lv_result = sp_Article_cls_from_stmt(sp_box_obj((void *)(lv_stmt), 0)); | |
| } | |
| #line 155 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 156 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return (sp_Article *)lv_result; | |
| return NULL; | |
| } | |
| static mrb_bool sp_Article_cls__adapter_exists_by_id_p(mrb_int lv_id) { | |
| void * lv_stmt = NULL; | |
| mrb_bool lv_result = FALSE; | |
| SP_GC_SAVE(); | |
| #line 191 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t216 = (&("\xff" "SELECT 1 FROM articles")[1]); | |
| SP_GC_ROOT(_t216); | |
| const char * _t217 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t217); | |
| const char * _t218 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t218); | |
| const char * _t219 = sp_Db_cls_escape_int(sp_box_int(lv_id)); | |
| SP_GC_ROOT(_t219); | |
| const char * _t220 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t220); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat_arr((const char *const[]){_t216, _t217, _t218, _t219, _t220}, 5)); | |
| #line 192 "test/models/../../config/../app/controllers/../models/article.rb" | |
| lv_result = sp_Db_cls_step_p(lv_stmt); | |
| #line 193 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 194 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return lv_result; | |
| return FALSE; | |
| } | |
| static mrb_int sp_Article_cls__adapter_truncate(void) { | |
| SP_GC_SAVE(); | |
| #line 198 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_exec((&("\xff" "DELETE FROM articles")[1])); | |
| #line 199 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_Db_cls_exec((&("\xff" "DELETE FROM sqlite_sequence WHERE name = 'articles'")[1])); | |
| return 0; | |
| } | |
| static sp_Article * sp_Article_cls_from_params(sp_ArticleParams * lv_p) { | |
| SP_GC_SAVE(); | |
| sp_Article__implicit_7484 * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT(lv_p); | |
| SP_GC_ROOT(lv_p); | |
| #line 217 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_StrIntHash * _t221 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t221); | |
| lv_instance = sp_Article__implicit_7484_new(_t221); | |
| #line 218 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_7484_title_eq(lv_instance, sp_box_str(lv_p->iv_title)); | |
| #line 219 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_7484_body_eq(lv_instance, sp_box_str(lv_p->iv_body)); | |
| #line 220 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return (sp_Article__implicit_7484 *)lv_instance; | |
| return NULL; | |
| } | |
| static sp_Article__implicit_6906 * sp_Article_cls_find(mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| sp_Article * lv_result = NULL; | |
| SP_GC_ROOT(lv_result); | |
| #line 194 "test/models/../../runtime/active_record/base.rb" | |
| lv_result = sp_Article_cls__adapter_find_by_id(lv_id); | |
| #line 195 "test/models/../../runtime/active_record/base.rb" | |
| if ((lv_result == NULL)) { | |
| sp_raise_cls("RecordNotFound", sp_sprintf("Couldn't find %s with id=%lld", sp_class_to_s(((sp_Class){69LL})), (long long)lv_id)); | |
| } | |
| #line 196 "test/models/../../runtime/active_record/base.rb" | |
| return (sp_Article *)lv_result; | |
| return NULL; | |
| } | |
| static mrb_bool sp_Article_cls_exists_p(sp_RbVal lv_id) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_id); | |
| #line 226 "test/models/../../runtime/active_record/base.rb" | |
| return sp_Article_cls__adapter_exists_by_id_p((lv_id).v.i); | |
| return FALSE; | |
| } | |
| SP_POOL_DEFINE(ArticleParams) | |
| static inline sp_ArticleParams *sp_ArticleParams_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ArticleParams *self = SP_POOL_NEW(ArticleParams, sp_ArticleParams_gc_scan); | |
| self->cls_id = 70LL; | |
| SP_GC_ROOT(self); | |
| self->iv_title = NULL; | |
| self->iv_body = NULL; | |
| self->iv_title = (&("\xff" "")[1]); | |
| self->iv_body = (&("\xff" "")[1]); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ArticleParams_initialize(sp_ArticleParams *self) { | |
| #line 3 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| self->iv_title = (&("\xff" "")[1]); | |
| #line 4 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| self->iv_body = (&("\xff" "")[1]); | |
| } | |
| static inline sp_RbVal sp_ArticleParams_title(sp_ArticleParams *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 8 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| sp_RbVal _t222 = sp_box_str(self->iv_title); | |
| SP_GC_RESTORE(); | |
| return _t222; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_ArticleParams_title_eq(sp_ArticleParams *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 12 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| self->iv_title = (lv_value).v.s; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_ArticleParams_body(sp_ArticleParams *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 16 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| sp_RbVal _t223 = sp_box_str(self->iv_body); | |
| SP_GC_RESTORE(); | |
| return _t223; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_ArticleParams_body_eq(sp_ArticleParams *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 20 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| self->iv_body = (lv_value).v.s; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_StrStrHash * sp_ArticleParams_to_h(sp_ArticleParams *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 47 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| sp_StrStrHash *_t224 = sp_StrStrHash_new(); | |
| SP_GC_ROOT(_t224); | |
| sp_StrStrHash_set(_t224, (&("\xff" "title")[1]), self->iv_title); | |
| sp_StrStrHash_set(_t224, (&("\xff" "body")[1]), self->iv_body); | |
| return _t224; | |
| return NULL; | |
| } | |
| static sp_ArticleParams * sp_ArticleParams_cls_from_raw(sp_StrPolyHash * lv_params) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_raw_sub = sp_box_nil(); | |
| sp_RbVal lv_sub = sp_box_nil(); | |
| sp_ArticleParams * lv_instance = NULL; | |
| sp_RbVal lv_raw_title = sp_box_nil(); | |
| sp_RbVal lv_raw_body = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_raw_sub); | |
| SP_GC_ROOT_RBVAL(lv_sub); | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT_RBVAL(lv_raw_title); | |
| SP_GC_ROOT_RBVAL(lv_raw_body); | |
| SP_GC_ROOT(lv_params); | |
| SP_GC_ROOT(lv_params); | |
| #line 24 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| lv_raw_sub = (sp_StrPolyHash_has_key(lv_params, (&("\xff" "article")[1])) ? sp_StrPolyHash_get(lv_params, (&("\xff" "article")[1])) : (sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH))); | |
| #line 25 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| sp_RbVal _t225 = lv_raw_sub; | |
| lv_sub = ((_t225.tag == SP_TAG_OBJ && (_t225.cls_id == SP_BUILTIN_STR_INT_HASH || _t225.cls_id == SP_BUILTIN_STR_STR_HASH || _t225.cls_id == SP_BUILTIN_INT_STR_HASH || _t225.cls_id == SP_BUILTIN_SYM_INT_HASH || _t225.cls_id == SP_BUILTIN_SYM_STR_HASH || _t225.cls_id == SP_BUILTIN_STR_POLY_HASH || _t225.cls_id == SP_BUILTIN_SYM_POLY_HASH)) ? lv_raw_sub : sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH)); | |
| #line 30 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| lv_instance = sp_ArticleParams_new(); | |
| #line 31 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| sp_RbVal _t226 = lv_sub; | |
| sp_RbVal _t227 = sp_box_nil(); | |
| if (_t226.tag == SP_TAG_OBJ) { | |
| if (_t226.cls_id == 55) _t227 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t226.v.p, (&("\xff" "title")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t226.cls_id == 56) _t227 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t226.v.p, (&("\xff" "title")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t226.cls_id == SP_BUILTIN_STR_INT_HASH) _t227 = sp_StrIntHash_has_key((sp_StrIntHash *)_t226.v.p, (&("\xff" "title")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t226.v.p, (&("\xff" "title")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t226.cls_id == SP_BUILTIN_STR_STR_HASH) _t227 = sp_StrStrHash_has_key((sp_StrStrHash *)_t226.v.p, (&("\xff" "title")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t226.v.p, (&("\xff" "title")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t226.cls_id == SP_BUILTIN_STR_POLY_HASH) _t227 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t226.v.p, (&("\xff" "title")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t226.v.p, (&("\xff" "title")[1])) : sp_box_str((&("\xff" "")[1])); | |
| } | |
| lv_raw_title = _t227; | |
| #line 32 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| sp_RbVal _t228 = lv_raw_title; | |
| sp_ArticleParams_title_eq(lv_instance, ((_t228.tag == SP_TAG_STR) ? lv_raw_title : sp_box_str((&("\xff" "")[1])))); | |
| #line 37 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| sp_RbVal _t229 = lv_sub; | |
| sp_RbVal _t230 = sp_box_nil(); | |
| if (_t229.tag == SP_TAG_OBJ) { | |
| if (_t229.cls_id == 55) _t230 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t229.v.p, (&("\xff" "body")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t229.cls_id == 56) _t230 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t229.v.p, (&("\xff" "body")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t229.cls_id == SP_BUILTIN_STR_INT_HASH) _t230 = sp_StrIntHash_has_key((sp_StrIntHash *)_t229.v.p, (&("\xff" "body")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t229.v.p, (&("\xff" "body")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t229.cls_id == SP_BUILTIN_STR_STR_HASH) _t230 = sp_StrStrHash_has_key((sp_StrStrHash *)_t229.v.p, (&("\xff" "body")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t229.v.p, (&("\xff" "body")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t229.cls_id == SP_BUILTIN_STR_POLY_HASH) _t230 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t229.v.p, (&("\xff" "body")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t229.v.p, (&("\xff" "body")[1])) : sp_box_str((&("\xff" "")[1])); | |
| } | |
| lv_raw_body = _t230; | |
| #line 38 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| sp_RbVal _t231 = lv_raw_body; | |
| sp_ArticleParams_body_eq(lv_instance, ((_t231.tag == SP_TAG_STR) ? lv_raw_body : sp_box_str((&("\xff" "")[1])))); | |
| #line 43 "test/models/../../config/../app/controllers/../models/article_params.rb" | |
| return (sp_ArticleParams *)lv_instance; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(ArticlesController) | |
| static inline sp_ArticlesController *sp_ArticlesController_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ArticlesController *self = SP_POOL_NEW(ArticlesController, sp_ArticlesController_gc_scan); | |
| self->cls_id = 71LL; | |
| SP_GC_ROOT(self); | |
| self->iv_params = sp_box_nil(); | |
| self->iv_session = NULL; | |
| self->iv_flash = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_location = NULL; | |
| self->iv_content_type = NULL; | |
| self->iv_request_method = NULL; | |
| self->iv_request_path = NULL; | |
| self->iv_articles = NULL; | |
| self->iv_article = sp_box_nil(); | |
| sp_ActionController_Base_initialize((sp_ActionController_Base *)self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline mrb_int sp_ArticlesController_process_action(sp_ArticlesController *self, sp_sym lv_action_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 10 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| mrb_int _t232 = lv_action_name; | |
| if (_t232 == SPS_index) { | |
| #line 12 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| return sp_ArticlesController_index(self); | |
| } else if (_t232 == SPS_show) { | |
| #line 14 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| return sp_ArticlesController_show(self); | |
| } else if (_t232 == SPS_new) { | |
| #line 16 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| return sp_ArticlesController_new_action(self); | |
| } else if (_t232 == SPS_edit) { | |
| #line 18 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| return sp_ArticlesController_edit(self); | |
| } else if (_t232 == SPS_create) { | |
| #line 20 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| return sp_ArticlesController_create(self); | |
| } else if (_t232 == SPS_update) { | |
| #line 22 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| return sp_ArticlesController_update(self); | |
| } else if (_t232 == SPS_destroy) { | |
| #line 24 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| return sp_ArticlesController_destroy(self); | |
| } | |
| return 0; | |
| } | |
| static mrb_int sp_ArticlesController_index(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_PtrArray * lv_results = NULL; | |
| sp_PolyArray * lv___comments_ids = NULL; | |
| sp_Article * lv_a = NULL; | |
| void * lv___comments_stmt = NULL; | |
| sp_PtrArray * lv___comments_loaded = NULL; | |
| sp_PtrArray * lv___comments_group = NULL; | |
| sp_Comment * lv_r = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(lv___comments_ids); | |
| SP_GC_ROOT(lv_a); | |
| SP_GC_ROOT(lv___comments_loaded); | |
| SP_GC_ROOT(lv___comments_group); | |
| SP_GC_ROOT(lv_r); | |
| SP_GC_ROOT(self); | |
| #line 29 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat((&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles")[1]), (&("\xff" " ORDER BY created_at DESC")[1]))); | |
| #line 30 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| lv_results = sp_PtrArray_new(); | |
| #line 31 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_15: ; | |
| #line 32 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_PtrArray_push(lv_results, sp_Article_cls_from_stmt(sp_box_obj((void *)(lv_stmt), 0))); | |
| } | |
| #line 34 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 35 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| SP_GC_ROOT(lv_results); | |
| sp_PolyArray *_t233 = sp_PolyArray_new(); | |
| SP_GC_ROOT(_t233); | |
| for (mrb_int _t234 = 0; _t234 < sp_PtrArray_length(lv_results); _t234++) { | |
| sp_Article * lv_a = (sp_Article *)sp_PtrArray_get(lv_results, _t234); | |
| sp_PolyArray_push(_t233, lv_a->iv_id); | |
| } | |
| lv___comments_ids = _t233; | |
| #line 36 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| const char * _t235 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments WHERE article_id IN (")[1]); | |
| SP_GC_ROOT(_t235); | |
| const char * _t236 = sp_Db_cls_escape_int_list((sp_PolyArray *)lv___comments_ids); | |
| SP_GC_ROOT(_t236); | |
| const char * _t237 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t237); | |
| lv___comments_stmt = sp_Db_cls_prepare(sp_str_concat3(_t235, _t236, _t237)); | |
| #line 37 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| lv___comments_loaded = sp_PtrArray_new(); | |
| #line 38 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| while (sp_Db_cls_step_p(lv___comments_stmt)) { | |
| sp_redo_16: ; | |
| #line 39 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_PtrArray_push(lv___comments_loaded, sp_Comment_cls_from_stmt(sp_box_obj((void *)(lv___comments_stmt), 0))); | |
| } | |
| #line 41 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_Db_cls_finalize(lv___comments_stmt); | |
| #line 42 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| for (mrb_int _t238 = 0; _t238 < sp_PtrArray_length(lv_results); _t238++) { | |
| sp_Article * _t239 = (sp_Article *)sp_PtrArray_get(lv_results, _t238); | |
| lv_a = _t239; | |
| sp_redo_17: ; | |
| lv___comments_group = sp_PtrArray_new(); | |
| #line 43 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| for (mrb_int _t240 = 0; _t240 < sp_PtrArray_length(lv___comments_loaded); _t240++) { | |
| sp_Comment * _t241 = (sp_Comment *)sp_PtrArray_get(lv___comments_loaded, _t240); | |
| lv_r = _t241; | |
| sp_redo_18: ; | |
| if (sp_poly_eq(sp_box_int(lv_r->iv_article_id), lv_a->iv_id)) { | |
| sp_PtrArray_push(lv___comments_group, lv_r); | |
| } | |
| } | |
| #line 44 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_Article__preload_comments(lv_a, lv___comments_group); | |
| } | |
| #line 45 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| self->iv_articles = lv_results; | |
| #line 46 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| if ((self->iv_request_format == SPS_json)) { | |
| #line 47 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_Views_Articles_cls_index_json(self->iv_articles), SPS_ok, (&("\xff" "application/json")[1]), NULL); | |
| } else { | |
| #line 49 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t242 = self->iv_flash; | |
| sp_RbVal _t243 = sp_box_nil(); | |
| if (_t242.tag == SP_TAG_OBJ) { | |
| if (_t242.cls_id == 52) _t243 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t242.v.p, SPS_notice); | |
| if (_t242.cls_id == 55) _t243 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t242.v.p, sp_box_sym(SPS_notice))); | |
| if (_t242.cls_id == 56) _t243 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t242.v.p, sp_box_sym(SPS_notice)); | |
| if (_t242.cls_id == 65) _t243 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t242.v.p, SPS_notice); | |
| if (_t242.cls_id == 67) _t243 = sp_Comment__aref((sp_Comment *)_t242.v.p, SPS_notice); | |
| if (_t242.cls_id == 78) _t243 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t242.v.p, sp_box_sym(SPS_notice)); | |
| if (_t242.cls_id == 79) _t243 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t242.v.p, sp_box_sym(SPS_notice)); | |
| if (_t242.cls_id == 80) _t243 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t242.v.p, sp_box_sym(SPS_notice)); | |
| if (_t242.cls_id == 81) _t243 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t242.v.p, sp_box_sym(SPS_notice)); | |
| if (_t242.cls_id == 82) _t243 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t242.v.p, sp_box_sym(SPS_notice)); | |
| if (_t242.cls_id == 83) _t243 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t242.v.p, sp_box_sym(SPS_notice)); | |
| if (_t242.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t243 = sp_SymPolyHash_get((sp_SymPolyHash *)_t242.v.p, SPS_notice); | |
| if (_t242.cls_id == SP_BUILTIN_SYM_INT_HASH) _t243 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t242.v.p, SPS_notice)); | |
| if (_t242.cls_id == SP_BUILTIN_SYM_STR_HASH) _t243 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t242.v.p, SPS_notice)); | |
| } | |
| sp_RbVal _t244 = self->iv_flash; | |
| sp_RbVal _t245 = sp_box_nil(); | |
| if (_t244.tag == SP_TAG_OBJ) { | |
| if (_t244.cls_id == 52) _t245 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t244.v.p, SPS_alert); | |
| if (_t244.cls_id == 55) _t245 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t244.v.p, sp_box_sym(SPS_alert))); | |
| if (_t244.cls_id == 56) _t245 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t244.v.p, sp_box_sym(SPS_alert)); | |
| if (_t244.cls_id == 65) _t245 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t244.v.p, SPS_alert); | |
| if (_t244.cls_id == 67) _t245 = sp_Comment__aref((sp_Comment *)_t244.v.p, SPS_alert); | |
| if (_t244.cls_id == 78) _t245 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t244.v.p, sp_box_sym(SPS_alert)); | |
| if (_t244.cls_id == 79) _t245 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t244.v.p, sp_box_sym(SPS_alert)); | |
| if (_t244.cls_id == 80) _t245 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t244.v.p, sp_box_sym(SPS_alert)); | |
| if (_t244.cls_id == 81) _t245 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t244.v.p, sp_box_sym(SPS_alert)); | |
| if (_t244.cls_id == 82) _t245 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t244.v.p, sp_box_sym(SPS_alert)); | |
| if (_t244.cls_id == 83) _t245 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t244.v.p, sp_box_sym(SPS_alert)); | |
| if (_t244.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t245 = sp_SymPolyHash_get((sp_SymPolyHash *)_t244.v.p, SPS_alert); | |
| if (_t244.cls_id == SP_BUILTIN_SYM_INT_HASH) _t245 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t244.v.p, SPS_alert)); | |
| if (_t244.cls_id == SP_BUILTIN_SYM_STR_HASH) _t245 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t244.v.p, SPS_alert)); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_str_dup_external((sp_Views_Articles_cls_index(self->iv_articles, _t243, _t245))->data), SPS_ok, NULL, NULL); | |
| } | |
| return 0; | |
| } | |
| static mrb_int sp_ArticlesController_show(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 54 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t246 = self->iv_params; | |
| sp_RbVal _t247 = sp_box_nil(); | |
| if (_t246.tag == SP_TAG_OBJ) { | |
| if (_t246.cls_id == 55) _t247 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t246.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t246.cls_id == 56) _t247 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t246.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t246.cls_id == SP_BUILTIN_STR_INT_HASH) _t247 = sp_StrIntHash_has_key((sp_StrIntHash *)_t246.v.p, (&("\xff" "id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t246.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t246.cls_id == SP_BUILTIN_STR_STR_HASH) _t247 = sp_StrStrHash_has_key((sp_StrStrHash *)_t246.v.p, (&("\xff" "id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t246.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t246.cls_id == SP_BUILTIN_STR_POLY_HASH) _t247 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t246.v.p, (&("\xff" "id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t246.v.p, (&("\xff" "id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t248 = sp_poly_to_s(_t247); | |
| SP_GC_ROOT(_t248); | |
| self->iv_article = sp_box_nullable_obj(sp_Article_cls_find(sp_str_to_i_cruby(_t248)), 79); | |
| #line 55 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| if ((self->iv_request_format == SPS_json)) { | |
| #line 56 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_Views_Articles_cls_show_json(((sp_Article *)(self->iv_article).v.p)), SPS_ok, (&("\xff" "application/json")[1]), NULL); | |
| } else { | |
| #line 58 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t249 = self->iv_flash; | |
| sp_RbVal _t250 = sp_box_nil(); | |
| if (_t249.tag == SP_TAG_OBJ) { | |
| if (_t249.cls_id == 52) _t250 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t249.v.p, SPS_notice); | |
| if (_t249.cls_id == 55) _t250 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t249.v.p, sp_box_sym(SPS_notice))); | |
| if (_t249.cls_id == 56) _t250 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t249.v.p, sp_box_sym(SPS_notice)); | |
| if (_t249.cls_id == 65) _t250 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t249.v.p, SPS_notice); | |
| if (_t249.cls_id == 67) _t250 = sp_Comment__aref((sp_Comment *)_t249.v.p, SPS_notice); | |
| if (_t249.cls_id == 78) _t250 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t249.v.p, sp_box_sym(SPS_notice)); | |
| if (_t249.cls_id == 79) _t250 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t249.v.p, sp_box_sym(SPS_notice)); | |
| if (_t249.cls_id == 80) _t250 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t249.v.p, sp_box_sym(SPS_notice)); | |
| if (_t249.cls_id == 81) _t250 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t249.v.p, sp_box_sym(SPS_notice)); | |
| if (_t249.cls_id == 82) _t250 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t249.v.p, sp_box_sym(SPS_notice)); | |
| if (_t249.cls_id == 83) _t250 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t249.v.p, sp_box_sym(SPS_notice)); | |
| if (_t249.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t250 = sp_SymPolyHash_get((sp_SymPolyHash *)_t249.v.p, SPS_notice); | |
| if (_t249.cls_id == SP_BUILTIN_SYM_INT_HASH) _t250 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t249.v.p, SPS_notice)); | |
| if (_t249.cls_id == SP_BUILTIN_SYM_STR_HASH) _t250 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t249.v.p, SPS_notice)); | |
| } | |
| sp_RbVal _t251 = self->iv_flash; | |
| sp_RbVal _t252 = sp_box_nil(); | |
| if (_t251.tag == SP_TAG_OBJ) { | |
| if (_t251.cls_id == 52) _t252 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t251.v.p, SPS_alert); | |
| if (_t251.cls_id == 55) _t252 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t251.v.p, sp_box_sym(SPS_alert))); | |
| if (_t251.cls_id == 56) _t252 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t251.v.p, sp_box_sym(SPS_alert)); | |
| if (_t251.cls_id == 65) _t252 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t251.v.p, SPS_alert); | |
| if (_t251.cls_id == 67) _t252 = sp_Comment__aref((sp_Comment *)_t251.v.p, SPS_alert); | |
| if (_t251.cls_id == 78) _t252 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t251.v.p, sp_box_sym(SPS_alert)); | |
| if (_t251.cls_id == 79) _t252 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t251.v.p, sp_box_sym(SPS_alert)); | |
| if (_t251.cls_id == 80) _t252 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t251.v.p, sp_box_sym(SPS_alert)); | |
| if (_t251.cls_id == 81) _t252 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t251.v.p, sp_box_sym(SPS_alert)); | |
| if (_t251.cls_id == 82) _t252 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t251.v.p, sp_box_sym(SPS_alert)); | |
| if (_t251.cls_id == 83) _t252 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t251.v.p, sp_box_sym(SPS_alert)); | |
| if (_t251.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t252 = sp_SymPolyHash_get((sp_SymPolyHash *)_t251.v.p, SPS_alert); | |
| if (_t251.cls_id == SP_BUILTIN_SYM_INT_HASH) _t252 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t251.v.p, SPS_alert)); | |
| if (_t251.cls_id == SP_BUILTIN_SYM_STR_HASH) _t252 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t251.v.p, SPS_alert)); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_str_dup_external((sp_Views_Articles_cls_show(self->iv_article, _t250, _t252))->data), SPS_ok, NULL, NULL); | |
| } | |
| return 0; | |
| } | |
| static inline mrb_int sp_ArticlesController_new_action(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 63 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_StrIntHash * _t253 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t253); | |
| self->iv_article = sp_box_obj(sp_Article__implicit_7995_new(_t253), 81); | |
| #line 64 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t254 = self->iv_flash; | |
| sp_RbVal _t255 = sp_box_nil(); | |
| if (_t254.tag == SP_TAG_OBJ) { | |
| if (_t254.cls_id == 52) _t255 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t254.v.p, SPS_notice); | |
| if (_t254.cls_id == 55) _t255 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t254.v.p, sp_box_sym(SPS_notice))); | |
| if (_t254.cls_id == 56) _t255 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 65) _t255 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t254.v.p, SPS_notice); | |
| if (_t254.cls_id == 67) _t255 = sp_Comment__aref((sp_Comment *)_t254.v.p, SPS_notice); | |
| if (_t254.cls_id == 78) _t255 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 79) _t255 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 80) _t255 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 81) _t255 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 82) _t255 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == 83) _t255 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t254.v.p, sp_box_sym(SPS_notice)); | |
| if (_t254.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t255 = sp_SymPolyHash_get((sp_SymPolyHash *)_t254.v.p, SPS_notice); | |
| if (_t254.cls_id == SP_BUILTIN_SYM_INT_HASH) _t255 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t254.v.p, SPS_notice)); | |
| if (_t254.cls_id == SP_BUILTIN_SYM_STR_HASH) _t255 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t254.v.p, SPS_notice)); | |
| } | |
| sp_RbVal _t256 = self->iv_flash; | |
| sp_RbVal _t257 = sp_box_nil(); | |
| if (_t256.tag == SP_TAG_OBJ) { | |
| if (_t256.cls_id == 52) _t257 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t256.v.p, SPS_alert); | |
| if (_t256.cls_id == 55) _t257 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t256.v.p, sp_box_sym(SPS_alert))); | |
| if (_t256.cls_id == 56) _t257 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 65) _t257 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t256.v.p, SPS_alert); | |
| if (_t256.cls_id == 67) _t257 = sp_Comment__aref((sp_Comment *)_t256.v.p, SPS_alert); | |
| if (_t256.cls_id == 78) _t257 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 79) _t257 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 80) _t257 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 81) _t257 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 82) _t257 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == 83) _t257 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t256.v.p, sp_box_sym(SPS_alert)); | |
| if (_t256.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t257 = sp_SymPolyHash_get((sp_SymPolyHash *)_t256.v.p, SPS_alert); | |
| if (_t256.cls_id == SP_BUILTIN_SYM_INT_HASH) _t257 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t256.v.p, SPS_alert)); | |
| if (_t256.cls_id == SP_BUILTIN_SYM_STR_HASH) _t257 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t256.v.p, SPS_alert)); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_str_dup_external((sp_Views_Articles_cls_new(self->iv_article, _t255, _t257))->data), SPS_ok, NULL, NULL); | |
| return 0; | |
| } | |
| static mrb_int sp_ArticlesController_edit(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 68 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t258 = self->iv_params; | |
| sp_RbVal _t259 = sp_box_nil(); | |
| if (_t258.tag == SP_TAG_OBJ) { | |
| if (_t258.cls_id == 55) _t259 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t258.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t258.cls_id == 56) _t259 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t258.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t258.cls_id == SP_BUILTIN_STR_INT_HASH) _t259 = sp_StrIntHash_has_key((sp_StrIntHash *)_t258.v.p, (&("\xff" "id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t258.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t258.cls_id == SP_BUILTIN_STR_STR_HASH) _t259 = sp_StrStrHash_has_key((sp_StrStrHash *)_t258.v.p, (&("\xff" "id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t258.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t258.cls_id == SP_BUILTIN_STR_POLY_HASH) _t259 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t258.v.p, (&("\xff" "id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t258.v.p, (&("\xff" "id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t260 = sp_poly_to_s(_t259); | |
| SP_GC_ROOT(_t260); | |
| self->iv_article = sp_box_nullable_obj(sp_Article_cls_find(sp_str_to_i_cruby(_t260)), 79); | |
| #line 69 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t261 = self->iv_flash; | |
| sp_RbVal _t262 = sp_box_nil(); | |
| if (_t261.tag == SP_TAG_OBJ) { | |
| if (_t261.cls_id == 52) _t262 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t261.v.p, SPS_notice); | |
| if (_t261.cls_id == 55) _t262 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t261.v.p, sp_box_sym(SPS_notice))); | |
| if (_t261.cls_id == 56) _t262 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 65) _t262 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t261.v.p, SPS_notice); | |
| if (_t261.cls_id == 67) _t262 = sp_Comment__aref((sp_Comment *)_t261.v.p, SPS_notice); | |
| if (_t261.cls_id == 78) _t262 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 79) _t262 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 80) _t262 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 81) _t262 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 82) _t262 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == 83) _t262 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t261.v.p, sp_box_sym(SPS_notice)); | |
| if (_t261.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t262 = sp_SymPolyHash_get((sp_SymPolyHash *)_t261.v.p, SPS_notice); | |
| if (_t261.cls_id == SP_BUILTIN_SYM_INT_HASH) _t262 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t261.v.p, SPS_notice)); | |
| if (_t261.cls_id == SP_BUILTIN_SYM_STR_HASH) _t262 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t261.v.p, SPS_notice)); | |
| } | |
| sp_RbVal _t263 = self->iv_flash; | |
| sp_RbVal _t264 = sp_box_nil(); | |
| if (_t263.tag == SP_TAG_OBJ) { | |
| if (_t263.cls_id == 52) _t264 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t263.v.p, SPS_alert); | |
| if (_t263.cls_id == 55) _t264 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t263.v.p, sp_box_sym(SPS_alert))); | |
| if (_t263.cls_id == 56) _t264 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 65) _t264 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t263.v.p, SPS_alert); | |
| if (_t263.cls_id == 67) _t264 = sp_Comment__aref((sp_Comment *)_t263.v.p, SPS_alert); | |
| if (_t263.cls_id == 78) _t264 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 79) _t264 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 80) _t264 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 81) _t264 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 82) _t264 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == 83) _t264 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t263.v.p, sp_box_sym(SPS_alert)); | |
| if (_t263.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t264 = sp_SymPolyHash_get((sp_SymPolyHash *)_t263.v.p, SPS_alert); | |
| if (_t263.cls_id == SP_BUILTIN_SYM_INT_HASH) _t264 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t263.v.p, SPS_alert)); | |
| if (_t263.cls_id == SP_BUILTIN_SYM_STR_HASH) _t264 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t263.v.p, SPS_alert)); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_str_dup_external((sp_Views_Articles_cls_edit(self->iv_article, _t262, _t264))->data), SPS_ok, NULL, NULL); | |
| return 0; | |
| } | |
| static inline mrb_int sp_ArticlesController_create(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 73 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| self->iv_article = sp_box_obj(sp_Article_cls_from_params(sp_ArticlesController_article_params(self)), 69); | |
| #line 74 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t265 = self->iv_article; | |
| mrb_bool _t266 = FALSE; | |
| if (_t265.tag == SP_TAG_OBJ) { | |
| if (_t265.cls_id == 80) _t266 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t265.v.p); | |
| if (_t265.cls_id == 81) _t266 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t265.v.p); | |
| } | |
| if (_t266) { | |
| #line 75 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| if ((self->iv_request_format == SPS_json)) { | |
| #line 76 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| const char * _t267 = sp_Views_Articles_cls_show_json(((sp_Article *)(self->iv_article).v.p)); | |
| SP_GC_ROOT(_t267); | |
| const char * _t268 = (&("\xff" "application/json")[1]); | |
| SP_GC_ROOT(_t268); | |
| sp_RbVal _t269 = self->iv_article; | |
| sp_RbVal _t270 = sp_box_nil(); | |
| if (_t269.tag == SP_TAG_OBJ) { | |
| if (_t269.cls_id == 80) _t270 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t269.v.p); | |
| if (_t269.cls_id == 81) _t270 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t269.v.p); | |
| } | |
| const char * _t271 = sp_RouteHelpers_cls_article_path((_t270).v.i); | |
| SP_GC_ROOT(_t271); | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, _t267, SPS_created, _t268, _t271); | |
| } else { | |
| #line 78 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t272 = self->iv_article; | |
| sp_RbVal _t273 = sp_box_nil(); | |
| if (_t272.tag == SP_TAG_OBJ) { | |
| if (_t272.cls_id == 80) _t273 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t272.v.p); | |
| if (_t272.cls_id == 81) _t273 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t272.v.p); | |
| } | |
| return sp_ActionController_Base_redirect_to((sp_ActionController_Base *)self, sp_RouteHelpers_cls_article_path((_t273).v.i), (&("\xff" "Article was successfully created.")[1]), NULL, SPS_found); | |
| } | |
| } else { | |
| #line 81 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t274 = self->iv_flash; | |
| sp_RbVal _t275 = sp_box_nil(); | |
| if (_t274.tag == SP_TAG_OBJ) { | |
| if (_t274.cls_id == 52) _t275 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t274.v.p, SPS_notice); | |
| if (_t274.cls_id == 55) _t275 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t274.v.p, sp_box_sym(SPS_notice))); | |
| if (_t274.cls_id == 56) _t275 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t274.v.p, sp_box_sym(SPS_notice)); | |
| if (_t274.cls_id == 65) _t275 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t274.v.p, SPS_notice); | |
| if (_t274.cls_id == 67) _t275 = sp_Comment__aref((sp_Comment *)_t274.v.p, SPS_notice); | |
| if (_t274.cls_id == 78) _t275 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t274.v.p, sp_box_sym(SPS_notice)); | |
| if (_t274.cls_id == 79) _t275 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t274.v.p, sp_box_sym(SPS_notice)); | |
| if (_t274.cls_id == 80) _t275 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t274.v.p, sp_box_sym(SPS_notice)); | |
| if (_t274.cls_id == 81) _t275 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t274.v.p, sp_box_sym(SPS_notice)); | |
| if (_t274.cls_id == 82) _t275 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t274.v.p, sp_box_sym(SPS_notice)); | |
| if (_t274.cls_id == 83) _t275 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t274.v.p, sp_box_sym(SPS_notice)); | |
| if (_t274.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t275 = sp_SymPolyHash_get((sp_SymPolyHash *)_t274.v.p, SPS_notice); | |
| if (_t274.cls_id == SP_BUILTIN_SYM_INT_HASH) _t275 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t274.v.p, SPS_notice)); | |
| if (_t274.cls_id == SP_BUILTIN_SYM_STR_HASH) _t275 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t274.v.p, SPS_notice)); | |
| } | |
| sp_RbVal _t276 = self->iv_flash; | |
| sp_RbVal _t277 = sp_box_nil(); | |
| if (_t276.tag == SP_TAG_OBJ) { | |
| if (_t276.cls_id == 52) _t277 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t276.v.p, SPS_alert); | |
| if (_t276.cls_id == 55) _t277 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t276.v.p, sp_box_sym(SPS_alert))); | |
| if (_t276.cls_id == 56) _t277 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t276.v.p, sp_box_sym(SPS_alert)); | |
| if (_t276.cls_id == 65) _t277 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t276.v.p, SPS_alert); | |
| if (_t276.cls_id == 67) _t277 = sp_Comment__aref((sp_Comment *)_t276.v.p, SPS_alert); | |
| if (_t276.cls_id == 78) _t277 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t276.v.p, sp_box_sym(SPS_alert)); | |
| if (_t276.cls_id == 79) _t277 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t276.v.p, sp_box_sym(SPS_alert)); | |
| if (_t276.cls_id == 80) _t277 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t276.v.p, sp_box_sym(SPS_alert)); | |
| if (_t276.cls_id == 81) _t277 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t276.v.p, sp_box_sym(SPS_alert)); | |
| if (_t276.cls_id == 82) _t277 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t276.v.p, sp_box_sym(SPS_alert)); | |
| if (_t276.cls_id == 83) _t277 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t276.v.p, sp_box_sym(SPS_alert)); | |
| if (_t276.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t277 = sp_SymPolyHash_get((sp_SymPolyHash *)_t276.v.p, SPS_alert); | |
| if (_t276.cls_id == SP_BUILTIN_SYM_INT_HASH) _t277 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t276.v.p, SPS_alert)); | |
| if (_t276.cls_id == SP_BUILTIN_SYM_STR_HASH) _t277 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t276.v.p, SPS_alert)); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_str_dup_external((sp_Views_Articles_cls_new(self->iv_article, _t275, _t277))->data), SPS_unprocessable_content, NULL, NULL); | |
| } | |
| return 0; | |
| } | |
| static inline mrb_int sp_ArticlesController_update(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 86 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t278 = self->iv_params; | |
| sp_RbVal _t279 = sp_box_nil(); | |
| if (_t278.tag == SP_TAG_OBJ) { | |
| if (_t278.cls_id == 55) _t279 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t278.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t278.cls_id == 56) _t279 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t278.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t278.cls_id == SP_BUILTIN_STR_INT_HASH) _t279 = sp_StrIntHash_has_key((sp_StrIntHash *)_t278.v.p, (&("\xff" "id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t278.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t278.cls_id == SP_BUILTIN_STR_STR_HASH) _t279 = sp_StrStrHash_has_key((sp_StrStrHash *)_t278.v.p, (&("\xff" "id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t278.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t278.cls_id == SP_BUILTIN_STR_POLY_HASH) _t279 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t278.v.p, (&("\xff" "id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t278.v.p, (&("\xff" "id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t280 = sp_poly_to_s(_t279); | |
| SP_GC_ROOT(_t280); | |
| self->iv_article = sp_box_nullable_obj(sp_Article_cls_find(sp_str_to_i_cruby(_t280)), 79); | |
| #line 87 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t281 = self->iv_article; | |
| mrb_bool _t282 = FALSE; | |
| if (_t281.tag == SP_TAG_OBJ) { | |
| if (_t281.cls_id == 80) _t282 = sp_Article__implicit_7484_update((sp_Article__implicit_7484 *)_t281.v.p, sp_ArticlesController_article_params(self)); | |
| if (_t281.cls_id == 81) _t282 = sp_Article__implicit_7995_update((sp_Article__implicit_7995 *)_t281.v.p, sp_ArticlesController_article_params(self)); | |
| } | |
| if (_t282) { | |
| #line 88 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| if ((self->iv_request_format == SPS_json)) { | |
| #line 89 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| const char * _t283 = sp_Views_Articles_cls_show_json(((sp_Article *)(self->iv_article).v.p)); | |
| SP_GC_ROOT(_t283); | |
| const char * _t284 = (&("\xff" "application/json")[1]); | |
| SP_GC_ROOT(_t284); | |
| sp_RbVal _t285 = self->iv_article; | |
| sp_RbVal _t286 = sp_box_nil(); | |
| if (_t285.tag == SP_TAG_OBJ) { | |
| if (_t285.cls_id == 80) _t286 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t285.v.p); | |
| if (_t285.cls_id == 81) _t286 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t285.v.p); | |
| } | |
| const char * _t287 = sp_RouteHelpers_cls_article_path((_t286).v.i); | |
| SP_GC_ROOT(_t287); | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, _t283, SPS_ok, _t284, _t287); | |
| } else { | |
| #line 91 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t288 = self->iv_article; | |
| sp_RbVal _t289 = sp_box_nil(); | |
| if (_t288.tag == SP_TAG_OBJ) { | |
| if (_t288.cls_id == 80) _t289 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t288.v.p); | |
| if (_t288.cls_id == 81) _t289 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t288.v.p); | |
| } | |
| return sp_ActionController_Base_redirect_to((sp_ActionController_Base *)self, sp_RouteHelpers_cls_article_path((_t289).v.i), (&("\xff" "Article was successfully updated.")[1]), NULL, SPS_see_other); | |
| } | |
| } else { | |
| #line 94 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t290 = self->iv_flash; | |
| sp_RbVal _t291 = sp_box_nil(); | |
| if (_t290.tag == SP_TAG_OBJ) { | |
| if (_t290.cls_id == 52) _t291 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t290.v.p, SPS_notice); | |
| if (_t290.cls_id == 55) _t291 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t290.v.p, sp_box_sym(SPS_notice))); | |
| if (_t290.cls_id == 56) _t291 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t290.v.p, sp_box_sym(SPS_notice)); | |
| if (_t290.cls_id == 65) _t291 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t290.v.p, SPS_notice); | |
| if (_t290.cls_id == 67) _t291 = sp_Comment__aref((sp_Comment *)_t290.v.p, SPS_notice); | |
| if (_t290.cls_id == 78) _t291 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t290.v.p, sp_box_sym(SPS_notice)); | |
| if (_t290.cls_id == 79) _t291 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t290.v.p, sp_box_sym(SPS_notice)); | |
| if (_t290.cls_id == 80) _t291 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t290.v.p, sp_box_sym(SPS_notice)); | |
| if (_t290.cls_id == 81) _t291 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t290.v.p, sp_box_sym(SPS_notice)); | |
| if (_t290.cls_id == 82) _t291 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t290.v.p, sp_box_sym(SPS_notice)); | |
| if (_t290.cls_id == 83) _t291 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t290.v.p, sp_box_sym(SPS_notice)); | |
| if (_t290.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t291 = sp_SymPolyHash_get((sp_SymPolyHash *)_t290.v.p, SPS_notice); | |
| if (_t290.cls_id == SP_BUILTIN_SYM_INT_HASH) _t291 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t290.v.p, SPS_notice)); | |
| if (_t290.cls_id == SP_BUILTIN_SYM_STR_HASH) _t291 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t290.v.p, SPS_notice)); | |
| } | |
| sp_RbVal _t292 = self->iv_flash; | |
| sp_RbVal _t293 = sp_box_nil(); | |
| if (_t292.tag == SP_TAG_OBJ) { | |
| if (_t292.cls_id == 52) _t293 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t292.v.p, SPS_alert); | |
| if (_t292.cls_id == 55) _t293 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t292.v.p, sp_box_sym(SPS_alert))); | |
| if (_t292.cls_id == 56) _t293 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t292.v.p, sp_box_sym(SPS_alert)); | |
| if (_t292.cls_id == 65) _t293 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t292.v.p, SPS_alert); | |
| if (_t292.cls_id == 67) _t293 = sp_Comment__aref((sp_Comment *)_t292.v.p, SPS_alert); | |
| if (_t292.cls_id == 78) _t293 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t292.v.p, sp_box_sym(SPS_alert)); | |
| if (_t292.cls_id == 79) _t293 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t292.v.p, sp_box_sym(SPS_alert)); | |
| if (_t292.cls_id == 80) _t293 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t292.v.p, sp_box_sym(SPS_alert)); | |
| if (_t292.cls_id == 81) _t293 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t292.v.p, sp_box_sym(SPS_alert)); | |
| if (_t292.cls_id == 82) _t293 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t292.v.p, sp_box_sym(SPS_alert)); | |
| if (_t292.cls_id == 83) _t293 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t292.v.p, sp_box_sym(SPS_alert)); | |
| if (_t292.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t293 = sp_SymPolyHash_get((sp_SymPolyHash *)_t292.v.p, SPS_alert); | |
| if (_t292.cls_id == SP_BUILTIN_SYM_INT_HASH) _t293 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t292.v.p, SPS_alert)); | |
| if (_t292.cls_id == SP_BUILTIN_SYM_STR_HASH) _t293 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t292.v.p, SPS_alert)); | |
| } | |
| return sp_ActionController_Base_render((sp_ActionController_Base *)self, sp_str_dup_external((sp_Views_Articles_cls_edit(self->iv_article, _t291, _t293))->data), SPS_unprocessable_content, NULL, NULL); | |
| } | |
| return 0; | |
| } | |
| static mrb_int sp_ArticlesController_destroy(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 99 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t294 = self->iv_params; | |
| sp_RbVal _t295 = sp_box_nil(); | |
| if (_t294.tag == SP_TAG_OBJ) { | |
| if (_t294.cls_id == 55) _t295 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t294.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t294.cls_id == 56) _t295 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t294.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t294.cls_id == SP_BUILTIN_STR_INT_HASH) _t295 = sp_StrIntHash_has_key((sp_StrIntHash *)_t294.v.p, (&("\xff" "id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t294.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t294.cls_id == SP_BUILTIN_STR_STR_HASH) _t295 = sp_StrStrHash_has_key((sp_StrStrHash *)_t294.v.p, (&("\xff" "id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t294.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t294.cls_id == SP_BUILTIN_STR_POLY_HASH) _t295 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t294.v.p, (&("\xff" "id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t294.v.p, (&("\xff" "id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t296 = sp_poly_to_s(_t295); | |
| SP_GC_ROOT(_t296); | |
| self->iv_article = sp_box_nullable_obj(sp_Article_cls_find(sp_str_to_i_cruby(_t296)), 79); | |
| #line 100 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| sp_RbVal _t297 = self->iv_article; | |
| sp_ActiveRecord_Base * _t298 = NULL; | |
| if (_t297.tag == SP_TAG_OBJ) { | |
| if (_t297.cls_id == 80) _t298 = sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t297.v.p); | |
| if (_t297.cls_id == 81) _t298 = sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t297.v.p); | |
| } | |
| _t298; | |
| #line 101 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| if ((self->iv_request_format == SPS_json)) { | |
| #line 102 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| return sp_ActionController_Base_head((sp_ActionController_Base *)self, SPS_no_content, (&("\xff" "application/json")[1])); | |
| } else { | |
| #line 104 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| return sp_ActionController_Base_redirect_to((sp_ActionController_Base *)self, sp_RouteHelpers_cls_articles_path(), (&("\xff" "Article was successfully destroyed.")[1]), NULL, SPS_see_other); | |
| } | |
| return 0; | |
| } | |
| static inline sp_ArticleParams * sp_ArticlesController_article_params(sp_ArticlesController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 109 "test/models/../../config/../app/controllers/articles_controller.rb" | |
| return sp_ArticleParams_cls_from_raw(((sp_StrPolyHash *)(self->iv_params).v.p)); | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(CommentParams) | |
| static inline sp_CommentParams *sp_CommentParams_new(void) { | |
| SP_GC_SAVE(); | |
| sp_CommentParams *self = SP_POOL_NEW(CommentParams, sp_CommentParams_gc_scan); | |
| self->cls_id = 72LL; | |
| SP_GC_ROOT(self); | |
| self->iv_commenter = NULL; | |
| self->iv_body = NULL; | |
| self->iv_commenter = (&("\xff" "")[1]); | |
| self->iv_body = (&("\xff" "")[1]); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_CommentParams_initialize(sp_CommentParams *self) { | |
| #line 3 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| self->iv_commenter = (&("\xff" "")[1]); | |
| #line 4 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| self->iv_body = (&("\xff" "")[1]); | |
| } | |
| static inline sp_RbVal sp_CommentParams_commenter(sp_CommentParams *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 8 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| sp_RbVal _t299 = sp_box_str(self->iv_commenter); | |
| SP_GC_RESTORE(); | |
| return _t299; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_CommentParams_commenter_eq(sp_CommentParams *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 12 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| self->iv_commenter = (lv_value).v.s; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_CommentParams_body(sp_CommentParams *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 16 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| sp_RbVal _t300 = sp_box_str(self->iv_body); | |
| SP_GC_RESTORE(); | |
| return _t300; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_CommentParams_body_eq(sp_CommentParams *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 20 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| self->iv_body = (lv_value).v.s; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_StrStrHash * sp_CommentParams_to_h(sp_CommentParams *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 47 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| sp_StrStrHash *_t301 = sp_StrStrHash_new(); | |
| SP_GC_ROOT(_t301); | |
| sp_StrStrHash_set(_t301, (&("\xff" "commenter")[1]), self->iv_commenter); | |
| sp_StrStrHash_set(_t301, (&("\xff" "body")[1]), self->iv_body); | |
| return _t301; | |
| return NULL; | |
| } | |
| static sp_CommentParams * sp_CommentParams_cls_from_raw(sp_StrPolyHash * lv_params) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_raw_sub = sp_box_nil(); | |
| sp_RbVal lv_sub = sp_box_nil(); | |
| sp_CommentParams * lv_instance = NULL; | |
| sp_RbVal lv_raw_commenter = sp_box_nil(); | |
| sp_RbVal lv_raw_body = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_raw_sub); | |
| SP_GC_ROOT_RBVAL(lv_sub); | |
| SP_GC_ROOT(lv_instance); | |
| SP_GC_ROOT_RBVAL(lv_raw_commenter); | |
| SP_GC_ROOT_RBVAL(lv_raw_body); | |
| SP_GC_ROOT(lv_params); | |
| SP_GC_ROOT(lv_params); | |
| #line 24 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| lv_raw_sub = (sp_StrPolyHash_has_key(lv_params, (&("\xff" "comment")[1])) ? sp_StrPolyHash_get(lv_params, (&("\xff" "comment")[1])) : (sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH))); | |
| #line 25 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| sp_RbVal _t302 = lv_raw_sub; | |
| lv_sub = ((_t302.tag == SP_TAG_OBJ && (_t302.cls_id == SP_BUILTIN_STR_INT_HASH || _t302.cls_id == SP_BUILTIN_STR_STR_HASH || _t302.cls_id == SP_BUILTIN_INT_STR_HASH || _t302.cls_id == SP_BUILTIN_SYM_INT_HASH || _t302.cls_id == SP_BUILTIN_SYM_STR_HASH || _t302.cls_id == SP_BUILTIN_STR_POLY_HASH || _t302.cls_id == SP_BUILTIN_SYM_POLY_HASH)) ? lv_raw_sub : sp_box_obj((void *)(sp_StrIntHash_new()), SP_BUILTIN_STR_INT_HASH)); | |
| #line 30 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| lv_instance = sp_CommentParams_new(); | |
| #line 31 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| sp_RbVal _t303 = lv_sub; | |
| sp_RbVal _t304 = sp_box_nil(); | |
| if (_t303.tag == SP_TAG_OBJ) { | |
| if (_t303.cls_id == 55) _t304 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t303.v.p, (&("\xff" "commenter")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t303.cls_id == 56) _t304 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t303.v.p, (&("\xff" "commenter")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t303.cls_id == SP_BUILTIN_STR_INT_HASH) _t304 = sp_StrIntHash_has_key((sp_StrIntHash *)_t303.v.p, (&("\xff" "commenter")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t303.v.p, (&("\xff" "commenter")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t303.cls_id == SP_BUILTIN_STR_STR_HASH) _t304 = sp_StrStrHash_has_key((sp_StrStrHash *)_t303.v.p, (&("\xff" "commenter")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t303.v.p, (&("\xff" "commenter")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t303.cls_id == SP_BUILTIN_STR_POLY_HASH) _t304 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t303.v.p, (&("\xff" "commenter")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t303.v.p, (&("\xff" "commenter")[1])) : sp_box_str((&("\xff" "")[1])); | |
| } | |
| lv_raw_commenter = _t304; | |
| #line 32 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| sp_RbVal _t305 = lv_raw_commenter; | |
| sp_CommentParams_commenter_eq(lv_instance, ((_t305.tag == SP_TAG_STR) ? lv_raw_commenter : sp_box_str((&("\xff" "")[1])))); | |
| #line 37 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| sp_RbVal _t306 = lv_sub; | |
| sp_RbVal _t307 = sp_box_nil(); | |
| if (_t306.tag == SP_TAG_OBJ) { | |
| if (_t306.cls_id == 55) _t307 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t306.v.p, (&("\xff" "body")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t306.cls_id == 56) _t307 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t306.v.p, (&("\xff" "body")[1]), sp_box_str((&("\xff" "")[1]))); | |
| if (_t306.cls_id == SP_BUILTIN_STR_INT_HASH) _t307 = sp_StrIntHash_has_key((sp_StrIntHash *)_t306.v.p, (&("\xff" "body")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t306.v.p, (&("\xff" "body")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t306.cls_id == SP_BUILTIN_STR_STR_HASH) _t307 = sp_StrStrHash_has_key((sp_StrStrHash *)_t306.v.p, (&("\xff" "body")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t306.v.p, (&("\xff" "body")[1]))) : sp_box_str((&("\xff" "")[1])); | |
| if (_t306.cls_id == SP_BUILTIN_STR_POLY_HASH) _t307 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t306.v.p, (&("\xff" "body")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t306.v.p, (&("\xff" "body")[1])) : sp_box_str((&("\xff" "")[1])); | |
| } | |
| lv_raw_body = _t307; | |
| #line 38 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| sp_RbVal _t308 = lv_raw_body; | |
| sp_CommentParams_body_eq(lv_instance, ((_t308.tag == SP_TAG_STR) ? lv_raw_body : sp_box_str((&("\xff" "")[1])))); | |
| #line 43 "test/models/../../config/../app/controllers/../models/comment_params.rb" | |
| return (sp_CommentParams *)lv_instance; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(CommentsController) | |
| static inline sp_CommentsController *sp_CommentsController_new(void) { | |
| SP_GC_SAVE(); | |
| sp_CommentsController *self = SP_POOL_NEW(CommentsController, sp_CommentsController_gc_scan); | |
| self->cls_id = 73LL; | |
| SP_GC_ROOT(self); | |
| self->iv_params = sp_box_nil(); | |
| self->iv_session = NULL; | |
| self->iv_flash = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_location = NULL; | |
| self->iv_content_type = NULL; | |
| self->iv_request_method = NULL; | |
| self->iv_request_path = NULL; | |
| self->iv_article = sp_box_nil(); | |
| self->iv_comment = NULL; | |
| sp_ActionController_Base_initialize((sp_ActionController_Base *)self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline mrb_int sp_CommentsController_process_action(sp_CommentsController *self, sp_sym lv_action_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 9 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| mrb_int _t309 = lv_action_name; | |
| if (_t309 == SPS_create) { | |
| #line 11 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| return sp_CommentsController_create(self); | |
| } else if (_t309 == SPS_destroy) { | |
| #line 13 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| return sp_CommentsController_destroy(self); | |
| } | |
| return 0; | |
| } | |
| static mrb_int sp_CommentsController_create(sp_CommentsController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 18 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| sp_RbVal _t310 = self->iv_params; | |
| sp_RbVal _t311 = sp_box_nil(); | |
| if (_t310.tag == SP_TAG_OBJ) { | |
| if (_t310.cls_id == 55) _t311 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t310.v.p, (&("\xff" "article_id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t310.cls_id == 56) _t311 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t310.v.p, (&("\xff" "article_id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t310.cls_id == SP_BUILTIN_STR_INT_HASH) _t311 = sp_StrIntHash_has_key((sp_StrIntHash *)_t310.v.p, (&("\xff" "article_id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t310.v.p, (&("\xff" "article_id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t310.cls_id == SP_BUILTIN_STR_STR_HASH) _t311 = sp_StrStrHash_has_key((sp_StrStrHash *)_t310.v.p, (&("\xff" "article_id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t310.v.p, (&("\xff" "article_id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t310.cls_id == SP_BUILTIN_STR_POLY_HASH) _t311 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t310.v.p, (&("\xff" "article_id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t310.v.p, (&("\xff" "article_id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t312 = sp_poly_to_s(_t311); | |
| SP_GC_ROOT(_t312); | |
| self->iv_article = sp_box_nullable_obj(sp_Article_cls_find(sp_str_to_i_cruby(_t312)), 79); | |
| #line 19 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| self->iv_comment = sp_Comment_cls_from_params(sp_CommentsController_comment_params(self)); | |
| #line 20 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| sp_RbVal _t313 = self->iv_article; | |
| sp_RbVal _t314 = sp_box_nil(); | |
| if (_t313.tag == SP_TAG_OBJ) { | |
| if (_t313.cls_id == 52) _t314 = ((sp_ActiveRecord_Base *)_t313.v.p)->iv_id; | |
| if (_t313.cls_id == 65) _t314 = ((sp_ApplicationRecord *)_t313.v.p)->iv_id; | |
| if (_t313.cls_id == 66) _t314 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t313.v.p)); | |
| if (_t313.cls_id == 67) _t314 = sp_Comment_id((sp_Comment *)_t313.v.p); | |
| if (_t313.cls_id == 68) _t314 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t313.v.p)); | |
| if (_t313.cls_id == 78) _t314 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t313.v.p); | |
| if (_t313.cls_id == 79) _t314 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t313.v.p); | |
| if (_t313.cls_id == 80) _t314 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t313.v.p); | |
| if (_t313.cls_id == 81) _t314 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t313.v.p); | |
| if (_t313.cls_id == 82) _t314 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t313.v.p); | |
| if (_t313.cls_id == 83) _t314 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t313.v.p); | |
| } | |
| sp_Comment_article_id_eq(self->iv_comment, _t314); | |
| #line 21 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| if (sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self->iv_comment)) { | |
| #line 22 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| sp_RbVal _t315 = self->iv_article; | |
| sp_RbVal _t316 = sp_box_nil(); | |
| if (_t315.tag == SP_TAG_OBJ) { | |
| if (_t315.cls_id == 52) _t316 = ((sp_ActiveRecord_Base *)_t315.v.p)->iv_id; | |
| if (_t315.cls_id == 65) _t316 = ((sp_ApplicationRecord *)_t315.v.p)->iv_id; | |
| if (_t315.cls_id == 66) _t316 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t315.v.p)); | |
| if (_t315.cls_id == 67) _t316 = sp_Comment_id((sp_Comment *)_t315.v.p); | |
| if (_t315.cls_id == 68) _t316 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t315.v.p)); | |
| if (_t315.cls_id == 78) _t316 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t315.v.p); | |
| if (_t315.cls_id == 79) _t316 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t315.v.p); | |
| if (_t315.cls_id == 80) _t316 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t315.v.p); | |
| if (_t315.cls_id == 81) _t316 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t315.v.p); | |
| if (_t315.cls_id == 82) _t316 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t315.v.p); | |
| if (_t315.cls_id == 83) _t316 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t315.v.p); | |
| } | |
| return sp_ActionController_Base_redirect_to((sp_ActionController_Base *)self, sp_RouteHelpers_cls_article_path((_t316).v.i), (&("\xff" "Comment was successfully created.")[1]), NULL, SPS_found); | |
| } else { | |
| #line 24 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| sp_RbVal _t317 = self->iv_article; | |
| sp_RbVal _t318 = sp_box_nil(); | |
| if (_t317.tag == SP_TAG_OBJ) { | |
| if (_t317.cls_id == 52) _t318 = ((sp_ActiveRecord_Base *)_t317.v.p)->iv_id; | |
| if (_t317.cls_id == 65) _t318 = ((sp_ApplicationRecord *)_t317.v.p)->iv_id; | |
| if (_t317.cls_id == 66) _t318 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t317.v.p)); | |
| if (_t317.cls_id == 67) _t318 = sp_Comment_id((sp_Comment *)_t317.v.p); | |
| if (_t317.cls_id == 68) _t318 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t317.v.p)); | |
| if (_t317.cls_id == 78) _t318 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t317.v.p); | |
| if (_t317.cls_id == 79) _t318 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t317.v.p); | |
| if (_t317.cls_id == 80) _t318 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t317.v.p); | |
| if (_t317.cls_id == 81) _t318 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t317.v.p); | |
| if (_t317.cls_id == 82) _t318 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t317.v.p); | |
| if (_t317.cls_id == 83) _t318 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t317.v.p); | |
| } | |
| return sp_ActionController_Base_redirect_to((sp_ActionController_Base *)self, sp_RouteHelpers_cls_article_path((_t318).v.i), NULL, (&("\xff" "Could not create comment.")[1]), SPS_found); | |
| } | |
| return 0; | |
| } | |
| static mrb_int sp_CommentsController_destroy(sp_CommentsController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 29 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| sp_RbVal _t319 = self->iv_params; | |
| sp_RbVal _t320 = sp_box_nil(); | |
| if (_t319.tag == SP_TAG_OBJ) { | |
| if (_t319.cls_id == 55) _t320 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t319.v.p, (&("\xff" "article_id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t319.cls_id == 56) _t320 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t319.v.p, (&("\xff" "article_id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t319.cls_id == SP_BUILTIN_STR_INT_HASH) _t320 = sp_StrIntHash_has_key((sp_StrIntHash *)_t319.v.p, (&("\xff" "article_id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t319.v.p, (&("\xff" "article_id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t319.cls_id == SP_BUILTIN_STR_STR_HASH) _t320 = sp_StrStrHash_has_key((sp_StrStrHash *)_t319.v.p, (&("\xff" "article_id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t319.v.p, (&("\xff" "article_id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t319.cls_id == SP_BUILTIN_STR_POLY_HASH) _t320 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t319.v.p, (&("\xff" "article_id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t319.v.p, (&("\xff" "article_id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t321 = sp_poly_to_s(_t320); | |
| SP_GC_ROOT(_t321); | |
| self->iv_article = sp_box_nullable_obj(sp_Article_cls_find(sp_str_to_i_cruby(_t321)), 79); | |
| #line 30 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| sp_RbVal _t322 = self->iv_params; | |
| sp_RbVal _t323 = sp_box_nil(); | |
| if (_t322.tag == SP_TAG_OBJ) { | |
| if (_t322.cls_id == 55) _t323 = sp_ActionDispatch_Flash_fetch((sp_ActionDispatch_Flash *)_t322.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t322.cls_id == 56) _t323 = sp_ActionDispatch_Session_fetch((sp_ActionDispatch_Session *)_t322.v.p, (&("\xff" "id")[1]), sp_box_str((&("\xff" "0")[1]))); | |
| if (_t322.cls_id == SP_BUILTIN_STR_INT_HASH) _t323 = sp_StrIntHash_has_key((sp_StrIntHash *)_t322.v.p, (&("\xff" "id")[1])) ? sp_box_int(sp_StrIntHash_get((sp_StrIntHash *)_t322.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t322.cls_id == SP_BUILTIN_STR_STR_HASH) _t323 = sp_StrStrHash_has_key((sp_StrStrHash *)_t322.v.p, (&("\xff" "id")[1])) ? sp_box_str(sp_StrStrHash_get((sp_StrStrHash *)_t322.v.p, (&("\xff" "id")[1]))) : sp_box_str((&("\xff" "0")[1])); | |
| if (_t322.cls_id == SP_BUILTIN_STR_POLY_HASH) _t323 = sp_StrPolyHash_has_key((sp_StrPolyHash *)_t322.v.p, (&("\xff" "id")[1])) ? sp_StrPolyHash_get((sp_StrPolyHash *)_t322.v.p, (&("\xff" "id")[1])) : sp_box_str((&("\xff" "0")[1])); | |
| } | |
| const char * _t324 = sp_poly_to_s(_t323); | |
| SP_GC_ROOT(_t324); | |
| self->iv_comment = sp_Comment_cls_find(sp_str_to_i_cruby(_t324)); | |
| #line 31 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| sp_RbVal _t325 = self->iv_article; | |
| sp_RbVal _t326 = sp_box_nil(); | |
| if (_t325.tag == SP_TAG_OBJ) { | |
| if (_t325.cls_id == 52) _t326 = ((sp_ActiveRecord_Base *)_t325.v.p)->iv_id; | |
| if (_t325.cls_id == 65) _t326 = ((sp_ApplicationRecord *)_t325.v.p)->iv_id; | |
| if (_t325.cls_id == 66) _t326 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t325.v.p)); | |
| if (_t325.cls_id == 67) _t326 = sp_Comment_id((sp_Comment *)_t325.v.p); | |
| if (_t325.cls_id == 68) _t326 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t325.v.p)); | |
| if (_t325.cls_id == 78) _t326 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t325.v.p); | |
| if (_t325.cls_id == 79) _t326 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t325.v.p); | |
| if (_t325.cls_id == 80) _t326 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t325.v.p); | |
| if (_t325.cls_id == 81) _t326 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t325.v.p); | |
| if (_t325.cls_id == 82) _t326 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t325.v.p); | |
| if (_t325.cls_id == 83) _t326 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t325.v.p); | |
| } | |
| if ((!sp_poly_eq(sp_box_int(self->iv_comment->iv_article_id), _t326))) { | |
| #line 32 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| sp_ActionController_Base_head((sp_ActionController_Base *)self, SPS_not_found, NULL); | |
| #line 33 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| SP_GC_RESTORE(); | |
| return 0; | |
| } | |
| #line 35 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)self->iv_comment); | |
| #line 36 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| sp_RbVal _t327 = self->iv_article; | |
| sp_RbVal _t328 = sp_box_nil(); | |
| if (_t327.tag == SP_TAG_OBJ) { | |
| if (_t327.cls_id == 52) _t328 = ((sp_ActiveRecord_Base *)_t327.v.p)->iv_id; | |
| if (_t327.cls_id == 65) _t328 = ((sp_ApplicationRecord *)_t327.v.p)->iv_id; | |
| if (_t327.cls_id == 66) _t328 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t327.v.p)); | |
| if (_t327.cls_id == 67) _t328 = sp_Comment_id((sp_Comment *)_t327.v.p); | |
| if (_t327.cls_id == 68) _t328 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t327.v.p)); | |
| if (_t327.cls_id == 78) _t328 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t327.v.p); | |
| if (_t327.cls_id == 79) _t328 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t327.v.p); | |
| if (_t327.cls_id == 80) _t328 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t327.v.p); | |
| if (_t327.cls_id == 81) _t328 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t327.v.p); | |
| if (_t327.cls_id == 82) _t328 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t327.v.p); | |
| if (_t327.cls_id == 83) _t328 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t327.v.p); | |
| } | |
| return sp_ActionController_Base_redirect_to((sp_ActionController_Base *)self, sp_RouteHelpers_cls_article_path((_t328).v.i), (&("\xff" "Comment was successfully deleted.")[1]), NULL, SPS_found); | |
| return 0; | |
| } | |
| static inline sp_CommentParams * sp_CommentsController_comment_params(sp_CommentsController *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 40 "test/models/../../config/../app/controllers/comments_controller.rb" | |
| return sp_CommentParams_cls_from_raw(((sp_StrPolyHash *)(self->iv_params).v.p)); | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(ActionResponse) | |
| static inline sp_ActionResponse *sp_ActionResponse_new(mrb_int lv_status, const char * lv_body, const char * lv_location, sp_ActionDispatch_Flash * lv_flash) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_body); | |
| SP_GC_ROOT(lv_location); | |
| SP_GC_ROOT(lv_flash); | |
| sp_ActionResponse *self = SP_POOL_NEW(ActionResponse, sp_ActionResponse_gc_scan); | |
| self->cls_id = 74LL; | |
| SP_GC_ROOT(self); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_location = sp_box_nil(); | |
| self->iv_flash = sp_box_nil(); | |
| SP_GC_ROOT(lv_body); | |
| SP_GC_ROOT(lv_location); | |
| SP_GC_ROOT(lv_flash); | |
| self->iv_status = lv_status; | |
| self->iv_body = sp_box_str(lv_body); | |
| self->iv_location = sp_box_nullable_str(lv_location); | |
| self->iv_flash = sp_box_obj(lv_flash, 55); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_ActionResponse_initialize(sp_ActionResponse *self, mrb_int lv_status, const char * lv_body, const char * lv_location, sp_ActionDispatch_Flash * lv_flash) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_body); | |
| SP_GC_ROOT(lv_location); | |
| SP_GC_ROOT(lv_flash); | |
| #line 111 "test/models/../test_helper.rb" | |
| self->iv_status = lv_status; | |
| #line 112 "test/models/../test_helper.rb" | |
| self->iv_body = sp_box_str(lv_body); | |
| #line 113 "test/models/../test_helper.rb" | |
| self->iv_location = sp_box_nullable_str(lv_location); | |
| #line 114 "test/models/../test_helper.rb" | |
| self->iv_flash = sp_box_obj(lv_flash, 55); | |
| } | |
| static inline mrb_bool sp_ActionResponse_redirect_p(sp_ActionResponse *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 118 "test/models/../test_helper.rb" | |
| mrb_bool _t330 = (!sp_poly_nil_p(self->iv_location)); | |
| mrb_bool _t331 = FALSE; | |
| if (_t330) { | |
| _t331 = (self->iv_status >= 300LL); | |
| } else { | |
| _t331 = _t330; | |
| } | |
| mrb_bool _t329 = _t331; | |
| mrb_bool _t332 = FALSE; | |
| if (_t329) { | |
| _t332 = (self->iv_status < 400LL); | |
| } else { | |
| _t332 = _t329; | |
| } | |
| return _t332; | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActionResponse_success_p(sp_ActionResponse *self) { | |
| return FALSE; | |
| } | |
| static inline mrb_bool sp_ActionResponse_unprocessable_p(sp_ActionResponse *self) { | |
| return FALSE; | |
| } | |
| SP_POOL_DEFINE(TestBase) | |
| static inline sp_TestBase *sp_TestBase_new(void) { | |
| SP_GC_SAVE(); | |
| sp_TestBase *self = SP_POOL_NEW(TestBase, NULL); | |
| self->cls_id = 75LL; | |
| SP_GC_ROOT(self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_TestBase_initialize(sp_TestBase *self) { | |
| } | |
| static inline mrb_int sp_TestBase_setup(sp_TestBase *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 147 "test/models/../test_helper.rb" | |
| if ((((const char*)0) != NULL)) { | |
| return sp_SchemaSetup_cls_reset_bang(); | |
| } else { | |
| return 0; | |
| } | |
| return 0; | |
| } | |
| static inline mrb_int sp_TestBase_teardown(sp_TestBase *self) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_TestBase_assert_match(sp_TestBase *self, mrb_int lv_pattern, mrb_int lv_value, mrb_int lv_msg) { | |
| (void)lv_pattern; | |
| (void)lv_value; | |
| (void)lv_msg; | |
| return SP_INT_NIL; | |
| } | |
| SP_POOL_DEFINE(ArticleTest) | |
| static inline sp_ArticleTest *sp_ArticleTest_new(void) { | |
| SP_GC_SAVE(); | |
| sp_ArticleTest *self = SP_POOL_NEW(ArticleTest, NULL); | |
| self->cls_id = 76LL; | |
| SP_GC_ROOT(self); | |
| sp_TestBase_initialize((sp_TestBase *)self); | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline mrb_int sp_ArticleTest_test_creates_an_article_with_valid_attributes(sp_ArticleTest *self) { | |
| SP_GC_SAVE(); | |
| sp_Article * lv_article = NULL; | |
| SP_GC_ROOT(lv_article); | |
| SP_GC_ROOT(self); | |
| #line 10 "test/models/article_test.rb" | |
| lv_article = sp_ArticlesFixtures_cls_one(); | |
| #line 11 "test/models/article_test.rb" | |
| if (sp_poly_nil_p(lv_article->iv_id)) { | |
| sp_raise((&("\xff" "refute_nil failed")[1])); | |
| } | |
| #line 12 "test/models/article_test.rb" | |
| if ((!sp_str_eq((&("\xff" "Getting Started with Rails")[1]), lv_article->iv_title))) { | |
| sp_raise((&("\xff" "assert_equal failed")[1])); | |
| return 0; | |
| } else { | |
| return 0; | |
| } | |
| return 0; | |
| } | |
| static inline mrb_int sp_ArticleTest_test_validates_title_presence(sp_ArticleTest *self) { | |
| SP_GC_SAVE(); | |
| sp_Article * lv_article = NULL; | |
| SP_GC_ROOT(lv_article); | |
| SP_GC_ROOT(self); | |
| #line 16 "test/models/article_test.rb" | |
| sp_SymPolyHash *_t333 = sp_SymPolyHash_new(); | |
| sp_SymPolyHash_set(_t333, SPS_title, sp_box_str((&("\xff" "")[1]))); | |
| sp_SymPolyHash_set(_t333, SPS_body, sp_box_str((&("\xff" "Valid body content here.")[1]))); | |
| lv_article = sp_Article_new(_t333); | |
| #line 17 "test/models/article_test.rb" | |
| if (sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)lv_article)) { | |
| sp_raise((&("\xff" "refute failed")[1])); | |
| return 0; | |
| } else { | |
| return 0; | |
| } | |
| return 0; | |
| } | |
| static inline mrb_int sp_ArticleTest_test_validates_body_minimum_length(sp_ArticleTest *self) { | |
| SP_GC_SAVE(); | |
| sp_Article * lv_article = NULL; | |
| SP_GC_ROOT(lv_article); | |
| SP_GC_ROOT(self); | |
| #line 21 "test/models/article_test.rb" | |
| sp_SymPolyHash *_t334 = sp_SymPolyHash_new(); | |
| sp_SymPolyHash_set(_t334, SPS_title, sp_box_str((&("\xff" "Valid Title")[1]))); | |
| sp_SymPolyHash_set(_t334, SPS_body, sp_box_str((&("\xff" "Short")[1]))); | |
| lv_article = sp_Article_new(_t334); | |
| #line 22 "test/models/article_test.rb" | |
| if (sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)lv_article)) { | |
| sp_raise((&("\xff" "refute failed")[1])); | |
| return 0; | |
| } else { | |
| return 0; | |
| } | |
| return 0; | |
| } | |
| static mrb_int sp_ArticleTest_test_destroys_comments_when_article_is_destroyed(sp_ArticleTest *self) { | |
| SP_GC_SAVE(); | |
| sp_Article * lv_article = NULL; | |
| mrb_int lv___diff_before = 0; | |
| mrb_int lv___diff_after = 0; | |
| SP_GC_ROOT(lv_article); | |
| SP_GC_ROOT(self); | |
| #line 26 "test/models/article_test.rb" | |
| lv_article = sp_ArticlesFixtures_cls_one(); | |
| #line 27 "test/models/article_test.rb" | |
| lv___diff_before = sp_Comment_cls_count(); | |
| #line 28 "test/models/article_test.rb" | |
| sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)lv_article); | |
| #line 29 "test/models/article_test.rb" | |
| lv___diff_after = sp_Comment_cls_count(); | |
| #line 30 "test/models/article_test.rb" | |
| if ((sp_int_sub(lv___diff_after, lv___diff_before) != -1LL)) { | |
| sp_raise((&("\xff" "Comment.count didn't change by -1")[1])); | |
| return 0; | |
| } else { | |
| return 0; | |
| } | |
| return 0; | |
| } | |
| SP_POOL_DEFINE(Method) | |
| static inline sp_Method *sp_Method_new(sp_Method * lv_self_obj, mrb_int lv_fn_ptr, const char * lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_self_obj); | |
| SP_GC_ROOT(lv_name); | |
| sp_Method *self = SP_POOL_NEW(Method, sp_Method_gc_scan); | |
| self->cls_id = 77LL; | |
| SP_GC_ROOT(self); | |
| self->iv_self_obj = NULL; | |
| self->iv_name = NULL; | |
| self->iv_self_obj = lv_self_obj; | |
| self->iv_fn_ptr = lv_fn_ptr; | |
| self->iv_name = lv_name; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Method_initialize(sp_Method *self, sp_Method * lv_self_obj, mrb_int lv_fn_ptr, const char * lv_name) { | |
| } | |
| SP_POOL_DEFINE(Article__implicit_6872) | |
| static inline sp_Article__implicit_6872 *sp_Article__implicit_6872_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article__implicit_6872 *self = SP_POOL_NEW(Article__implicit_6872, sp_Article__implicit_6872_gc_scan); | |
| self->cls_id = 78LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_id = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t335 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t335 = sp_Article__implicit_6872_body_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t335 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t335; | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t336 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t336 = sp_Article__implicit_6872_created_at_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t336 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t336; | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t337 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t337 = sp_Article__implicit_6872_title_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t337 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t337; | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t338 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t338 = sp_Article__implicit_6872_updated_at_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t338 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t338; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article__implicit_6872_initialize(sp_Article__implicit_6872 *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t339 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t339 = sp_Article__implicit_6872_body_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t339 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t339; | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t340 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t340 = sp_Article__implicit_6872_created_at_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t340 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t340; | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t341 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t341 = sp_Article__implicit_6872_title_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t341 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t341; | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t342 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t342 = sp_Article__implicit_6872_updated_at_eq((sp_Article__implicit_6872 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t342 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t342; | |
| #line 97 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| #line 98 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872_id(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 8 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t343 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t343; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_id_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 12 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872_body(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 16 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t344 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t344; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_body_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 20 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872_created_at(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 24 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t345 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t345; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_created_at_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 28 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872_title(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 32 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t346 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t346; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_title_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 36 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872_updated_at(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 40 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t347 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t347; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_updated_at_eq(sp_Article__implicit_6872 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 44 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Article__implicit_6872_assign_from_row(sp_Article__implicit_6872 *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872_attributes(sp_Article__implicit_6872 *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872__aref(sp_Article__implicit_6872 *self, sp_RbVal lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_name); | |
| SP_GC_ROOT(self); | |
| #line 106 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t348 = lv_name; | |
| if ((_t348.tag == SP_TAG_SYM && _t348.v.i == SPS_id)) { | |
| #line 108 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t349 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t349; | |
| } else if ((_t348.tag == SP_TAG_SYM && _t348.v.i == SPS_body)) { | |
| #line 110 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t350 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t350; | |
| } else if ((_t348.tag == SP_TAG_SYM && _t348.v.i == SPS_created_at)) { | |
| #line 112 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t351 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t351; | |
| } else if ((_t348.tag == SP_TAG_SYM && _t348.v.i == SPS_title)) { | |
| #line 114 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t352 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t352; | |
| } else if ((_t348.tag == SP_TAG_SYM && _t348.v.i == SPS_updated_at)) { | |
| #line 116 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t353 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t353; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872__aset(sp_Article__implicit_6872 *self, sp_sym lv_name, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 121 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t354 = lv_name; | |
| if (_t354 == SPS_id) { | |
| #line 123 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t356 = lv_value; | |
| mrb_int _t355 = (_t356.tag == SP_TAG_INT) ? _t356.v.i : 0; | |
| self->iv_id = sp_box_int(_t355); | |
| return SP_INT_NIL; | |
| } else if (_t354 == SPS_body) { | |
| #line 125 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t354 == SPS_created_at) { | |
| #line 127 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t354 == SPS_title) { | |
| #line 129 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t354 == SPS_updated_at) { | |
| #line 131 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_Article__implicit_6872_update(sp_Article__implicit_6872 *self, mrb_int lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 136 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t357 = ((sp_ArticleRow *)lv_p)->iv_title; | |
| SP_GC_ROOT(_t357); | |
| if ((_t357 == NULL)) { | |
| #line 137 "test/models/../../config/../app/controllers/../models/article.rb" | |
| } else { | |
| #line 139 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t358 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t358 = sp_Article__implicit_6872_title_eq((sp_Article__implicit_6872 *)self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| default: _t358 = sp_Article__implicit_9372_title_eq(self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| } | |
| _t358; | |
| } | |
| #line 141 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (sp_poly_nil_p(((sp_ActionController_Base *)lv_p)->iv_body)) { | |
| #line 142 "test/models/../../config/../app/controllers/../models/article.rb" | |
| } else { | |
| #line 144 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t359 = 0; | |
| switch (self->cls_id) { | |
| case 78LL: _t359 = sp_Article__implicit_6872_body_eq((sp_Article__implicit_6872 *)self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| default: _t359 = sp_Article__implicit_9372_body_eq(self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| } | |
| _t359; | |
| } | |
| #line 146 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_6872__adapter_insert(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 170 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t360 = (&("\xff" "INSERT INTO articles (body, created_at, title, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t360); | |
| const char * _t361 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t361); | |
| const char * _t362 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t362); | |
| const char * _t363 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t363); | |
| const char * _t364 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t364); | |
| const char * _t365 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t365); | |
| const char * _t366 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t366); | |
| const char * _t367 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t367); | |
| const char * _t368 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t368); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t360, _t361, _t362, _t363, _t364, _t365, _t366, _t367, _t368}, 9)); | |
| #line 171 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_Db_cls_last_insert_rowid(); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_6872__adapter_update(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 175 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t369 = (&("\xff" "UPDATE articles SET ")[1]); | |
| SP_GC_ROOT(_t369); | |
| const char * _t370 = (&("\xff" "body = ")[1]); | |
| SP_GC_ROOT(_t370); | |
| const char * _t371 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t371); | |
| const char * _t372 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t372); | |
| const char * _t373 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t373); | |
| const char * _t374 = (&("\xff" ", title = ")[1]); | |
| SP_GC_ROOT(_t374); | |
| const char * _t375 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t375); | |
| const char * _t376 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t376); | |
| const char * _t377 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t377); | |
| const char * _t378 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t378); | |
| const char * _t379 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t379); | |
| const char * _t380 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t380); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t369, _t370, _t371, _t372, _t373, _t374, _t375, _t376, _t377, _t378, _t379, _t380}, 12)); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_6872__adapter_delete(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 179 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t381 = (&("\xff" "DELETE FROM articles")[1]); | |
| SP_GC_ROOT(_t381); | |
| const char * _t382 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t382); | |
| const char * _t383 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t383); | |
| const char * _t384 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t384); | |
| return sp_Db_cls_exec(sp_str_concat4(_t381, _t382, _t383, _t384)); | |
| return SP_INT_NIL; | |
| } | |
| static sp_RbVal sp_Article__implicit_6872__adapter_reload(sp_Article__implicit_6872 *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 203 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t385 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles WHERE id = ")[1]); | |
| SP_GC_ROOT(_t385); | |
| const char * _t386 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t386); | |
| const char * _t387 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t387); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t385, _t386, _t387)); | |
| #line 204 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| #line 205 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = sp_box_int(sp_Db_cls_column_int(sp_box_obj((void *)(lv_stmt), 0), 0LL)); | |
| #line 206 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 1LL)); | |
| #line 207 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 2LL)); | |
| #line 208 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 3LL)); | |
| #line 209 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 4LL)); | |
| #line 210 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| #line 212 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 213 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t388 = sp_box_obj(self, 83); | |
| SP_GC_RESTORE(); | |
| return _t388; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_StrArray * sp_Article__implicit_6872_validate(sp_Article__implicit_6872 *self) { | |
| mrb_int lv_len = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 224 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t389 = self->iv_title; | |
| mrb_bool _t390 = FALSE; | |
| if (_t389.tag == SP_TAG_STR) _t390 = (sp_str_length(_t389.v.s) == 0); | |
| if (_t389.tag == SP_TAG_OBJ) { | |
| if (_t389.cls_id == 55) _t390 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t389.v.p); | |
| if (_t389.cls_id == 56) _t390 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t389.v.p); | |
| if (_t389.cls_id == SP_BUILTIN_INT_ARRAY) _t390 = (sp_IntArray_length((sp_IntArray *)_t389.v.p) == 0); | |
| if (_t389.cls_id == SP_BUILTIN_FLT_ARRAY) _t390 = (sp_FloatArray_length((sp_FloatArray *)_t389.v.p) == 0); | |
| if (_t389.cls_id == SP_BUILTIN_STR_ARRAY) _t390 = (sp_StrArray_length((sp_StrArray *)_t389.v.p) == 0); | |
| if (_t389.cls_id == SP_BUILTIN_SYM_ARRAY) _t390 = (sp_IntArray_length((sp_IntArray *)_t389.v.p) == 0); | |
| if (_t389.cls_id == SP_BUILTIN_PTR_ARRAY) _t390 = (sp_PtrArray_length((sp_PtrArray *)_t389.v.p) == 0); | |
| if (_t389.cls_id == SP_BUILTIN_POLY_ARRAY) _t390 = (sp_PolyArray_length((sp_PolyArray *)_t389.v.p) == 0); | |
| if (_t389.cls_id == SP_BUILTIN_STR_INT_HASH) _t390 = (sp_StrIntHash_length((sp_StrIntHash *)_t389.v.p) == 0); | |
| if (_t389.cls_id == SP_BUILTIN_STR_STR_HASH) _t390 = (sp_StrStrHash_length((sp_StrStrHash *)_t389.v.p) == 0); | |
| if (_t389.cls_id == SP_BUILTIN_INT_STR_HASH) _t390 = (sp_IntStrHash_length((sp_IntStrHash *)_t389.v.p) == 0); | |
| if (_t389.cls_id == SP_BUILTIN_STR_POLY_HASH) _t390 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t389.v.p) == 0); | |
| if (_t389.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t390 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t389.v.p) == 0); | |
| if (_t389.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t390 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t389.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_title) || _t390)) { | |
| sp_StrArray * _t391 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t391); | |
| sp_StrArray_push(_t391, (&("\xff" "title can't be blank")[1])); | |
| } | |
| #line 225 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t392 = self->iv_body; | |
| mrb_bool _t393 = FALSE; | |
| if (_t392.tag == SP_TAG_STR) _t393 = (sp_str_length(_t392.v.s) == 0); | |
| if (_t392.tag == SP_TAG_OBJ) { | |
| if (_t392.cls_id == 55) _t393 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t392.v.p); | |
| if (_t392.cls_id == 56) _t393 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t392.v.p); | |
| if (_t392.cls_id == SP_BUILTIN_INT_ARRAY) _t393 = (sp_IntArray_length((sp_IntArray *)_t392.v.p) == 0); | |
| if (_t392.cls_id == SP_BUILTIN_FLT_ARRAY) _t393 = (sp_FloatArray_length((sp_FloatArray *)_t392.v.p) == 0); | |
| if (_t392.cls_id == SP_BUILTIN_STR_ARRAY) _t393 = (sp_StrArray_length((sp_StrArray *)_t392.v.p) == 0); | |
| if (_t392.cls_id == SP_BUILTIN_SYM_ARRAY) _t393 = (sp_IntArray_length((sp_IntArray *)_t392.v.p) == 0); | |
| if (_t392.cls_id == SP_BUILTIN_PTR_ARRAY) _t393 = (sp_PtrArray_length((sp_PtrArray *)_t392.v.p) == 0); | |
| if (_t392.cls_id == SP_BUILTIN_POLY_ARRAY) _t393 = (sp_PolyArray_length((sp_PolyArray *)_t392.v.p) == 0); | |
| if (_t392.cls_id == SP_BUILTIN_STR_INT_HASH) _t393 = (sp_StrIntHash_length((sp_StrIntHash *)_t392.v.p) == 0); | |
| if (_t392.cls_id == SP_BUILTIN_STR_STR_HASH) _t393 = (sp_StrStrHash_length((sp_StrStrHash *)_t392.v.p) == 0); | |
| if (_t392.cls_id == SP_BUILTIN_INT_STR_HASH) _t393 = (sp_IntStrHash_length((sp_IntStrHash *)_t392.v.p) == 0); | |
| if (_t392.cls_id == SP_BUILTIN_STR_POLY_HASH) _t393 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t392.v.p) == 0); | |
| if (_t392.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t393 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t392.v.p) == 0); | |
| if (_t392.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t393 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t392.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_body) || _t393)) { | |
| sp_StrArray * _t394 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t394); | |
| sp_StrArray_push(_t394, (&("\xff" "body can't be blank")[1])); | |
| } | |
| #line 226 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if ((!sp_poly_nil_p(self->iv_body))) { | |
| #line 227 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t395 = self->iv_body; | |
| mrb_int _t396 = 0; | |
| if (_t395.tag == SP_TAG_STR) _t396 = sp_str_length(_t395.v.s); | |
| if (_t395.tag == SP_TAG_OBJ) { | |
| if (_t395.cls_id == 55) _t396 = sp_ActionDispatch_Flash_length((sp_ActionDispatch_Flash *)_t395.v.p); | |
| if (_t395.cls_id == 56) _t396 = sp_ActionDispatch_Session_length((sp_ActionDispatch_Session *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_INT_ARRAY) _t396 = sp_IntArray_length((sp_IntArray *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_FLT_ARRAY) _t396 = sp_FloatArray_length((sp_FloatArray *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_STR_ARRAY) _t396 = sp_StrArray_length((sp_StrArray *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_SYM_ARRAY) _t396 = sp_IntArray_length((sp_IntArray *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_PTR_ARRAY) _t396 = sp_PtrArray_length((sp_PtrArray *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_POLY_ARRAY) _t396 = sp_PolyArray_length((sp_PolyArray *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_STR_INT_HASH) _t396 = sp_StrIntHash_length((sp_StrIntHash *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_STR_STR_HASH) _t396 = sp_StrStrHash_length((sp_StrStrHash *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_INT_STR_HASH) _t396 = sp_IntStrHash_length((sp_IntStrHash *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_STR_POLY_HASH) _t396 = sp_StrPolyHash_length((sp_StrPolyHash *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t396 = sp_SymPolyHash_length((sp_SymPolyHash *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t396 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_INT_ARRAY) _t396 = sp_IntArray_length((sp_IntArray *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_FLT_ARRAY) _t396 = sp_FloatArray_length((sp_FloatArray *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_STR_ARRAY) _t396 = sp_StrArray_length((sp_StrArray *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_SYM_ARRAY) _t396 = sp_IntArray_length((sp_IntArray *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_PTR_ARRAY) _t396 = sp_PtrArray_length((sp_PtrArray *)_t395.v.p); | |
| if (_t395.cls_id == SP_BUILTIN_POLY_ARRAY) _t396 = sp_PolyArray_length((sp_PolyArray *)_t395.v.p); | |
| } | |
| lv_len = _t396; | |
| #line 228 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if ((lv_len < 10LL)) { | |
| sp_StrArray * _t397 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t397); | |
| sp_StrArray_push(_t397, (&("\xff" "body is too short (minimum is 10)")[1])); | |
| return NULL; | |
| } else { | |
| return NULL; | |
| } | |
| } else { | |
| return NULL; | |
| } | |
| return NULL; | |
| } | |
| static sp_RbVal sp_Article__implicit_6872_comments(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_IntArray * lv_results = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(self); | |
| #line 233 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (self->iv_comments_loaded) { | |
| sp_RbVal _t398 = sp_box_int_array(self->iv_comments_cache); | |
| SP_GC_RESTORE(); | |
| return _t398; | |
| } | |
| #line 234 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t399 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t399); | |
| const char * _t400 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t400); | |
| const char * _t401 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t401); | |
| const char * _t402 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t402); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat4(_t399, _t400, _t401, _t402)); | |
| #line 235 "test/models/../../config/../app/controllers/../models/article.rb" | |
| lv_results = sp_IntArray_new(); | |
| #line 236 "test/models/../../config/../app/controllers/../models/article.rb" | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_19: ; | |
| #line 237 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(sp_box_obj((void *)(lv_stmt), 0))); | |
| } | |
| #line 239 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 240 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t403 = sp_box_int_array(lv_results); | |
| SP_GC_RESTORE(); | |
| return _t403; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872__preload_comments(sp_Article__implicit_6872 *self, mrb_int lv_list) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 244 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_cache = lv_list; | |
| #line 245 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_loaded = TRUE; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6872_before_destroy(sp_Article__implicit_6872 *self) { | |
| mrb_int lv_c = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 249 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t404 = sp_Article__implicit_6872_comments(self); | |
| SP_GC_ROOT_RBVAL(_t404); | |
| if (_t404.tag == SP_TAG_OBJ) { | |
| mrb_int _t405_len = 0; | |
| if (_t404.cls_id == SP_BUILTIN_RANGE) _t405_len = ((sp_Range *)_t404.v.p)->last - ((sp_Range *)_t404.v.p)->first + 1; | |
| else if (_t404.cls_id == SP_BUILTIN_INT_ARRAY) _t405_len = sp_IntArray_length((sp_IntArray *)_t404.v.p); | |
| else if (_t404.cls_id == SP_BUILTIN_FLT_ARRAY) _t405_len = sp_FloatArray_length((sp_FloatArray *)_t404.v.p); | |
| else if (_t404.cls_id == SP_BUILTIN_STR_ARRAY) _t405_len = sp_StrArray_length((sp_StrArray *)_t404.v.p); | |
| else if (_t404.cls_id == SP_BUILTIN_SYM_ARRAY) _t405_len = sp_IntArray_length((sp_IntArray *)_t404.v.p); | |
| else if (_t404.cls_id == SP_BUILTIN_PTR_ARRAY) _t405_len = sp_PtrArray_length((sp_PtrArray *)_t404.v.p); | |
| else if (_t404.cls_id == SP_BUILTIN_POLY_ARRAY) _t405_len = sp_PolyArray_length((sp_PolyArray *)_t404.v.p); | |
| else if (_t404.cls_id == SP_BUILTIN_STR_INT_HASH) _t405_len = ((sp_StrIntHash *)_t404.v.p)->len; | |
| else if (_t404.cls_id == SP_BUILTIN_STR_STR_HASH) _t405_len = ((sp_StrStrHash *)_t404.v.p)->len; | |
| else if (_t404.cls_id == SP_BUILTIN_INT_STR_HASH) _t405_len = ((sp_IntStrHash *)_t404.v.p)->len; | |
| else if (_t404.cls_id == SP_BUILTIN_SYM_INT_HASH) _t405_len = ((sp_SymIntHash *)_t404.v.p)->len; | |
| else if (_t404.cls_id == SP_BUILTIN_SYM_STR_HASH) _t405_len = ((sp_SymStrHash *)_t404.v.p)->len; | |
| else if (_t404.cls_id == SP_BUILTIN_STR_POLY_HASH) _t405_len = ((sp_StrPolyHash *)_t404.v.p)->len; | |
| else if (_t404.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t405_len = ((sp_SymPolyHash *)_t404.v.p)->len; | |
| else if (_t404.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t405_len = ((sp_PolyPolyHash *)_t404.v.p)->len; | |
| for (mrb_int _t405 = 0; _t405 < _t405_len; _t405++) { | |
| sp_RbVal _t406 = sp_box_nil(); | |
| if (_t404.cls_id == SP_BUILTIN_RANGE) _t406 = sp_box_int(((sp_Range *)_t404.v.p)->first + _t405); | |
| else if (_t404.cls_id == SP_BUILTIN_INT_ARRAY) _t406 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t404.v.p, _t405)); | |
| else if (_t404.cls_id == SP_BUILTIN_FLT_ARRAY) _t406 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t404.v.p, _t405)); | |
| else if (_t404.cls_id == SP_BUILTIN_STR_ARRAY) _t406 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t404.v.p, _t405)); | |
| else if (_t404.cls_id == SP_BUILTIN_SYM_ARRAY) _t406 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t404.v.p, _t405)); | |
| else if (_t404.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t404.v.p, _t405); _t406 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t404.cls_id == SP_BUILTIN_POLY_ARRAY) _t406 = sp_PolyArray_get((sp_PolyArray *)_t404.v.p, _t405); | |
| else if (_t404.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t404.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t405])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t405]))); _t406 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t404.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t404.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t405])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t405]))); _t406 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t404.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t404.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t405])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t405]))); _t406 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t404.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t404.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t405])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t405]))); _t406 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t404.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t404.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t405])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t405]))); _t406 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t404.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t404.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t405])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t405])); _t406 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t404.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t404.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t405])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t405])); _t406 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t404.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t404.v.p; mrb_int _pk = _sh->order[_t405]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t406 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_c = _t406; | |
| sp_redo_20: ; | |
| sp_RbVal _t407 = lv_c; | |
| sp_RbVal _t408 = sp_box_nil(); | |
| if (_t407.tag == SP_TAG_OBJ) { | |
| if (_t407.cls_id == 52) _t408 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t407.v.p), 52); | |
| if (_t407.cls_id == 65) _t408 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t407.v.p), 52); | |
| if (_t407.cls_id == 67) _t408 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t407.v.p), 52); | |
| if (_t407.cls_id == 71) _t408 = ((void)(sp_ArticlesController_destroy((sp_ArticlesController *)_t407.v.p)), sp_box_nil()); | |
| if (_t407.cls_id == 73) _t408 = ((void)(sp_CommentsController_destroy((sp_CommentsController *)_t407.v.p)), sp_box_nil()); | |
| if (_t407.cls_id == 78) _t408 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t407.v.p), 52); | |
| if (_t407.cls_id == 79) _t408 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t407.v.p), 52); | |
| if (_t407.cls_id == 80) _t408 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t407.v.p), 52); | |
| if (_t407.cls_id == 81) _t408 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t407.v.p), 52); | |
| if (_t407.cls_id == 82) _t408 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t407.v.p), 52); | |
| if (_t407.cls_id == 83) _t408 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t407.v.p), 52); | |
| } | |
| _t408; | |
| } | |
| } | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_Article__implicit_6872_dom_prefix(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 253 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return (&("\xff" "article")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_after_create_commit(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 257 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Broadcasts_cls_prepend((&("\xff" "articles")[1]), (&("\xff" "articles")[1]), sp_Views_Articles_cls_article(sp_box_obj(self, 83), 0, 0)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_after_update_commit(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 261 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t409 = sp_sprintf("article_%s", sp_poly_to_s(self->iv_id)); | |
| SP_GC_ROOT(_t409); | |
| sp_String * _t410 = sp_Views_Articles_cls_article(sp_box_obj(self, 83), 0, 0); | |
| SP_GC_ROOT(_t410); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t409, _t410); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_6872_after_destroy_commit(sp_Article__implicit_6872 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 265 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_Broadcasts_cls_remove((&("\xff" "articles")[1]), sp_sprintf("article_%s", sp_poly_to_s(self->iv_id))); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Article__implicit_6872_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| #line 52 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_IntArray *_t411 = sp_IntArray_new(); | |
| sp_IntArray_push(_t411, SPS_id); | |
| sp_IntArray_push(_t411, SPS_body); | |
| sp_IntArray_push(_t411, SPS_created_at); | |
| sp_IntArray_push(_t411, SPS_title); | |
| sp_IntArray_push(_t411, SPS_updated_at); | |
| return _t411; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Article__implicit_6906) | |
| static inline sp_Article__implicit_6906 *sp_Article__implicit_6906_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article__implicit_6906 *self = SP_POOL_NEW(Article__implicit_6906, sp_Article__implicit_6906_gc_scan); | |
| self->cls_id = 79LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_id = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t412 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t412 = sp_Article__implicit_6906_body_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t412 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t412; | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t413 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t413 = sp_Article__implicit_6906_created_at_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t413 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t413; | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t414 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t414 = sp_Article__implicit_6906_title_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t414 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t414; | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t415 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t415 = sp_Article__implicit_6906_updated_at_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t415 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t415; | |
| self->iv_comments_cache = sp_PolyArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article__implicit_6906_initialize(sp_Article__implicit_6906 *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t416 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t416 = sp_Article__implicit_6906_body_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t416 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t416; | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t417 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t417 = sp_Article__implicit_6906_created_at_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t417 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t417; | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t418 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t418 = sp_Article__implicit_6906_title_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t418 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t418; | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t419 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t419 = sp_Article__implicit_6906_updated_at_eq((sp_Article__implicit_6906 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t419 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t419; | |
| #line 97 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_cache = sp_PolyArray_new(); | |
| #line 98 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906_id(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 8 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t420 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t420; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_id_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 12 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906_body(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 16 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t421 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t421; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_body_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 20 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906_created_at(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 24 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t422 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t422; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_created_at_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 28 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906_title(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 32 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t423 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t423; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_title_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 36 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906_updated_at(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 40 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t424 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t424; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_updated_at_eq(sp_Article__implicit_6906 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 44 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Article__implicit_6906_assign_from_row(sp_Article__implicit_6906 *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906_attributes(sp_Article__implicit_6906 *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906__aref(sp_Article__implicit_6906 *self, sp_RbVal lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_name); | |
| SP_GC_ROOT(self); | |
| #line 106 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t425 = lv_name; | |
| if ((_t425.tag == SP_TAG_SYM && _t425.v.i == SPS_id)) { | |
| #line 108 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t426 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t426; | |
| } else if ((_t425.tag == SP_TAG_SYM && _t425.v.i == SPS_body)) { | |
| #line 110 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t427 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t427; | |
| } else if ((_t425.tag == SP_TAG_SYM && _t425.v.i == SPS_created_at)) { | |
| #line 112 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t428 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t428; | |
| } else if ((_t425.tag == SP_TAG_SYM && _t425.v.i == SPS_title)) { | |
| #line 114 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t429 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t429; | |
| } else if ((_t425.tag == SP_TAG_SYM && _t425.v.i == SPS_updated_at)) { | |
| #line 116 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t430 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t430; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906__aset(sp_Article__implicit_6906 *self, sp_sym lv_name, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 121 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t431 = lv_name; | |
| if (_t431 == SPS_id) { | |
| #line 123 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t433 = lv_value; | |
| mrb_int _t432 = (_t433.tag == SP_TAG_INT) ? _t433.v.i : 0; | |
| self->iv_id = sp_box_int(_t432); | |
| return SP_INT_NIL; | |
| } else if (_t431 == SPS_body) { | |
| #line 125 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t431 == SPS_created_at) { | |
| #line 127 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t431 == SPS_title) { | |
| #line 129 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t431 == SPS_updated_at) { | |
| #line 131 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_Article__implicit_6906_update(sp_Article__implicit_6906 *self, mrb_int lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 136 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t434 = ((sp_ArticleRow *)lv_p)->iv_title; | |
| SP_GC_ROOT(_t434); | |
| if ((_t434 == NULL)) { | |
| #line 137 "test/models/../../config/../app/controllers/../models/article.rb" | |
| } else { | |
| #line 139 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t435 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t435 = sp_Article__implicit_6906_title_eq((sp_Article__implicit_6906 *)self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| default: _t435 = sp_Article__implicit_9372_title_eq(self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| } | |
| _t435; | |
| } | |
| #line 141 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (sp_poly_nil_p(((sp_ActionController_Base *)lv_p)->iv_body)) { | |
| #line 142 "test/models/../../config/../app/controllers/../models/article.rb" | |
| } else { | |
| #line 144 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t436 = 0; | |
| switch (self->cls_id) { | |
| case 79LL: _t436 = sp_Article__implicit_6906_body_eq((sp_Article__implicit_6906 *)self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| default: _t436 = sp_Article__implicit_9372_body_eq(self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| } | |
| _t436; | |
| } | |
| #line 146 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_6906__adapter_insert(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 170 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t437 = (&("\xff" "INSERT INTO articles (body, created_at, title, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t437); | |
| const char * _t438 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t438); | |
| const char * _t439 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t439); | |
| const char * _t440 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t440); | |
| const char * _t441 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t441); | |
| const char * _t442 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t442); | |
| const char * _t443 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t443); | |
| const char * _t444 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t444); | |
| const char * _t445 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t445); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t437, _t438, _t439, _t440, _t441, _t442, _t443, _t444, _t445}, 9)); | |
| #line 171 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_Db_cls_last_insert_rowid(); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_6906__adapter_update(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 175 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t446 = (&("\xff" "UPDATE articles SET ")[1]); | |
| SP_GC_ROOT(_t446); | |
| const char * _t447 = (&("\xff" "body = ")[1]); | |
| SP_GC_ROOT(_t447); | |
| const char * _t448 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t448); | |
| const char * _t449 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t449); | |
| const char * _t450 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t450); | |
| const char * _t451 = (&("\xff" ", title = ")[1]); | |
| SP_GC_ROOT(_t451); | |
| const char * _t452 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t452); | |
| const char * _t453 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t453); | |
| const char * _t454 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t454); | |
| const char * _t455 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t455); | |
| const char * _t456 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t456); | |
| const char * _t457 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t457); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t446, _t447, _t448, _t449, _t450, _t451, _t452, _t453, _t454, _t455, _t456, _t457}, 12)); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_6906__adapter_delete(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 179 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t458 = (&("\xff" "DELETE FROM articles")[1]); | |
| SP_GC_ROOT(_t458); | |
| const char * _t459 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t459); | |
| const char * _t460 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t460); | |
| const char * _t461 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t461); | |
| return sp_Db_cls_exec(sp_str_concat4(_t458, _t459, _t460, _t461)); | |
| return SP_INT_NIL; | |
| } | |
| static sp_RbVal sp_Article__implicit_6906__adapter_reload(sp_Article__implicit_6906 *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 203 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t462 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles WHERE id = ")[1]); | |
| SP_GC_ROOT(_t462); | |
| const char * _t463 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t463); | |
| const char * _t464 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t464); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t462, _t463, _t464)); | |
| #line 204 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| #line 205 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = sp_box_int(sp_Db_cls_column_int(sp_box_obj((void *)(lv_stmt), 0), 0LL)); | |
| #line 206 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 1LL)); | |
| #line 207 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 2LL)); | |
| #line 208 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 3LL)); | |
| #line 209 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 4LL)); | |
| #line 210 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| #line 212 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 213 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t465 = sp_box_obj(self, 83); | |
| SP_GC_RESTORE(); | |
| return _t465; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_StrArray * sp_Article__implicit_6906_validate(sp_Article__implicit_6906 *self) { | |
| mrb_int lv_len = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 224 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t466 = self->iv_title; | |
| mrb_bool _t467 = FALSE; | |
| if (_t466.tag == SP_TAG_STR) _t467 = (sp_str_length(_t466.v.s) == 0); | |
| if (_t466.tag == SP_TAG_OBJ) { | |
| if (_t466.cls_id == 55) _t467 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t466.v.p); | |
| if (_t466.cls_id == 56) _t467 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t466.v.p); | |
| if (_t466.cls_id == SP_BUILTIN_INT_ARRAY) _t467 = (sp_IntArray_length((sp_IntArray *)_t466.v.p) == 0); | |
| if (_t466.cls_id == SP_BUILTIN_FLT_ARRAY) _t467 = (sp_FloatArray_length((sp_FloatArray *)_t466.v.p) == 0); | |
| if (_t466.cls_id == SP_BUILTIN_STR_ARRAY) _t467 = (sp_StrArray_length((sp_StrArray *)_t466.v.p) == 0); | |
| if (_t466.cls_id == SP_BUILTIN_SYM_ARRAY) _t467 = (sp_IntArray_length((sp_IntArray *)_t466.v.p) == 0); | |
| if (_t466.cls_id == SP_BUILTIN_PTR_ARRAY) _t467 = (sp_PtrArray_length((sp_PtrArray *)_t466.v.p) == 0); | |
| if (_t466.cls_id == SP_BUILTIN_POLY_ARRAY) _t467 = (sp_PolyArray_length((sp_PolyArray *)_t466.v.p) == 0); | |
| if (_t466.cls_id == SP_BUILTIN_STR_INT_HASH) _t467 = (sp_StrIntHash_length((sp_StrIntHash *)_t466.v.p) == 0); | |
| if (_t466.cls_id == SP_BUILTIN_STR_STR_HASH) _t467 = (sp_StrStrHash_length((sp_StrStrHash *)_t466.v.p) == 0); | |
| if (_t466.cls_id == SP_BUILTIN_INT_STR_HASH) _t467 = (sp_IntStrHash_length((sp_IntStrHash *)_t466.v.p) == 0); | |
| if (_t466.cls_id == SP_BUILTIN_STR_POLY_HASH) _t467 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t466.v.p) == 0); | |
| if (_t466.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t467 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t466.v.p) == 0); | |
| if (_t466.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t467 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t466.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_title) || _t467)) { | |
| sp_StrArray * _t468 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t468); | |
| sp_StrArray_push(_t468, (&("\xff" "title can't be blank")[1])); | |
| } | |
| #line 225 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t469 = self->iv_body; | |
| mrb_bool _t470 = FALSE; | |
| if (_t469.tag == SP_TAG_STR) _t470 = (sp_str_length(_t469.v.s) == 0); | |
| if (_t469.tag == SP_TAG_OBJ) { | |
| if (_t469.cls_id == 55) _t470 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t469.v.p); | |
| if (_t469.cls_id == 56) _t470 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t469.v.p); | |
| if (_t469.cls_id == SP_BUILTIN_INT_ARRAY) _t470 = (sp_IntArray_length((sp_IntArray *)_t469.v.p) == 0); | |
| if (_t469.cls_id == SP_BUILTIN_FLT_ARRAY) _t470 = (sp_FloatArray_length((sp_FloatArray *)_t469.v.p) == 0); | |
| if (_t469.cls_id == SP_BUILTIN_STR_ARRAY) _t470 = (sp_StrArray_length((sp_StrArray *)_t469.v.p) == 0); | |
| if (_t469.cls_id == SP_BUILTIN_SYM_ARRAY) _t470 = (sp_IntArray_length((sp_IntArray *)_t469.v.p) == 0); | |
| if (_t469.cls_id == SP_BUILTIN_PTR_ARRAY) _t470 = (sp_PtrArray_length((sp_PtrArray *)_t469.v.p) == 0); | |
| if (_t469.cls_id == SP_BUILTIN_POLY_ARRAY) _t470 = (sp_PolyArray_length((sp_PolyArray *)_t469.v.p) == 0); | |
| if (_t469.cls_id == SP_BUILTIN_STR_INT_HASH) _t470 = (sp_StrIntHash_length((sp_StrIntHash *)_t469.v.p) == 0); | |
| if (_t469.cls_id == SP_BUILTIN_STR_STR_HASH) _t470 = (sp_StrStrHash_length((sp_StrStrHash *)_t469.v.p) == 0); | |
| if (_t469.cls_id == SP_BUILTIN_INT_STR_HASH) _t470 = (sp_IntStrHash_length((sp_IntStrHash *)_t469.v.p) == 0); | |
| if (_t469.cls_id == SP_BUILTIN_STR_POLY_HASH) _t470 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t469.v.p) == 0); | |
| if (_t469.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t470 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t469.v.p) == 0); | |
| if (_t469.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t470 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t469.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_body) || _t470)) { | |
| sp_StrArray * _t471 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t471); | |
| sp_StrArray_push(_t471, (&("\xff" "body can't be blank")[1])); | |
| } | |
| #line 226 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if ((!sp_poly_nil_p(self->iv_body))) { | |
| #line 227 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t472 = self->iv_body; | |
| mrb_int _t473 = 0; | |
| if (_t472.tag == SP_TAG_STR) _t473 = sp_str_length(_t472.v.s); | |
| if (_t472.tag == SP_TAG_OBJ) { | |
| if (_t472.cls_id == 55) _t473 = sp_ActionDispatch_Flash_length((sp_ActionDispatch_Flash *)_t472.v.p); | |
| if (_t472.cls_id == 56) _t473 = sp_ActionDispatch_Session_length((sp_ActionDispatch_Session *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_INT_ARRAY) _t473 = sp_IntArray_length((sp_IntArray *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_FLT_ARRAY) _t473 = sp_FloatArray_length((sp_FloatArray *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_STR_ARRAY) _t473 = sp_StrArray_length((sp_StrArray *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_SYM_ARRAY) _t473 = sp_IntArray_length((sp_IntArray *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_PTR_ARRAY) _t473 = sp_PtrArray_length((sp_PtrArray *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_POLY_ARRAY) _t473 = sp_PolyArray_length((sp_PolyArray *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_STR_INT_HASH) _t473 = sp_StrIntHash_length((sp_StrIntHash *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_STR_STR_HASH) _t473 = sp_StrStrHash_length((sp_StrStrHash *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_INT_STR_HASH) _t473 = sp_IntStrHash_length((sp_IntStrHash *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_STR_POLY_HASH) _t473 = sp_StrPolyHash_length((sp_StrPolyHash *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t473 = sp_SymPolyHash_length((sp_SymPolyHash *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t473 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_INT_ARRAY) _t473 = sp_IntArray_length((sp_IntArray *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_FLT_ARRAY) _t473 = sp_FloatArray_length((sp_FloatArray *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_STR_ARRAY) _t473 = sp_StrArray_length((sp_StrArray *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_SYM_ARRAY) _t473 = sp_IntArray_length((sp_IntArray *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_PTR_ARRAY) _t473 = sp_PtrArray_length((sp_PtrArray *)_t472.v.p); | |
| if (_t472.cls_id == SP_BUILTIN_POLY_ARRAY) _t473 = sp_PolyArray_length((sp_PolyArray *)_t472.v.p); | |
| } | |
| lv_len = _t473; | |
| #line 228 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if ((lv_len < 10LL)) { | |
| sp_StrArray * _t474 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t474); | |
| sp_StrArray_push(_t474, (&("\xff" "body is too short (minimum is 10)")[1])); | |
| return NULL; | |
| } else { | |
| return NULL; | |
| } | |
| } else { | |
| return NULL; | |
| } | |
| return NULL; | |
| } | |
| static sp_RbVal sp_Article__implicit_6906_comments(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_IntArray * lv_results = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(self); | |
| #line 233 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (self->iv_comments_loaded) { | |
| sp_RbVal _t475 = sp_box_poly_array(self->iv_comments_cache); | |
| SP_GC_RESTORE(); | |
| return _t475; | |
| } | |
| #line 234 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t476 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t476); | |
| const char * _t477 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t477); | |
| const char * _t478 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t478); | |
| const char * _t479 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t479); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat4(_t476, _t477, _t478, _t479)); | |
| #line 235 "test/models/../../config/../app/controllers/../models/article.rb" | |
| lv_results = sp_IntArray_new(); | |
| #line 236 "test/models/../../config/../app/controllers/../models/article.rb" | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_21: ; | |
| #line 237 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(sp_box_obj((void *)(lv_stmt), 0))); | |
| } | |
| #line 239 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 240 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t480 = sp_box_int_array(lv_results); | |
| SP_GC_RESTORE(); | |
| return _t480; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906__preload_comments(sp_Article__implicit_6906 *self, sp_PtrArray * lv_list) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_list); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_list); | |
| #line 244 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_cache = lv_list; | |
| #line 245 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_loaded = TRUE; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_6906_before_destroy(sp_Article__implicit_6906 *self) { | |
| mrb_int lv_c = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 249 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t481 = sp_Article__implicit_6906_comments(self); | |
| SP_GC_ROOT_RBVAL(_t481); | |
| if (_t481.tag == SP_TAG_OBJ) { | |
| mrb_int _t482_len = 0; | |
| if (_t481.cls_id == SP_BUILTIN_RANGE) _t482_len = ((sp_Range *)_t481.v.p)->last - ((sp_Range *)_t481.v.p)->first + 1; | |
| else if (_t481.cls_id == SP_BUILTIN_INT_ARRAY) _t482_len = sp_IntArray_length((sp_IntArray *)_t481.v.p); | |
| else if (_t481.cls_id == SP_BUILTIN_FLT_ARRAY) _t482_len = sp_FloatArray_length((sp_FloatArray *)_t481.v.p); | |
| else if (_t481.cls_id == SP_BUILTIN_STR_ARRAY) _t482_len = sp_StrArray_length((sp_StrArray *)_t481.v.p); | |
| else if (_t481.cls_id == SP_BUILTIN_SYM_ARRAY) _t482_len = sp_IntArray_length((sp_IntArray *)_t481.v.p); | |
| else if (_t481.cls_id == SP_BUILTIN_PTR_ARRAY) _t482_len = sp_PtrArray_length((sp_PtrArray *)_t481.v.p); | |
| else if (_t481.cls_id == SP_BUILTIN_POLY_ARRAY) _t482_len = sp_PolyArray_length((sp_PolyArray *)_t481.v.p); | |
| else if (_t481.cls_id == SP_BUILTIN_STR_INT_HASH) _t482_len = ((sp_StrIntHash *)_t481.v.p)->len; | |
| else if (_t481.cls_id == SP_BUILTIN_STR_STR_HASH) _t482_len = ((sp_StrStrHash *)_t481.v.p)->len; | |
| else if (_t481.cls_id == SP_BUILTIN_INT_STR_HASH) _t482_len = ((sp_IntStrHash *)_t481.v.p)->len; | |
| else if (_t481.cls_id == SP_BUILTIN_SYM_INT_HASH) _t482_len = ((sp_SymIntHash *)_t481.v.p)->len; | |
| else if (_t481.cls_id == SP_BUILTIN_SYM_STR_HASH) _t482_len = ((sp_SymStrHash *)_t481.v.p)->len; | |
| else if (_t481.cls_id == SP_BUILTIN_STR_POLY_HASH) _t482_len = ((sp_StrPolyHash *)_t481.v.p)->len; | |
| else if (_t481.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t482_len = ((sp_SymPolyHash *)_t481.v.p)->len; | |
| else if (_t481.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t482_len = ((sp_PolyPolyHash *)_t481.v.p)->len; | |
| for (mrb_int _t482 = 0; _t482 < _t482_len; _t482++) { | |
| sp_RbVal _t483 = sp_box_nil(); | |
| if (_t481.cls_id == SP_BUILTIN_RANGE) _t483 = sp_box_int(((sp_Range *)_t481.v.p)->first + _t482); | |
| else if (_t481.cls_id == SP_BUILTIN_INT_ARRAY) _t483 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t481.v.p, _t482)); | |
| else if (_t481.cls_id == SP_BUILTIN_FLT_ARRAY) _t483 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t481.v.p, _t482)); | |
| else if (_t481.cls_id == SP_BUILTIN_STR_ARRAY) _t483 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t481.v.p, _t482)); | |
| else if (_t481.cls_id == SP_BUILTIN_SYM_ARRAY) _t483 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t481.v.p, _t482)); | |
| else if (_t481.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t481.v.p, _t482); _t483 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t481.cls_id == SP_BUILTIN_POLY_ARRAY) _t483 = sp_PolyArray_get((sp_PolyArray *)_t481.v.p, _t482); | |
| else if (_t481.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t481.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t482])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t482]))); _t483 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t481.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t481.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t482])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t482]))); _t483 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t481.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t481.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t482])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t482]))); _t483 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t481.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t481.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t482])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t482]))); _t483 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t481.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t481.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t482])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t482]))); _t483 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t481.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t481.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t482])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t482])); _t483 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t481.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t481.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t482])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t482])); _t483 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t481.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t481.v.p; mrb_int _pk = _sh->order[_t482]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t483 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_c = _t483; | |
| sp_redo_22: ; | |
| sp_RbVal _t484 = lv_c; | |
| sp_RbVal _t485 = sp_box_nil(); | |
| if (_t484.tag == SP_TAG_OBJ) { | |
| if (_t484.cls_id == 52) _t485 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t484.v.p), 52); | |
| if (_t484.cls_id == 65) _t485 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t484.v.p), 52); | |
| if (_t484.cls_id == 67) _t485 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t484.v.p), 52); | |
| if (_t484.cls_id == 71) _t485 = ((void)(sp_ArticlesController_destroy((sp_ArticlesController *)_t484.v.p)), sp_box_nil()); | |
| if (_t484.cls_id == 73) _t485 = ((void)(sp_CommentsController_destroy((sp_CommentsController *)_t484.v.p)), sp_box_nil()); | |
| if (_t484.cls_id == 78) _t485 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t484.v.p), 52); | |
| if (_t484.cls_id == 79) _t485 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t484.v.p), 52); | |
| if (_t484.cls_id == 80) _t485 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t484.v.p), 52); | |
| if (_t484.cls_id == 81) _t485 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t484.v.p), 52); | |
| if (_t484.cls_id == 82) _t485 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t484.v.p), 52); | |
| if (_t484.cls_id == 83) _t485 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t484.v.p), 52); | |
| } | |
| _t485; | |
| } | |
| } | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_Article__implicit_6906_dom_prefix(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 253 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return (&("\xff" "article")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_after_create_commit(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 257 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Broadcasts_cls_prepend((&("\xff" "articles")[1]), (&("\xff" "articles")[1]), sp_Views_Articles_cls_article(sp_box_obj(self, 83), 0, 0)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_after_update_commit(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 261 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t486 = sp_sprintf("article_%s", sp_poly_to_s(self->iv_id)); | |
| SP_GC_ROOT(_t486); | |
| sp_String * _t487 = sp_Views_Articles_cls_article(sp_box_obj(self, 83), 0, 0); | |
| SP_GC_ROOT(_t487); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t486, _t487); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_6906_after_destroy_commit(sp_Article__implicit_6906 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 265 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_Broadcasts_cls_remove((&("\xff" "articles")[1]), sp_sprintf("article_%s", sp_poly_to_s(self->iv_id))); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Article__implicit_6906_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| #line 52 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_IntArray *_t488 = sp_IntArray_new(); | |
| sp_IntArray_push(_t488, SPS_id); | |
| sp_IntArray_push(_t488, SPS_body); | |
| sp_IntArray_push(_t488, SPS_created_at); | |
| sp_IntArray_push(_t488, SPS_title); | |
| sp_IntArray_push(_t488, SPS_updated_at); | |
| return _t488; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Article__implicit_7484) | |
| static inline sp_Article__implicit_7484 *sp_Article__implicit_7484_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article__implicit_7484 *self = SP_POOL_NEW(Article__implicit_7484, sp_Article__implicit_7484_gc_scan); | |
| self->cls_id = 80LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_id = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t489 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t489 = sp_Article__implicit_7484_body_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t489 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t489; | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t490 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t490 = sp_Article__implicit_7484_created_at_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t490 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t490; | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t491 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t491 = sp_Article__implicit_7484_title_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t491 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t491; | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t492 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t492 = sp_Article__implicit_7484_updated_at_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t492 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t492; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article__implicit_7484_initialize(sp_Article__implicit_7484 *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t493 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t493 = sp_Article__implicit_7484_body_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t493 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t493; | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t494 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t494 = sp_Article__implicit_7484_created_at_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t494 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t494; | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t495 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t495 = sp_Article__implicit_7484_title_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t495 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t495; | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t496 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t496 = sp_Article__implicit_7484_updated_at_eq((sp_Article__implicit_7484 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t496 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t496; | |
| #line 97 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| #line 98 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484_id(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 8 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t497 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t497; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_id_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 12 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484_body(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 16 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t498 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t498; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_body_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 20 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484_created_at(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 24 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t499 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t499; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_created_at_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 28 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484_title(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 32 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t500 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t500; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_title_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 36 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484_updated_at(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 40 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t501 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t501; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_updated_at_eq(sp_Article__implicit_7484 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 44 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Article__implicit_7484_assign_from_row(sp_Article__implicit_7484 *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484_attributes(sp_Article__implicit_7484 *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484__aref(sp_Article__implicit_7484 *self, sp_RbVal lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_name); | |
| SP_GC_ROOT(self); | |
| #line 106 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t502 = lv_name; | |
| if ((_t502.tag == SP_TAG_SYM && _t502.v.i == SPS_id)) { | |
| #line 108 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t503 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t503; | |
| } else if ((_t502.tag == SP_TAG_SYM && _t502.v.i == SPS_body)) { | |
| #line 110 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t504 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t504; | |
| } else if ((_t502.tag == SP_TAG_SYM && _t502.v.i == SPS_created_at)) { | |
| #line 112 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t505 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t505; | |
| } else if ((_t502.tag == SP_TAG_SYM && _t502.v.i == SPS_title)) { | |
| #line 114 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t506 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t506; | |
| } else if ((_t502.tag == SP_TAG_SYM && _t502.v.i == SPS_updated_at)) { | |
| #line 116 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t507 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t507; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484__aset(sp_Article__implicit_7484 *self, sp_sym lv_name, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 121 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t508 = lv_name; | |
| if (_t508 == SPS_id) { | |
| #line 123 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t510 = lv_value; | |
| mrb_int _t509 = (_t510.tag == SP_TAG_INT) ? _t510.v.i : 0; | |
| self->iv_id = sp_box_int(_t509); | |
| return SP_INT_NIL; | |
| } else if (_t508 == SPS_body) { | |
| #line 125 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t508 == SPS_created_at) { | |
| #line 127 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t508 == SPS_title) { | |
| #line 129 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t508 == SPS_updated_at) { | |
| #line 131 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_Article__implicit_7484_update(sp_Article__implicit_7484 *self, sp_ArticleParams * lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_p); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_p); | |
| #line 136 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t511 = lv_p->iv_title; | |
| SP_GC_ROOT(_t511); | |
| if ((_t511 == NULL)) { | |
| #line 137 "test/models/../../config/../app/controllers/../models/article.rb" | |
| } else { | |
| #line 139 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t512 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t512 = sp_Article__implicit_7484_title_eq((sp_Article__implicit_7484 *)self, sp_box_str(lv_p->iv_title)); break; | |
| default: _t512 = sp_Article__implicit_9372_title_eq(self, sp_box_str(lv_p->iv_title)); break; | |
| } | |
| _t512; | |
| } | |
| #line 141 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t513 = lv_p->iv_body; | |
| SP_GC_ROOT(_t513); | |
| if ((_t513 == NULL)) { | |
| #line 142 "test/models/../../config/../app/controllers/../models/article.rb" | |
| } else { | |
| #line 144 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t514 = 0; | |
| switch (self->cls_id) { | |
| case 80LL: _t514 = sp_Article__implicit_7484_body_eq((sp_Article__implicit_7484 *)self, sp_box_str(lv_p->iv_body)); break; | |
| default: _t514 = sp_Article__implicit_9372_body_eq(self, sp_box_str(lv_p->iv_body)); break; | |
| } | |
| _t514; | |
| } | |
| #line 146 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_7484__adapter_insert(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 170 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t515 = (&("\xff" "INSERT INTO articles (body, created_at, title, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t515); | |
| const char * _t516 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t516); | |
| const char * _t517 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t517); | |
| const char * _t518 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t518); | |
| const char * _t519 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t519); | |
| const char * _t520 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t520); | |
| const char * _t521 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t521); | |
| const char * _t522 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t522); | |
| const char * _t523 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t523); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t515, _t516, _t517, _t518, _t519, _t520, _t521, _t522, _t523}, 9)); | |
| #line 171 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_Db_cls_last_insert_rowid(); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_7484__adapter_update(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 175 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t524 = (&("\xff" "UPDATE articles SET ")[1]); | |
| SP_GC_ROOT(_t524); | |
| const char * _t525 = (&("\xff" "body = ")[1]); | |
| SP_GC_ROOT(_t525); | |
| const char * _t526 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t526); | |
| const char * _t527 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t527); | |
| const char * _t528 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t528); | |
| const char * _t529 = (&("\xff" ", title = ")[1]); | |
| SP_GC_ROOT(_t529); | |
| const char * _t530 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t530); | |
| const char * _t531 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t531); | |
| const char * _t532 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t532); | |
| const char * _t533 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t533); | |
| const char * _t534 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t534); | |
| const char * _t535 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t535); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t524, _t525, _t526, _t527, _t528, _t529, _t530, _t531, _t532, _t533, _t534, _t535}, 12)); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_7484__adapter_delete(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 179 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t536 = (&("\xff" "DELETE FROM articles")[1]); | |
| SP_GC_ROOT(_t536); | |
| const char * _t537 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t537); | |
| const char * _t538 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t538); | |
| const char * _t539 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t539); | |
| return sp_Db_cls_exec(sp_str_concat4(_t536, _t537, _t538, _t539)); | |
| return SP_INT_NIL; | |
| } | |
| static sp_RbVal sp_Article__implicit_7484__adapter_reload(sp_Article__implicit_7484 *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 203 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t540 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles WHERE id = ")[1]); | |
| SP_GC_ROOT(_t540); | |
| const char * _t541 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t541); | |
| const char * _t542 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t542); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t540, _t541, _t542)); | |
| #line 204 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| #line 205 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = sp_box_int(sp_Db_cls_column_int(sp_box_obj((void *)(lv_stmt), 0), 0LL)); | |
| #line 206 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 1LL)); | |
| #line 207 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 2LL)); | |
| #line 208 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 3LL)); | |
| #line 209 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 4LL)); | |
| #line 210 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| #line 212 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 213 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t543 = sp_box_obj(self, 83); | |
| SP_GC_RESTORE(); | |
| return _t543; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_StrArray * sp_Article__implicit_7484_validate(sp_Article__implicit_7484 *self) { | |
| mrb_int lv_len = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 224 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t544 = self->iv_title; | |
| mrb_bool _t545 = FALSE; | |
| if (_t544.tag == SP_TAG_STR) _t545 = (sp_str_length(_t544.v.s) == 0); | |
| if (_t544.tag == SP_TAG_OBJ) { | |
| if (_t544.cls_id == 55) _t545 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t544.v.p); | |
| if (_t544.cls_id == 56) _t545 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t544.v.p); | |
| if (_t544.cls_id == SP_BUILTIN_INT_ARRAY) _t545 = (sp_IntArray_length((sp_IntArray *)_t544.v.p) == 0); | |
| if (_t544.cls_id == SP_BUILTIN_FLT_ARRAY) _t545 = (sp_FloatArray_length((sp_FloatArray *)_t544.v.p) == 0); | |
| if (_t544.cls_id == SP_BUILTIN_STR_ARRAY) _t545 = (sp_StrArray_length((sp_StrArray *)_t544.v.p) == 0); | |
| if (_t544.cls_id == SP_BUILTIN_SYM_ARRAY) _t545 = (sp_IntArray_length((sp_IntArray *)_t544.v.p) == 0); | |
| if (_t544.cls_id == SP_BUILTIN_PTR_ARRAY) _t545 = (sp_PtrArray_length((sp_PtrArray *)_t544.v.p) == 0); | |
| if (_t544.cls_id == SP_BUILTIN_POLY_ARRAY) _t545 = (sp_PolyArray_length((sp_PolyArray *)_t544.v.p) == 0); | |
| if (_t544.cls_id == SP_BUILTIN_STR_INT_HASH) _t545 = (sp_StrIntHash_length((sp_StrIntHash *)_t544.v.p) == 0); | |
| if (_t544.cls_id == SP_BUILTIN_STR_STR_HASH) _t545 = (sp_StrStrHash_length((sp_StrStrHash *)_t544.v.p) == 0); | |
| if (_t544.cls_id == SP_BUILTIN_INT_STR_HASH) _t545 = (sp_IntStrHash_length((sp_IntStrHash *)_t544.v.p) == 0); | |
| if (_t544.cls_id == SP_BUILTIN_STR_POLY_HASH) _t545 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t544.v.p) == 0); | |
| if (_t544.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t545 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t544.v.p) == 0); | |
| if (_t544.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t545 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t544.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_title) || _t545)) { | |
| sp_StrArray * _t546 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t546); | |
| sp_StrArray_push(_t546, (&("\xff" "title can't be blank")[1])); | |
| } | |
| #line 225 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t547 = self->iv_body; | |
| mrb_bool _t548 = FALSE; | |
| if (_t547.tag == SP_TAG_STR) _t548 = (sp_str_length(_t547.v.s) == 0); | |
| if (_t547.tag == SP_TAG_OBJ) { | |
| if (_t547.cls_id == 55) _t548 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t547.v.p); | |
| if (_t547.cls_id == 56) _t548 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t547.v.p); | |
| if (_t547.cls_id == SP_BUILTIN_INT_ARRAY) _t548 = (sp_IntArray_length((sp_IntArray *)_t547.v.p) == 0); | |
| if (_t547.cls_id == SP_BUILTIN_FLT_ARRAY) _t548 = (sp_FloatArray_length((sp_FloatArray *)_t547.v.p) == 0); | |
| if (_t547.cls_id == SP_BUILTIN_STR_ARRAY) _t548 = (sp_StrArray_length((sp_StrArray *)_t547.v.p) == 0); | |
| if (_t547.cls_id == SP_BUILTIN_SYM_ARRAY) _t548 = (sp_IntArray_length((sp_IntArray *)_t547.v.p) == 0); | |
| if (_t547.cls_id == SP_BUILTIN_PTR_ARRAY) _t548 = (sp_PtrArray_length((sp_PtrArray *)_t547.v.p) == 0); | |
| if (_t547.cls_id == SP_BUILTIN_POLY_ARRAY) _t548 = (sp_PolyArray_length((sp_PolyArray *)_t547.v.p) == 0); | |
| if (_t547.cls_id == SP_BUILTIN_STR_INT_HASH) _t548 = (sp_StrIntHash_length((sp_StrIntHash *)_t547.v.p) == 0); | |
| if (_t547.cls_id == SP_BUILTIN_STR_STR_HASH) _t548 = (sp_StrStrHash_length((sp_StrStrHash *)_t547.v.p) == 0); | |
| if (_t547.cls_id == SP_BUILTIN_INT_STR_HASH) _t548 = (sp_IntStrHash_length((sp_IntStrHash *)_t547.v.p) == 0); | |
| if (_t547.cls_id == SP_BUILTIN_STR_POLY_HASH) _t548 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t547.v.p) == 0); | |
| if (_t547.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t548 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t547.v.p) == 0); | |
| if (_t547.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t548 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t547.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_body) || _t548)) { | |
| sp_StrArray * _t549 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t549); | |
| sp_StrArray_push(_t549, (&("\xff" "body can't be blank")[1])); | |
| } | |
| #line 226 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if ((!sp_poly_nil_p(self->iv_body))) { | |
| #line 227 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t550 = self->iv_body; | |
| mrb_int _t551 = 0; | |
| if (_t550.tag == SP_TAG_STR) _t551 = sp_str_length(_t550.v.s); | |
| if (_t550.tag == SP_TAG_OBJ) { | |
| if (_t550.cls_id == 55) _t551 = sp_ActionDispatch_Flash_length((sp_ActionDispatch_Flash *)_t550.v.p); | |
| if (_t550.cls_id == 56) _t551 = sp_ActionDispatch_Session_length((sp_ActionDispatch_Session *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_INT_ARRAY) _t551 = sp_IntArray_length((sp_IntArray *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_FLT_ARRAY) _t551 = sp_FloatArray_length((sp_FloatArray *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_STR_ARRAY) _t551 = sp_StrArray_length((sp_StrArray *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_SYM_ARRAY) _t551 = sp_IntArray_length((sp_IntArray *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_PTR_ARRAY) _t551 = sp_PtrArray_length((sp_PtrArray *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_POLY_ARRAY) _t551 = sp_PolyArray_length((sp_PolyArray *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_STR_INT_HASH) _t551 = sp_StrIntHash_length((sp_StrIntHash *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_STR_STR_HASH) _t551 = sp_StrStrHash_length((sp_StrStrHash *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_INT_STR_HASH) _t551 = sp_IntStrHash_length((sp_IntStrHash *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_STR_POLY_HASH) _t551 = sp_StrPolyHash_length((sp_StrPolyHash *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t551 = sp_SymPolyHash_length((sp_SymPolyHash *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t551 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_INT_ARRAY) _t551 = sp_IntArray_length((sp_IntArray *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_FLT_ARRAY) _t551 = sp_FloatArray_length((sp_FloatArray *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_STR_ARRAY) _t551 = sp_StrArray_length((sp_StrArray *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_SYM_ARRAY) _t551 = sp_IntArray_length((sp_IntArray *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_PTR_ARRAY) _t551 = sp_PtrArray_length((sp_PtrArray *)_t550.v.p); | |
| if (_t550.cls_id == SP_BUILTIN_POLY_ARRAY) _t551 = sp_PolyArray_length((sp_PolyArray *)_t550.v.p); | |
| } | |
| lv_len = _t551; | |
| #line 228 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if ((lv_len < 10LL)) { | |
| sp_StrArray * _t552 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t552); | |
| sp_StrArray_push(_t552, (&("\xff" "body is too short (minimum is 10)")[1])); | |
| return NULL; | |
| } else { | |
| return NULL; | |
| } | |
| } else { | |
| return NULL; | |
| } | |
| return NULL; | |
| } | |
| static sp_RbVal sp_Article__implicit_7484_comments(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_IntArray * lv_results = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(self); | |
| #line 233 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (self->iv_comments_loaded) { | |
| sp_RbVal _t553 = sp_box_int_array(self->iv_comments_cache); | |
| SP_GC_RESTORE(); | |
| return _t553; | |
| } | |
| #line 234 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t554 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t554); | |
| const char * _t555 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t555); | |
| const char * _t556 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t556); | |
| const char * _t557 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t557); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat4(_t554, _t555, _t556, _t557)); | |
| #line 235 "test/models/../../config/../app/controllers/../models/article.rb" | |
| lv_results = sp_IntArray_new(); | |
| #line 236 "test/models/../../config/../app/controllers/../models/article.rb" | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_23: ; | |
| #line 237 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(sp_box_obj((void *)(lv_stmt), 0))); | |
| } | |
| #line 239 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 240 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t558 = sp_box_int_array(lv_results); | |
| SP_GC_RESTORE(); | |
| return _t558; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484__preload_comments(sp_Article__implicit_7484 *self, mrb_int lv_list) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 244 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_cache = lv_list; | |
| #line 245 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_loaded = TRUE; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7484_before_destroy(sp_Article__implicit_7484 *self) { | |
| mrb_int lv_c = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 249 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t559 = sp_Article__implicit_7484_comments(self); | |
| SP_GC_ROOT_RBVAL(_t559); | |
| if (_t559.tag == SP_TAG_OBJ) { | |
| mrb_int _t560_len = 0; | |
| if (_t559.cls_id == SP_BUILTIN_RANGE) _t560_len = ((sp_Range *)_t559.v.p)->last - ((sp_Range *)_t559.v.p)->first + 1; | |
| else if (_t559.cls_id == SP_BUILTIN_INT_ARRAY) _t560_len = sp_IntArray_length((sp_IntArray *)_t559.v.p); | |
| else if (_t559.cls_id == SP_BUILTIN_FLT_ARRAY) _t560_len = sp_FloatArray_length((sp_FloatArray *)_t559.v.p); | |
| else if (_t559.cls_id == SP_BUILTIN_STR_ARRAY) _t560_len = sp_StrArray_length((sp_StrArray *)_t559.v.p); | |
| else if (_t559.cls_id == SP_BUILTIN_SYM_ARRAY) _t560_len = sp_IntArray_length((sp_IntArray *)_t559.v.p); | |
| else if (_t559.cls_id == SP_BUILTIN_PTR_ARRAY) _t560_len = sp_PtrArray_length((sp_PtrArray *)_t559.v.p); | |
| else if (_t559.cls_id == SP_BUILTIN_POLY_ARRAY) _t560_len = sp_PolyArray_length((sp_PolyArray *)_t559.v.p); | |
| else if (_t559.cls_id == SP_BUILTIN_STR_INT_HASH) _t560_len = ((sp_StrIntHash *)_t559.v.p)->len; | |
| else if (_t559.cls_id == SP_BUILTIN_STR_STR_HASH) _t560_len = ((sp_StrStrHash *)_t559.v.p)->len; | |
| else if (_t559.cls_id == SP_BUILTIN_INT_STR_HASH) _t560_len = ((sp_IntStrHash *)_t559.v.p)->len; | |
| else if (_t559.cls_id == SP_BUILTIN_SYM_INT_HASH) _t560_len = ((sp_SymIntHash *)_t559.v.p)->len; | |
| else if (_t559.cls_id == SP_BUILTIN_SYM_STR_HASH) _t560_len = ((sp_SymStrHash *)_t559.v.p)->len; | |
| else if (_t559.cls_id == SP_BUILTIN_STR_POLY_HASH) _t560_len = ((sp_StrPolyHash *)_t559.v.p)->len; | |
| else if (_t559.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t560_len = ((sp_SymPolyHash *)_t559.v.p)->len; | |
| else if (_t559.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t560_len = ((sp_PolyPolyHash *)_t559.v.p)->len; | |
| for (mrb_int _t560 = 0; _t560 < _t560_len; _t560++) { | |
| sp_RbVal _t561 = sp_box_nil(); | |
| if (_t559.cls_id == SP_BUILTIN_RANGE) _t561 = sp_box_int(((sp_Range *)_t559.v.p)->first + _t560); | |
| else if (_t559.cls_id == SP_BUILTIN_INT_ARRAY) _t561 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t559.v.p, _t560)); | |
| else if (_t559.cls_id == SP_BUILTIN_FLT_ARRAY) _t561 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t559.v.p, _t560)); | |
| else if (_t559.cls_id == SP_BUILTIN_STR_ARRAY) _t561 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t559.v.p, _t560)); | |
| else if (_t559.cls_id == SP_BUILTIN_SYM_ARRAY) _t561 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t559.v.p, _t560)); | |
| else if (_t559.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t559.v.p, _t560); _t561 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t559.cls_id == SP_BUILTIN_POLY_ARRAY) _t561 = sp_PolyArray_get((sp_PolyArray *)_t559.v.p, _t560); | |
| else if (_t559.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t559.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t560])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t560]))); _t561 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t559.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t559.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t560])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t560]))); _t561 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t559.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t559.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t560])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t560]))); _t561 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t559.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t559.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t560])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t560]))); _t561 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t559.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t559.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t560])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t560]))); _t561 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t559.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t559.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t560])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t560])); _t561 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t559.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t559.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t560])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t560])); _t561 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t559.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t559.v.p; mrb_int _pk = _sh->order[_t560]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t561 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_c = _t561; | |
| sp_redo_24: ; | |
| sp_RbVal _t562 = lv_c; | |
| sp_RbVal _t563 = sp_box_nil(); | |
| if (_t562.tag == SP_TAG_OBJ) { | |
| if (_t562.cls_id == 52) _t563 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t562.v.p), 52); | |
| if (_t562.cls_id == 65) _t563 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t562.v.p), 52); | |
| if (_t562.cls_id == 67) _t563 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t562.v.p), 52); | |
| if (_t562.cls_id == 71) _t563 = ((void)(sp_ArticlesController_destroy((sp_ArticlesController *)_t562.v.p)), sp_box_nil()); | |
| if (_t562.cls_id == 73) _t563 = ((void)(sp_CommentsController_destroy((sp_CommentsController *)_t562.v.p)), sp_box_nil()); | |
| if (_t562.cls_id == 78) _t563 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t562.v.p), 52); | |
| if (_t562.cls_id == 79) _t563 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t562.v.p), 52); | |
| if (_t562.cls_id == 80) _t563 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t562.v.p), 52); | |
| if (_t562.cls_id == 81) _t563 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t562.v.p), 52); | |
| if (_t562.cls_id == 82) _t563 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t562.v.p), 52); | |
| if (_t562.cls_id == 83) _t563 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t562.v.p), 52); | |
| } | |
| _t563; | |
| } | |
| } | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_Article__implicit_7484_dom_prefix(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 253 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return (&("\xff" "article")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_after_create_commit(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 257 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Broadcasts_cls_prepend((&("\xff" "articles")[1]), (&("\xff" "articles")[1]), sp_Views_Articles_cls_article(sp_box_obj(self, 83), 0, 0)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_after_update_commit(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 261 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t564 = sp_sprintf("article_%s", sp_poly_to_s(self->iv_id)); | |
| SP_GC_ROOT(_t564); | |
| sp_String * _t565 = sp_Views_Articles_cls_article(sp_box_obj(self, 83), 0, 0); | |
| SP_GC_ROOT(_t565); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t564, _t565); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_7484_after_destroy_commit(sp_Article__implicit_7484 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 265 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_Broadcasts_cls_remove((&("\xff" "articles")[1]), sp_sprintf("article_%s", sp_poly_to_s(self->iv_id))); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Article__implicit_7484_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| #line 52 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_IntArray *_t566 = sp_IntArray_new(); | |
| sp_IntArray_push(_t566, SPS_id); | |
| sp_IntArray_push(_t566, SPS_body); | |
| sp_IntArray_push(_t566, SPS_created_at); | |
| sp_IntArray_push(_t566, SPS_title); | |
| sp_IntArray_push(_t566, SPS_updated_at); | |
| return _t566; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Article__implicit_7995) | |
| static inline sp_Article__implicit_7995 *sp_Article__implicit_7995_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article__implicit_7995 *self = SP_POOL_NEW(Article__implicit_7995, sp_Article__implicit_7995_gc_scan); | |
| self->cls_id = 81LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_id = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t567 = 0; | |
| switch (self->cls_id) { | |
| case 81LL: _t567 = sp_Article__implicit_7995_body_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t567 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t567; | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t568 = 0; | |
| switch (self->cls_id) { | |
| case 81LL: _t568 = sp_Article__implicit_7995_created_at_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t568 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t568; | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t569 = 0; | |
| switch (self->cls_id) { | |
| case 81LL: _t569 = sp_Article__implicit_7995_title_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t569 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t569; | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t570 = 0; | |
| switch (self->cls_id) { | |
| case 81LL: _t570 = sp_Article__implicit_7995_updated_at_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t570 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t570; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article__implicit_7995_initialize(sp_Article__implicit_7995 *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t571 = 0; | |
| switch (self->cls_id) { | |
| case 81LL: _t571 = sp_Article__implicit_7995_body_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t571 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t571; | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t572 = 0; | |
| switch (self->cls_id) { | |
| case 81LL: _t572 = sp_Article__implicit_7995_created_at_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t572 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t572; | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t573 = 0; | |
| switch (self->cls_id) { | |
| case 81LL: _t573 = sp_Article__implicit_7995_title_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t573 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t573; | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t574 = 0; | |
| switch (self->cls_id) { | |
| case 81LL: _t574 = sp_Article__implicit_7995_updated_at_eq((sp_Article__implicit_7995 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t574 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t574; | |
| #line 97 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| #line 98 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995_id(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 8 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t575 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t575; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_id_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 12 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995_body(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 16 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t576 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t576; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_body_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 20 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995_created_at(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 24 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t577 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t577; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_created_at_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 28 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995_title(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 32 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t578 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t578; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_title_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 36 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995_updated_at(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 40 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t579 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t579; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_updated_at_eq(sp_Article__implicit_7995 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 44 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Article__implicit_7995_assign_from_row(sp_Article__implicit_7995 *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995_attributes(sp_Article__implicit_7995 *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995__aref(sp_Article__implicit_7995 *self, sp_RbVal lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_name); | |
| SP_GC_ROOT(self); | |
| #line 106 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t580 = lv_name; | |
| if ((_t580.tag == SP_TAG_SYM && _t580.v.i == SPS_id)) { | |
| #line 108 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t581 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t581; | |
| } else if ((_t580.tag == SP_TAG_SYM && _t580.v.i == SPS_body)) { | |
| #line 110 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t582 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t582; | |
| } else if ((_t580.tag == SP_TAG_SYM && _t580.v.i == SPS_created_at)) { | |
| #line 112 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t583 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t583; | |
| } else if ((_t580.tag == SP_TAG_SYM && _t580.v.i == SPS_title)) { | |
| #line 114 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t584 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t584; | |
| } else if ((_t580.tag == SP_TAG_SYM && _t580.v.i == SPS_updated_at)) { | |
| #line 116 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t585 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t585; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995__aset(sp_Article__implicit_7995 *self, sp_sym lv_name, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 121 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t586 = lv_name; | |
| if (_t586 == SPS_id) { | |
| #line 123 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t588 = lv_value; | |
| mrb_int _t587 = (_t588.tag == SP_TAG_INT) ? _t588.v.i : 0; | |
| self->iv_id = sp_box_int(_t587); | |
| return SP_INT_NIL; | |
| } else if (_t586 == SPS_body) { | |
| #line 125 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t586 == SPS_created_at) { | |
| #line 127 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t586 == SPS_title) { | |
| #line 129 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t586 == SPS_updated_at) { | |
| #line 131 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_Article__implicit_7995_update(sp_Article__implicit_7995 *self, sp_ArticleParams * lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_p); | |
| SP_GC_ROOT(self); | |
| SP_GC_ROOT(lv_p); | |
| #line 136 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t589 = lv_p->iv_title; | |
| SP_GC_ROOT(_t589); | |
| if ((_t589 == NULL)) { | |
| #line 137 "test/models/../../config/../app/controllers/../models/article.rb" | |
| } else { | |
| #line 139 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t590 = 0; | |
| switch (self->cls_id) { | |
| case 81LL: _t590 = sp_Article__implicit_7995_title_eq((sp_Article__implicit_7995 *)self, sp_box_str(lv_p->iv_title)); break; | |
| default: _t590 = sp_Article__implicit_9372_title_eq(self, sp_box_str(lv_p->iv_title)); break; | |
| } | |
| _t590; | |
| } | |
| #line 141 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t591 = lv_p->iv_body; | |
| SP_GC_ROOT(_t591); | |
| if ((_t591 == NULL)) { | |
| #line 142 "test/models/../../config/../app/controllers/../models/article.rb" | |
| } else { | |
| #line 144 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t592 = 0; | |
| switch (self->cls_id) { | |
| case 81LL: _t592 = sp_Article__implicit_7995_body_eq((sp_Article__implicit_7995 *)self, sp_box_str(lv_p->iv_body)); break; | |
| default: _t592 = sp_Article__implicit_9372_body_eq(self, sp_box_str(lv_p->iv_body)); break; | |
| } | |
| _t592; | |
| } | |
| #line 146 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_7995__adapter_insert(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 170 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t593 = (&("\xff" "INSERT INTO articles (body, created_at, title, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t593); | |
| const char * _t594 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t594); | |
| const char * _t595 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t595); | |
| const char * _t596 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t596); | |
| const char * _t597 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t597); | |
| const char * _t598 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t598); | |
| const char * _t599 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t599); | |
| const char * _t600 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t600); | |
| const char * _t601 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t601); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t593, _t594, _t595, _t596, _t597, _t598, _t599, _t600, _t601}, 9)); | |
| #line 171 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_Db_cls_last_insert_rowid(); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_7995__adapter_update(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 175 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t602 = (&("\xff" "UPDATE articles SET ")[1]); | |
| SP_GC_ROOT(_t602); | |
| const char * _t603 = (&("\xff" "body = ")[1]); | |
| SP_GC_ROOT(_t603); | |
| const char * _t604 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t604); | |
| const char * _t605 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t605); | |
| const char * _t606 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t606); | |
| const char * _t607 = (&("\xff" ", title = ")[1]); | |
| SP_GC_ROOT(_t607); | |
| const char * _t608 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t608); | |
| const char * _t609 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t609); | |
| const char * _t610 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t610); | |
| const char * _t611 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t611); | |
| const char * _t612 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t612); | |
| const char * _t613 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t613); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t602, _t603, _t604, _t605, _t606, _t607, _t608, _t609, _t610, _t611, _t612, _t613}, 12)); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_7995__adapter_delete(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 179 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t614 = (&("\xff" "DELETE FROM articles")[1]); | |
| SP_GC_ROOT(_t614); | |
| const char * _t615 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t615); | |
| const char * _t616 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t616); | |
| const char * _t617 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t617); | |
| return sp_Db_cls_exec(sp_str_concat4(_t614, _t615, _t616, _t617)); | |
| return SP_INT_NIL; | |
| } | |
| static sp_RbVal sp_Article__implicit_7995__adapter_reload(sp_Article__implicit_7995 *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 203 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t618 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles WHERE id = ")[1]); | |
| SP_GC_ROOT(_t618); | |
| const char * _t619 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t619); | |
| const char * _t620 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t620); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t618, _t619, _t620)); | |
| #line 204 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| #line 205 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = sp_box_int(sp_Db_cls_column_int(sp_box_obj((void *)(lv_stmt), 0), 0LL)); | |
| #line 206 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 1LL)); | |
| #line 207 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 2LL)); | |
| #line 208 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 3LL)); | |
| #line 209 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 4LL)); | |
| #line 210 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| #line 212 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 213 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t621 = sp_box_obj(self, 83); | |
| SP_GC_RESTORE(); | |
| return _t621; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_StrArray * sp_Article__implicit_7995_validate(sp_Article__implicit_7995 *self) { | |
| mrb_int lv_len = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 224 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t622 = self->iv_title; | |
| mrb_bool _t623 = FALSE; | |
| if (_t622.tag == SP_TAG_STR) _t623 = (sp_str_length(_t622.v.s) == 0); | |
| if (_t622.tag == SP_TAG_OBJ) { | |
| if (_t622.cls_id == 55) _t623 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t622.v.p); | |
| if (_t622.cls_id == 56) _t623 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t622.v.p); | |
| if (_t622.cls_id == SP_BUILTIN_INT_ARRAY) _t623 = (sp_IntArray_length((sp_IntArray *)_t622.v.p) == 0); | |
| if (_t622.cls_id == SP_BUILTIN_FLT_ARRAY) _t623 = (sp_FloatArray_length((sp_FloatArray *)_t622.v.p) == 0); | |
| if (_t622.cls_id == SP_BUILTIN_STR_ARRAY) _t623 = (sp_StrArray_length((sp_StrArray *)_t622.v.p) == 0); | |
| if (_t622.cls_id == SP_BUILTIN_SYM_ARRAY) _t623 = (sp_IntArray_length((sp_IntArray *)_t622.v.p) == 0); | |
| if (_t622.cls_id == SP_BUILTIN_PTR_ARRAY) _t623 = (sp_PtrArray_length((sp_PtrArray *)_t622.v.p) == 0); | |
| if (_t622.cls_id == SP_BUILTIN_POLY_ARRAY) _t623 = (sp_PolyArray_length((sp_PolyArray *)_t622.v.p) == 0); | |
| if (_t622.cls_id == SP_BUILTIN_STR_INT_HASH) _t623 = (sp_StrIntHash_length((sp_StrIntHash *)_t622.v.p) == 0); | |
| if (_t622.cls_id == SP_BUILTIN_STR_STR_HASH) _t623 = (sp_StrStrHash_length((sp_StrStrHash *)_t622.v.p) == 0); | |
| if (_t622.cls_id == SP_BUILTIN_INT_STR_HASH) _t623 = (sp_IntStrHash_length((sp_IntStrHash *)_t622.v.p) == 0); | |
| if (_t622.cls_id == SP_BUILTIN_STR_POLY_HASH) _t623 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t622.v.p) == 0); | |
| if (_t622.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t623 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t622.v.p) == 0); | |
| if (_t622.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t623 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t622.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_title) || _t623)) { | |
| sp_StrArray * _t624 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t624); | |
| sp_StrArray_push(_t624, (&("\xff" "title can't be blank")[1])); | |
| } | |
| #line 225 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t625 = self->iv_body; | |
| mrb_bool _t626 = FALSE; | |
| if (_t625.tag == SP_TAG_STR) _t626 = (sp_str_length(_t625.v.s) == 0); | |
| if (_t625.tag == SP_TAG_OBJ) { | |
| if (_t625.cls_id == 55) _t626 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t625.v.p); | |
| if (_t625.cls_id == 56) _t626 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t625.v.p); | |
| if (_t625.cls_id == SP_BUILTIN_INT_ARRAY) _t626 = (sp_IntArray_length((sp_IntArray *)_t625.v.p) == 0); | |
| if (_t625.cls_id == SP_BUILTIN_FLT_ARRAY) _t626 = (sp_FloatArray_length((sp_FloatArray *)_t625.v.p) == 0); | |
| if (_t625.cls_id == SP_BUILTIN_STR_ARRAY) _t626 = (sp_StrArray_length((sp_StrArray *)_t625.v.p) == 0); | |
| if (_t625.cls_id == SP_BUILTIN_SYM_ARRAY) _t626 = (sp_IntArray_length((sp_IntArray *)_t625.v.p) == 0); | |
| if (_t625.cls_id == SP_BUILTIN_PTR_ARRAY) _t626 = (sp_PtrArray_length((sp_PtrArray *)_t625.v.p) == 0); | |
| if (_t625.cls_id == SP_BUILTIN_POLY_ARRAY) _t626 = (sp_PolyArray_length((sp_PolyArray *)_t625.v.p) == 0); | |
| if (_t625.cls_id == SP_BUILTIN_STR_INT_HASH) _t626 = (sp_StrIntHash_length((sp_StrIntHash *)_t625.v.p) == 0); | |
| if (_t625.cls_id == SP_BUILTIN_STR_STR_HASH) _t626 = (sp_StrStrHash_length((sp_StrStrHash *)_t625.v.p) == 0); | |
| if (_t625.cls_id == SP_BUILTIN_INT_STR_HASH) _t626 = (sp_IntStrHash_length((sp_IntStrHash *)_t625.v.p) == 0); | |
| if (_t625.cls_id == SP_BUILTIN_STR_POLY_HASH) _t626 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t625.v.p) == 0); | |
| if (_t625.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t626 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t625.v.p) == 0); | |
| if (_t625.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t626 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t625.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_body) || _t626)) { | |
| sp_StrArray * _t627 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t627); | |
| sp_StrArray_push(_t627, (&("\xff" "body can't be blank")[1])); | |
| } | |
| #line 226 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if ((!sp_poly_nil_p(self->iv_body))) { | |
| #line 227 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t628 = self->iv_body; | |
| mrb_int _t629 = 0; | |
| if (_t628.tag == SP_TAG_STR) _t629 = sp_str_length(_t628.v.s); | |
| if (_t628.tag == SP_TAG_OBJ) { | |
| if (_t628.cls_id == 55) _t629 = sp_ActionDispatch_Flash_length((sp_ActionDispatch_Flash *)_t628.v.p); | |
| if (_t628.cls_id == 56) _t629 = sp_ActionDispatch_Session_length((sp_ActionDispatch_Session *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_INT_ARRAY) _t629 = sp_IntArray_length((sp_IntArray *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_FLT_ARRAY) _t629 = sp_FloatArray_length((sp_FloatArray *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_STR_ARRAY) _t629 = sp_StrArray_length((sp_StrArray *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_SYM_ARRAY) _t629 = sp_IntArray_length((sp_IntArray *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_PTR_ARRAY) _t629 = sp_PtrArray_length((sp_PtrArray *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_POLY_ARRAY) _t629 = sp_PolyArray_length((sp_PolyArray *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_STR_INT_HASH) _t629 = sp_StrIntHash_length((sp_StrIntHash *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_STR_STR_HASH) _t629 = sp_StrStrHash_length((sp_StrStrHash *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_INT_STR_HASH) _t629 = sp_IntStrHash_length((sp_IntStrHash *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_STR_POLY_HASH) _t629 = sp_StrPolyHash_length((sp_StrPolyHash *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t629 = sp_SymPolyHash_length((sp_SymPolyHash *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t629 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_INT_ARRAY) _t629 = sp_IntArray_length((sp_IntArray *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_FLT_ARRAY) _t629 = sp_FloatArray_length((sp_FloatArray *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_STR_ARRAY) _t629 = sp_StrArray_length((sp_StrArray *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_SYM_ARRAY) _t629 = sp_IntArray_length((sp_IntArray *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_PTR_ARRAY) _t629 = sp_PtrArray_length((sp_PtrArray *)_t628.v.p); | |
| if (_t628.cls_id == SP_BUILTIN_POLY_ARRAY) _t629 = sp_PolyArray_length((sp_PolyArray *)_t628.v.p); | |
| } | |
| lv_len = _t629; | |
| #line 228 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if ((lv_len < 10LL)) { | |
| sp_StrArray * _t630 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t630); | |
| sp_StrArray_push(_t630, (&("\xff" "body is too short (minimum is 10)")[1])); | |
| return NULL; | |
| } else { | |
| return NULL; | |
| } | |
| } else { | |
| return NULL; | |
| } | |
| return NULL; | |
| } | |
| static sp_RbVal sp_Article__implicit_7995_comments(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_IntArray * lv_results = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(self); | |
| #line 233 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (self->iv_comments_loaded) { | |
| sp_RbVal _t631 = sp_box_int_array(self->iv_comments_cache); | |
| SP_GC_RESTORE(); | |
| return _t631; | |
| } | |
| #line 234 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t632 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t632); | |
| const char * _t633 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t633); | |
| const char * _t634 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t634); | |
| const char * _t635 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t635); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat4(_t632, _t633, _t634, _t635)); | |
| #line 235 "test/models/../../config/../app/controllers/../models/article.rb" | |
| lv_results = sp_IntArray_new(); | |
| #line 236 "test/models/../../config/../app/controllers/../models/article.rb" | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_25: ; | |
| #line 237 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(sp_box_obj((void *)(lv_stmt), 0))); | |
| } | |
| #line 239 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 240 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t636 = sp_box_int_array(lv_results); | |
| SP_GC_RESTORE(); | |
| return _t636; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995__preload_comments(sp_Article__implicit_7995 *self, mrb_int lv_list) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 244 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_cache = lv_list; | |
| #line 245 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_loaded = TRUE; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_7995_before_destroy(sp_Article__implicit_7995 *self) { | |
| mrb_int lv_c = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 249 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t637 = sp_Article__implicit_7995_comments(self); | |
| SP_GC_ROOT_RBVAL(_t637); | |
| if (_t637.tag == SP_TAG_OBJ) { | |
| mrb_int _t638_len = 0; | |
| if (_t637.cls_id == SP_BUILTIN_RANGE) _t638_len = ((sp_Range *)_t637.v.p)->last - ((sp_Range *)_t637.v.p)->first + 1; | |
| else if (_t637.cls_id == SP_BUILTIN_INT_ARRAY) _t638_len = sp_IntArray_length((sp_IntArray *)_t637.v.p); | |
| else if (_t637.cls_id == SP_BUILTIN_FLT_ARRAY) _t638_len = sp_FloatArray_length((sp_FloatArray *)_t637.v.p); | |
| else if (_t637.cls_id == SP_BUILTIN_STR_ARRAY) _t638_len = sp_StrArray_length((sp_StrArray *)_t637.v.p); | |
| else if (_t637.cls_id == SP_BUILTIN_SYM_ARRAY) _t638_len = sp_IntArray_length((sp_IntArray *)_t637.v.p); | |
| else if (_t637.cls_id == SP_BUILTIN_PTR_ARRAY) _t638_len = sp_PtrArray_length((sp_PtrArray *)_t637.v.p); | |
| else if (_t637.cls_id == SP_BUILTIN_POLY_ARRAY) _t638_len = sp_PolyArray_length((sp_PolyArray *)_t637.v.p); | |
| else if (_t637.cls_id == SP_BUILTIN_STR_INT_HASH) _t638_len = ((sp_StrIntHash *)_t637.v.p)->len; | |
| else if (_t637.cls_id == SP_BUILTIN_STR_STR_HASH) _t638_len = ((sp_StrStrHash *)_t637.v.p)->len; | |
| else if (_t637.cls_id == SP_BUILTIN_INT_STR_HASH) _t638_len = ((sp_IntStrHash *)_t637.v.p)->len; | |
| else if (_t637.cls_id == SP_BUILTIN_SYM_INT_HASH) _t638_len = ((sp_SymIntHash *)_t637.v.p)->len; | |
| else if (_t637.cls_id == SP_BUILTIN_SYM_STR_HASH) _t638_len = ((sp_SymStrHash *)_t637.v.p)->len; | |
| else if (_t637.cls_id == SP_BUILTIN_STR_POLY_HASH) _t638_len = ((sp_StrPolyHash *)_t637.v.p)->len; | |
| else if (_t637.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t638_len = ((sp_SymPolyHash *)_t637.v.p)->len; | |
| else if (_t637.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t638_len = ((sp_PolyPolyHash *)_t637.v.p)->len; | |
| for (mrb_int _t638 = 0; _t638 < _t638_len; _t638++) { | |
| sp_RbVal _t639 = sp_box_nil(); | |
| if (_t637.cls_id == SP_BUILTIN_RANGE) _t639 = sp_box_int(((sp_Range *)_t637.v.p)->first + _t638); | |
| else if (_t637.cls_id == SP_BUILTIN_INT_ARRAY) _t639 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t637.v.p, _t638)); | |
| else if (_t637.cls_id == SP_BUILTIN_FLT_ARRAY) _t639 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t637.v.p, _t638)); | |
| else if (_t637.cls_id == SP_BUILTIN_STR_ARRAY) _t639 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t637.v.p, _t638)); | |
| else if (_t637.cls_id == SP_BUILTIN_SYM_ARRAY) _t639 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t637.v.p, _t638)); | |
| else if (_t637.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t637.v.p, _t638); _t639 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t637.cls_id == SP_BUILTIN_POLY_ARRAY) _t639 = sp_PolyArray_get((sp_PolyArray *)_t637.v.p, _t638); | |
| else if (_t637.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t637.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t638])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t638]))); _t639 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t637.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t637.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t638])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t638]))); _t639 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t637.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t637.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t638])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t638]))); _t639 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t637.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t637.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t638])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t638]))); _t639 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t637.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t637.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t638])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t638]))); _t639 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t637.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t637.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t638])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t638])); _t639 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t637.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t637.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t638])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t638])); _t639 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t637.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t637.v.p; mrb_int _pk = _sh->order[_t638]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t639 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_c = _t639; | |
| sp_redo_26: ; | |
| sp_RbVal _t640 = lv_c; | |
| sp_RbVal _t641 = sp_box_nil(); | |
| if (_t640.tag == SP_TAG_OBJ) { | |
| if (_t640.cls_id == 52) _t641 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t640.v.p), 52); | |
| if (_t640.cls_id == 65) _t641 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t640.v.p), 52); | |
| if (_t640.cls_id == 67) _t641 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t640.v.p), 52); | |
| if (_t640.cls_id == 71) _t641 = ((void)(sp_ArticlesController_destroy((sp_ArticlesController *)_t640.v.p)), sp_box_nil()); | |
| if (_t640.cls_id == 73) _t641 = ((void)(sp_CommentsController_destroy((sp_CommentsController *)_t640.v.p)), sp_box_nil()); | |
| if (_t640.cls_id == 78) _t641 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t640.v.p), 52); | |
| if (_t640.cls_id == 79) _t641 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t640.v.p), 52); | |
| if (_t640.cls_id == 80) _t641 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t640.v.p), 52); | |
| if (_t640.cls_id == 81) _t641 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t640.v.p), 52); | |
| if (_t640.cls_id == 82) _t641 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t640.v.p), 52); | |
| if (_t640.cls_id == 83) _t641 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t640.v.p), 52); | |
| } | |
| _t641; | |
| } | |
| } | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_Article__implicit_7995_dom_prefix(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 253 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return (&("\xff" "article")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_after_create_commit(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 257 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Broadcasts_cls_prepend((&("\xff" "articles")[1]), (&("\xff" "articles")[1]), sp_Views_Articles_cls_article(sp_box_obj(self, 83), 0, 0)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_after_update_commit(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 261 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t642 = sp_sprintf("article_%s", sp_poly_to_s(self->iv_id)); | |
| SP_GC_ROOT(_t642); | |
| sp_String * _t643 = sp_Views_Articles_cls_article(sp_box_obj(self, 83), 0, 0); | |
| SP_GC_ROOT(_t643); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t642, _t643); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_7995_after_destroy_commit(sp_Article__implicit_7995 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 265 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_Broadcasts_cls_remove((&("\xff" "articles")[1]), sp_sprintf("article_%s", sp_poly_to_s(self->iv_id))); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Article__implicit_7995_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| #line 52 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_IntArray *_t644 = sp_IntArray_new(); | |
| sp_IntArray_push(_t644, SPS_id); | |
| sp_IntArray_push(_t644, SPS_body); | |
| sp_IntArray_push(_t644, SPS_created_at); | |
| sp_IntArray_push(_t644, SPS_title); | |
| sp_IntArray_push(_t644, SPS_updated_at); | |
| return _t644; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Article__implicit_9355) | |
| static inline sp_Article__implicit_9355 *sp_Article__implicit_9355_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article__implicit_9355 *self = SP_POOL_NEW(Article__implicit_9355, sp_Article__implicit_9355_gc_scan); | |
| self->cls_id = 82LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_id = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t645 = 0; | |
| switch (self->cls_id) { | |
| case 82LL: _t645 = sp_Article__implicit_9355_body_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t645 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t645; | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t646 = 0; | |
| switch (self->cls_id) { | |
| case 82LL: _t646 = sp_Article__implicit_9355_created_at_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t646 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t646; | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t647 = 0; | |
| switch (self->cls_id) { | |
| case 82LL: _t647 = sp_Article__implicit_9355_title_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t647 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t647; | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t648 = 0; | |
| switch (self->cls_id) { | |
| case 82LL: _t648 = sp_Article__implicit_9355_updated_at_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t648 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t648; | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article__implicit_9355_initialize(sp_Article__implicit_9355 *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t649 = 0; | |
| switch (self->cls_id) { | |
| case 82LL: _t649 = sp_Article__implicit_9355_body_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t649 = sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t649; | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t650 = 0; | |
| switch (self->cls_id) { | |
| case 82LL: _t650 = sp_Article__implicit_9355_created_at_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t650 = sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t650; | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t651 = 0; | |
| switch (self->cls_id) { | |
| case 82LL: _t651 = sp_Article__implicit_9355_title_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t651 = sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t651; | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t652 = 0; | |
| switch (self->cls_id) { | |
| case 82LL: _t652 = sp_Article__implicit_9355_updated_at_eq((sp_Article__implicit_9355 *)self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| default: _t652 = sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); break; | |
| } | |
| _t652; | |
| #line 97 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| #line 98 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355_id(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 8 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t653 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t653; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_id_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 12 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355_body(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 16 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t654 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t654; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_body_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 20 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355_created_at(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 24 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t655 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t655; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_created_at_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 28 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355_title(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 32 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t656 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t656; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_title_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 36 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355_updated_at(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 40 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t657 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t657; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_updated_at_eq(sp_Article__implicit_9355 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 44 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Article__implicit_9355_assign_from_row(sp_Article__implicit_9355 *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355_attributes(sp_Article__implicit_9355 *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355__aref(sp_Article__implicit_9355 *self, sp_RbVal lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_name); | |
| SP_GC_ROOT(self); | |
| #line 106 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t658 = lv_name; | |
| if ((_t658.tag == SP_TAG_SYM && _t658.v.i == SPS_id)) { | |
| #line 108 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t659 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t659; | |
| } else if ((_t658.tag == SP_TAG_SYM && _t658.v.i == SPS_body)) { | |
| #line 110 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t660 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t660; | |
| } else if ((_t658.tag == SP_TAG_SYM && _t658.v.i == SPS_created_at)) { | |
| #line 112 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t661 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t661; | |
| } else if ((_t658.tag == SP_TAG_SYM && _t658.v.i == SPS_title)) { | |
| #line 114 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t662 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t662; | |
| } else if ((_t658.tag == SP_TAG_SYM && _t658.v.i == SPS_updated_at)) { | |
| #line 116 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t663 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t663; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355__aset(sp_Article__implicit_9355 *self, sp_sym lv_name, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 121 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t664 = lv_name; | |
| if (_t664 == SPS_id) { | |
| #line 123 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t666 = lv_value; | |
| mrb_int _t665 = (_t666.tag == SP_TAG_INT) ? _t666.v.i : 0; | |
| self->iv_id = sp_box_int(_t665); | |
| return SP_INT_NIL; | |
| } else if (_t664 == SPS_body) { | |
| #line 125 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t664 == SPS_created_at) { | |
| #line 127 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t664 == SPS_title) { | |
| #line 129 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t664 == SPS_updated_at) { | |
| #line 131 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_Article__implicit_9355_update(sp_Article__implicit_9355 *self, mrb_int lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 136 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t667 = ((sp_ArticleRow *)lv_p)->iv_title; | |
| SP_GC_ROOT(_t667); | |
| if ((_t667 == NULL)) { | |
| #line 137 "test/models/../../config/../app/controllers/../models/article.rb" | |
| } else { | |
| #line 139 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t668 = 0; | |
| switch (self->cls_id) { | |
| case 82LL: _t668 = sp_Article__implicit_9355_title_eq((sp_Article__implicit_9355 *)self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| default: _t668 = sp_Article__implicit_9372_title_eq(self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); break; | |
| } | |
| _t668; | |
| } | |
| #line 141 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (sp_poly_nil_p(((sp_ActionController_Base *)lv_p)->iv_body)) { | |
| #line 142 "test/models/../../config/../app/controllers/../models/article.rb" | |
| } else { | |
| #line 144 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t669 = 0; | |
| switch (self->cls_id) { | |
| case 82LL: _t669 = sp_Article__implicit_9355_body_eq((sp_Article__implicit_9355 *)self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| default: _t669 = sp_Article__implicit_9372_body_eq(self, ((sp_ActionController_Base *)lv_p)->iv_body); break; | |
| } | |
| _t669; | |
| } | |
| #line 146 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_9355__adapter_insert(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 170 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t670 = (&("\xff" "INSERT INTO articles (body, created_at, title, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t670); | |
| const char * _t671 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t671); | |
| const char * _t672 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t672); | |
| const char * _t673 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t673); | |
| const char * _t674 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t674); | |
| const char * _t675 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t675); | |
| const char * _t676 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t676); | |
| const char * _t677 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t677); | |
| const char * _t678 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t678); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t670, _t671, _t672, _t673, _t674, _t675, _t676, _t677, _t678}, 9)); | |
| #line 171 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_Db_cls_last_insert_rowid(); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_9355__adapter_update(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 175 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t679 = (&("\xff" "UPDATE articles SET ")[1]); | |
| SP_GC_ROOT(_t679); | |
| const char * _t680 = (&("\xff" "body = ")[1]); | |
| SP_GC_ROOT(_t680); | |
| const char * _t681 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t681); | |
| const char * _t682 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t682); | |
| const char * _t683 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t683); | |
| const char * _t684 = (&("\xff" ", title = ")[1]); | |
| SP_GC_ROOT(_t684); | |
| const char * _t685 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t685); | |
| const char * _t686 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t686); | |
| const char * _t687 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t687); | |
| const char * _t688 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t688); | |
| const char * _t689 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t689); | |
| const char * _t690 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t690); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t679, _t680, _t681, _t682, _t683, _t684, _t685, _t686, _t687, _t688, _t689, _t690}, 12)); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_9355__adapter_delete(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 179 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t691 = (&("\xff" "DELETE FROM articles")[1]); | |
| SP_GC_ROOT(_t691); | |
| const char * _t692 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t692); | |
| const char * _t693 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t693); | |
| const char * _t694 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t694); | |
| return sp_Db_cls_exec(sp_str_concat4(_t691, _t692, _t693, _t694)); | |
| return SP_INT_NIL; | |
| } | |
| static sp_RbVal sp_Article__implicit_9355__adapter_reload(sp_Article__implicit_9355 *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 203 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t695 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles WHERE id = ")[1]); | |
| SP_GC_ROOT(_t695); | |
| const char * _t696 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t696); | |
| const char * _t697 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t697); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t695, _t696, _t697)); | |
| #line 204 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| #line 205 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = sp_box_int(sp_Db_cls_column_int(sp_box_obj((void *)(lv_stmt), 0), 0LL)); | |
| #line 206 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 1LL)); | |
| #line 207 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 2LL)); | |
| #line 208 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 3LL)); | |
| #line 209 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 4LL)); | |
| #line 210 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| #line 212 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 213 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t698 = sp_box_obj(self, 83); | |
| SP_GC_RESTORE(); | |
| return _t698; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_StrArray * sp_Article__implicit_9355_validate(sp_Article__implicit_9355 *self) { | |
| mrb_int lv_len = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 224 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t699 = self->iv_title; | |
| mrb_bool _t700 = FALSE; | |
| if (_t699.tag == SP_TAG_STR) _t700 = (sp_str_length(_t699.v.s) == 0); | |
| if (_t699.tag == SP_TAG_OBJ) { | |
| if (_t699.cls_id == 55) _t700 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t699.v.p); | |
| if (_t699.cls_id == 56) _t700 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t699.v.p); | |
| if (_t699.cls_id == SP_BUILTIN_INT_ARRAY) _t700 = (sp_IntArray_length((sp_IntArray *)_t699.v.p) == 0); | |
| if (_t699.cls_id == SP_BUILTIN_FLT_ARRAY) _t700 = (sp_FloatArray_length((sp_FloatArray *)_t699.v.p) == 0); | |
| if (_t699.cls_id == SP_BUILTIN_STR_ARRAY) _t700 = (sp_StrArray_length((sp_StrArray *)_t699.v.p) == 0); | |
| if (_t699.cls_id == SP_BUILTIN_SYM_ARRAY) _t700 = (sp_IntArray_length((sp_IntArray *)_t699.v.p) == 0); | |
| if (_t699.cls_id == SP_BUILTIN_PTR_ARRAY) _t700 = (sp_PtrArray_length((sp_PtrArray *)_t699.v.p) == 0); | |
| if (_t699.cls_id == SP_BUILTIN_POLY_ARRAY) _t700 = (sp_PolyArray_length((sp_PolyArray *)_t699.v.p) == 0); | |
| if (_t699.cls_id == SP_BUILTIN_STR_INT_HASH) _t700 = (sp_StrIntHash_length((sp_StrIntHash *)_t699.v.p) == 0); | |
| if (_t699.cls_id == SP_BUILTIN_STR_STR_HASH) _t700 = (sp_StrStrHash_length((sp_StrStrHash *)_t699.v.p) == 0); | |
| if (_t699.cls_id == SP_BUILTIN_INT_STR_HASH) _t700 = (sp_IntStrHash_length((sp_IntStrHash *)_t699.v.p) == 0); | |
| if (_t699.cls_id == SP_BUILTIN_STR_POLY_HASH) _t700 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t699.v.p) == 0); | |
| if (_t699.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t700 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t699.v.p) == 0); | |
| if (_t699.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t700 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t699.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_title) || _t700)) { | |
| sp_StrArray * _t701 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t701); | |
| sp_StrArray_push(_t701, (&("\xff" "title can't be blank")[1])); | |
| } | |
| #line 225 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t702 = self->iv_body; | |
| mrb_bool _t703 = FALSE; | |
| if (_t702.tag == SP_TAG_STR) _t703 = (sp_str_length(_t702.v.s) == 0); | |
| if (_t702.tag == SP_TAG_OBJ) { | |
| if (_t702.cls_id == 55) _t703 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t702.v.p); | |
| if (_t702.cls_id == 56) _t703 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t702.v.p); | |
| if (_t702.cls_id == SP_BUILTIN_INT_ARRAY) _t703 = (sp_IntArray_length((sp_IntArray *)_t702.v.p) == 0); | |
| if (_t702.cls_id == SP_BUILTIN_FLT_ARRAY) _t703 = (sp_FloatArray_length((sp_FloatArray *)_t702.v.p) == 0); | |
| if (_t702.cls_id == SP_BUILTIN_STR_ARRAY) _t703 = (sp_StrArray_length((sp_StrArray *)_t702.v.p) == 0); | |
| if (_t702.cls_id == SP_BUILTIN_SYM_ARRAY) _t703 = (sp_IntArray_length((sp_IntArray *)_t702.v.p) == 0); | |
| if (_t702.cls_id == SP_BUILTIN_PTR_ARRAY) _t703 = (sp_PtrArray_length((sp_PtrArray *)_t702.v.p) == 0); | |
| if (_t702.cls_id == SP_BUILTIN_POLY_ARRAY) _t703 = (sp_PolyArray_length((sp_PolyArray *)_t702.v.p) == 0); | |
| if (_t702.cls_id == SP_BUILTIN_STR_INT_HASH) _t703 = (sp_StrIntHash_length((sp_StrIntHash *)_t702.v.p) == 0); | |
| if (_t702.cls_id == SP_BUILTIN_STR_STR_HASH) _t703 = (sp_StrStrHash_length((sp_StrStrHash *)_t702.v.p) == 0); | |
| if (_t702.cls_id == SP_BUILTIN_INT_STR_HASH) _t703 = (sp_IntStrHash_length((sp_IntStrHash *)_t702.v.p) == 0); | |
| if (_t702.cls_id == SP_BUILTIN_STR_POLY_HASH) _t703 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t702.v.p) == 0); | |
| if (_t702.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t703 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t702.v.p) == 0); | |
| if (_t702.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t703 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t702.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_body) || _t703)) { | |
| sp_StrArray * _t704 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t704); | |
| sp_StrArray_push(_t704, (&("\xff" "body can't be blank")[1])); | |
| } | |
| #line 226 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if ((!sp_poly_nil_p(self->iv_body))) { | |
| #line 227 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t705 = self->iv_body; | |
| mrb_int _t706 = 0; | |
| if (_t705.tag == SP_TAG_STR) _t706 = sp_str_length(_t705.v.s); | |
| if (_t705.tag == SP_TAG_OBJ) { | |
| if (_t705.cls_id == 55) _t706 = sp_ActionDispatch_Flash_length((sp_ActionDispatch_Flash *)_t705.v.p); | |
| if (_t705.cls_id == 56) _t706 = sp_ActionDispatch_Session_length((sp_ActionDispatch_Session *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_INT_ARRAY) _t706 = sp_IntArray_length((sp_IntArray *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_FLT_ARRAY) _t706 = sp_FloatArray_length((sp_FloatArray *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_STR_ARRAY) _t706 = sp_StrArray_length((sp_StrArray *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_SYM_ARRAY) _t706 = sp_IntArray_length((sp_IntArray *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_PTR_ARRAY) _t706 = sp_PtrArray_length((sp_PtrArray *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_POLY_ARRAY) _t706 = sp_PolyArray_length((sp_PolyArray *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_STR_INT_HASH) _t706 = sp_StrIntHash_length((sp_StrIntHash *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_STR_STR_HASH) _t706 = sp_StrStrHash_length((sp_StrStrHash *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_INT_STR_HASH) _t706 = sp_IntStrHash_length((sp_IntStrHash *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_STR_POLY_HASH) _t706 = sp_StrPolyHash_length((sp_StrPolyHash *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t706 = sp_SymPolyHash_length((sp_SymPolyHash *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t706 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_INT_ARRAY) _t706 = sp_IntArray_length((sp_IntArray *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_FLT_ARRAY) _t706 = sp_FloatArray_length((sp_FloatArray *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_STR_ARRAY) _t706 = sp_StrArray_length((sp_StrArray *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_SYM_ARRAY) _t706 = sp_IntArray_length((sp_IntArray *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_PTR_ARRAY) _t706 = sp_PtrArray_length((sp_PtrArray *)_t705.v.p); | |
| if (_t705.cls_id == SP_BUILTIN_POLY_ARRAY) _t706 = sp_PolyArray_length((sp_PolyArray *)_t705.v.p); | |
| } | |
| lv_len = _t706; | |
| #line 228 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if ((lv_len < 10LL)) { | |
| sp_StrArray * _t707 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t707); | |
| sp_StrArray_push(_t707, (&("\xff" "body is too short (minimum is 10)")[1])); | |
| return NULL; | |
| } else { | |
| return NULL; | |
| } | |
| } else { | |
| return NULL; | |
| } | |
| return NULL; | |
| } | |
| static sp_RbVal sp_Article__implicit_9355_comments(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_IntArray * lv_results = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(self); | |
| #line 233 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (self->iv_comments_loaded) { | |
| sp_RbVal _t708 = sp_box_int_array(self->iv_comments_cache); | |
| SP_GC_RESTORE(); | |
| return _t708; | |
| } | |
| #line 234 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t709 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t709); | |
| const char * _t710 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t710); | |
| const char * _t711 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t711); | |
| const char * _t712 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t712); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat4(_t709, _t710, _t711, _t712)); | |
| #line 235 "test/models/../../config/../app/controllers/../models/article.rb" | |
| lv_results = sp_IntArray_new(); | |
| #line 236 "test/models/../../config/../app/controllers/../models/article.rb" | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_27: ; | |
| #line 237 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(sp_box_obj((void *)(lv_stmt), 0))); | |
| } | |
| #line 239 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 240 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t713 = sp_box_int_array(lv_results); | |
| SP_GC_RESTORE(); | |
| return _t713; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355__preload_comments(sp_Article__implicit_9355 *self, mrb_int lv_list) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 244 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_cache = lv_list; | |
| #line 245 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_loaded = TRUE; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9355_before_destroy(sp_Article__implicit_9355 *self) { | |
| mrb_int lv_c = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 249 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t714 = sp_Article__implicit_9355_comments(self); | |
| SP_GC_ROOT_RBVAL(_t714); | |
| if (_t714.tag == SP_TAG_OBJ) { | |
| mrb_int _t715_len = 0; | |
| if (_t714.cls_id == SP_BUILTIN_RANGE) _t715_len = ((sp_Range *)_t714.v.p)->last - ((sp_Range *)_t714.v.p)->first + 1; | |
| else if (_t714.cls_id == SP_BUILTIN_INT_ARRAY) _t715_len = sp_IntArray_length((sp_IntArray *)_t714.v.p); | |
| else if (_t714.cls_id == SP_BUILTIN_FLT_ARRAY) _t715_len = sp_FloatArray_length((sp_FloatArray *)_t714.v.p); | |
| else if (_t714.cls_id == SP_BUILTIN_STR_ARRAY) _t715_len = sp_StrArray_length((sp_StrArray *)_t714.v.p); | |
| else if (_t714.cls_id == SP_BUILTIN_SYM_ARRAY) _t715_len = sp_IntArray_length((sp_IntArray *)_t714.v.p); | |
| else if (_t714.cls_id == SP_BUILTIN_PTR_ARRAY) _t715_len = sp_PtrArray_length((sp_PtrArray *)_t714.v.p); | |
| else if (_t714.cls_id == SP_BUILTIN_POLY_ARRAY) _t715_len = sp_PolyArray_length((sp_PolyArray *)_t714.v.p); | |
| else if (_t714.cls_id == SP_BUILTIN_STR_INT_HASH) _t715_len = ((sp_StrIntHash *)_t714.v.p)->len; | |
| else if (_t714.cls_id == SP_BUILTIN_STR_STR_HASH) _t715_len = ((sp_StrStrHash *)_t714.v.p)->len; | |
| else if (_t714.cls_id == SP_BUILTIN_INT_STR_HASH) _t715_len = ((sp_IntStrHash *)_t714.v.p)->len; | |
| else if (_t714.cls_id == SP_BUILTIN_SYM_INT_HASH) _t715_len = ((sp_SymIntHash *)_t714.v.p)->len; | |
| else if (_t714.cls_id == SP_BUILTIN_SYM_STR_HASH) _t715_len = ((sp_SymStrHash *)_t714.v.p)->len; | |
| else if (_t714.cls_id == SP_BUILTIN_STR_POLY_HASH) _t715_len = ((sp_StrPolyHash *)_t714.v.p)->len; | |
| else if (_t714.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t715_len = ((sp_SymPolyHash *)_t714.v.p)->len; | |
| else if (_t714.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t715_len = ((sp_PolyPolyHash *)_t714.v.p)->len; | |
| for (mrb_int _t715 = 0; _t715 < _t715_len; _t715++) { | |
| sp_RbVal _t716 = sp_box_nil(); | |
| if (_t714.cls_id == SP_BUILTIN_RANGE) _t716 = sp_box_int(((sp_Range *)_t714.v.p)->first + _t715); | |
| else if (_t714.cls_id == SP_BUILTIN_INT_ARRAY) _t716 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t714.v.p, _t715)); | |
| else if (_t714.cls_id == SP_BUILTIN_FLT_ARRAY) _t716 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t714.v.p, _t715)); | |
| else if (_t714.cls_id == SP_BUILTIN_STR_ARRAY) _t716 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t714.v.p, _t715)); | |
| else if (_t714.cls_id == SP_BUILTIN_SYM_ARRAY) _t716 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t714.v.p, _t715)); | |
| else if (_t714.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t714.v.p, _t715); _t716 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t714.cls_id == SP_BUILTIN_POLY_ARRAY) _t716 = sp_PolyArray_get((sp_PolyArray *)_t714.v.p, _t715); | |
| else if (_t714.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t714.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t715])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t715]))); _t716 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t714.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t714.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t715])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t715]))); _t716 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t714.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t714.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t715])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t715]))); _t716 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t714.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t714.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t715])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t715]))); _t716 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t714.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t714.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t715])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t715]))); _t716 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t714.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t714.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t715])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t715])); _t716 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t714.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t714.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t715])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t715])); _t716 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t714.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t714.v.p; mrb_int _pk = _sh->order[_t715]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t716 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_c = _t716; | |
| sp_redo_28: ; | |
| sp_RbVal _t717 = lv_c; | |
| sp_RbVal _t718 = sp_box_nil(); | |
| if (_t717.tag == SP_TAG_OBJ) { | |
| if (_t717.cls_id == 52) _t718 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t717.v.p), 52); | |
| if (_t717.cls_id == 65) _t718 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t717.v.p), 52); | |
| if (_t717.cls_id == 67) _t718 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t717.v.p), 52); | |
| if (_t717.cls_id == 71) _t718 = ((void)(sp_ArticlesController_destroy((sp_ArticlesController *)_t717.v.p)), sp_box_nil()); | |
| if (_t717.cls_id == 73) _t718 = ((void)(sp_CommentsController_destroy((sp_CommentsController *)_t717.v.p)), sp_box_nil()); | |
| if (_t717.cls_id == 78) _t718 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t717.v.p), 52); | |
| if (_t717.cls_id == 79) _t718 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t717.v.p), 52); | |
| if (_t717.cls_id == 80) _t718 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t717.v.p), 52); | |
| if (_t717.cls_id == 81) _t718 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t717.v.p), 52); | |
| if (_t717.cls_id == 82) _t718 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t717.v.p), 52); | |
| if (_t717.cls_id == 83) _t718 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t717.v.p), 52); | |
| } | |
| _t718; | |
| } | |
| } | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_Article__implicit_9355_dom_prefix(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 253 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return (&("\xff" "article")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_after_create_commit(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 257 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Broadcasts_cls_prepend((&("\xff" "articles")[1]), (&("\xff" "articles")[1]), sp_Views_Articles_cls_article(sp_box_obj(self, 83), 0, 0)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_after_update_commit(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 261 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t719 = sp_sprintf("article_%s", sp_poly_to_s(self->iv_id)); | |
| SP_GC_ROOT(_t719); | |
| sp_String * _t720 = sp_Views_Articles_cls_article(sp_box_obj(self, 83), 0, 0); | |
| SP_GC_ROOT(_t720); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t719, _t720); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_9355_after_destroy_commit(sp_Article__implicit_9355 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 265 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_Broadcasts_cls_remove((&("\xff" "articles")[1]), sp_sprintf("article_%s", sp_poly_to_s(self->iv_id))); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Article__implicit_9355_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| #line 52 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_IntArray *_t721 = sp_IntArray_new(); | |
| sp_IntArray_push(_t721, SPS_id); | |
| sp_IntArray_push(_t721, SPS_body); | |
| sp_IntArray_push(_t721, SPS_created_at); | |
| sp_IntArray_push(_t721, SPS_title); | |
| sp_IntArray_push(_t721, SPS_updated_at); | |
| return _t721; | |
| return NULL; | |
| } | |
| SP_POOL_DEFINE(Article__implicit_9372) | |
| static inline sp_Article__implicit_9372 *sp_Article__implicit_9372_new(sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| sp_Article__implicit_9372 *self = SP_POOL_NEW(Article__implicit_9372, sp_Article__implicit_9372_gc_scan); | |
| self->cls_id = 83LL; | |
| SP_GC_ROOT(self); | |
| self->iv_errors = NULL; | |
| self->iv_id = sp_box_nil(); | |
| self->iv_body = sp_box_nil(); | |
| self->iv_created_at = sp_box_nil(); | |
| self->iv_title = sp_box_nil(); | |
| self->iv_updated_at = sp_box_nil(); | |
| self->iv_comments_cache = NULL; | |
| SP_GC_ROOT(lv_attrs); | |
| sp_ActiveRecord_Base_initialize((sp_ActiveRecord_Base *)self, NULL); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| self->iv_comments_loaded = FALSE; | |
| SP_GC_RESTORE(); | |
| return self; | |
| } | |
| static inline void sp_Article__implicit_9372_initialize(sp_Article__implicit_9372 *self, sp_StrIntHash * lv_attrs) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_attrs); | |
| #line 92 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_id)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_id))) : sp_box_int(0LL)); | |
| #line 93 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_9372_body_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_body)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_body))) : sp_box_str((&("\xff" "")[1])))); | |
| #line 94 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_9372_created_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_created_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_created_at))) : sp_box_str((&("\xff" "")[1])))); | |
| #line 95 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_9372_title_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_title)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_title))) : sp_box_str((&("\xff" "")[1])))); | |
| #line 96 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_9372_updated_at_eq(self, (sp_StrIntHash_has_key(lv_attrs, sp_sym_to_s(SPS_updated_at)) ? sp_box_int(sp_StrIntHash_get(lv_attrs, sp_sym_to_s(SPS_updated_at))) : sp_box_str((&("\xff" "")[1])))); | |
| #line 97 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_cache = sp_IntArray_new(); | |
| #line 98 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_loaded = FALSE; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372_id(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 8 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t722 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t722; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_id_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 12 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372_body(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 16 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t723 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t723; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_body_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 20 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372_created_at(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 24 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t724 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t724; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_created_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 28 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372_title(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 32 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t725 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t725; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_title_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 36 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372_updated_at(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 40 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t726 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t726; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_updated_at_eq(sp_Article__implicit_9372 *self, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 44 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = lv_value; | |
| return 0; | |
| return 0; | |
| } | |
| static mrb_int sp_Article__implicit_9372_assign_from_row(sp_Article__implicit_9372 *self, sp_StrPolyHash * lv_row) { | |
| (void)lv_row; | |
| return SP_INT_NIL; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372_attributes(sp_Article__implicit_9372 *self) { | |
| return sp_box_nil(); | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372__aref(sp_Article__implicit_9372 *self, sp_RbVal lv_name) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_name); | |
| SP_GC_ROOT(self); | |
| #line 106 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t727 = lv_name; | |
| if ((_t727.tag == SP_TAG_SYM && _t727.v.i == SPS_id)) { | |
| #line 108 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t728 = self->iv_id; | |
| SP_GC_RESTORE(); | |
| return _t728; | |
| } else if ((_t727.tag == SP_TAG_SYM && _t727.v.i == SPS_body)) { | |
| #line 110 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t729 = self->iv_body; | |
| SP_GC_RESTORE(); | |
| return _t729; | |
| } else if ((_t727.tag == SP_TAG_SYM && _t727.v.i == SPS_created_at)) { | |
| #line 112 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t730 = self->iv_created_at; | |
| SP_GC_RESTORE(); | |
| return _t730; | |
| } else if ((_t727.tag == SP_TAG_SYM && _t727.v.i == SPS_title)) { | |
| #line 114 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t731 = self->iv_title; | |
| SP_GC_RESTORE(); | |
| return _t731; | |
| } else if ((_t727.tag == SP_TAG_SYM && _t727.v.i == SPS_updated_at)) { | |
| #line 116 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t732 = self->iv_updated_at; | |
| SP_GC_RESTORE(); | |
| return _t732; | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372__aset(sp_Article__implicit_9372 *self, sp_sym lv_name, sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| SP_GC_ROOT(self); | |
| #line 121 "test/models/../../config/../app/controllers/../models/article.rb" | |
| mrb_int _t733 = lv_name; | |
| if (_t733 == SPS_id) { | |
| #line 123 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t735 = lv_value; | |
| mrb_int _t734 = (_t735.tag == SP_TAG_INT) ? _t735.v.i : 0; | |
| self->iv_id = sp_box_int(_t734); | |
| return SP_INT_NIL; | |
| } else if (_t733 == SPS_body) { | |
| #line 125 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t733 == SPS_created_at) { | |
| #line 127 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t733 == SPS_title) { | |
| #line 129 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } else if (_t733 == SPS_updated_at) { | |
| #line 131 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = sp_box_str(sp_poly_to_s(lv_value)); | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_bool sp_Article__implicit_9372_update(sp_Article__implicit_9372 *self, mrb_int lv_p) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 136 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t736 = ((sp_ArticleRow *)lv_p)->iv_title; | |
| SP_GC_ROOT(_t736); | |
| if ((_t736 == NULL)) { | |
| #line 137 "test/models/../../config/../app/controllers/../models/article.rb" | |
| } else { | |
| #line 139 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_9372_title_eq(self, sp_box_str(((sp_ArticleRow *)lv_p)->iv_title)); | |
| } | |
| #line 141 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (sp_poly_nil_p(((sp_ActionController_Base *)lv_p)->iv_body)) { | |
| #line 142 "test/models/../../config/../app/controllers/../models/article.rb" | |
| } else { | |
| #line 144 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Article__implicit_9372_body_eq(self, ((sp_ActionController_Base *)lv_p)->iv_body); | |
| } | |
| #line 146 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)self); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Article__implicit_9372__adapter_insert(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 170 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t737 = (&("\xff" "INSERT INTO articles (body, created_at, title, updated_at) VALUES (")[1]); | |
| SP_GC_ROOT(_t737); | |
| const char * _t738 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t738); | |
| const char * _t739 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t739); | |
| const char * _t740 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t740); | |
| const char * _t741 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t741); | |
| const char * _t742 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t742); | |
| const char * _t743 = (&("\xff" ", ")[1]); | |
| SP_GC_ROOT(_t743); | |
| const char * _t744 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t744); | |
| const char * _t745 = (&("\xff" ")")[1]); | |
| SP_GC_ROOT(_t745); | |
| sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t737, _t738, _t739, _t740, _t741, _t742, _t743, _t744, _t745}, 9)); | |
| #line 171 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_Db_cls_last_insert_rowid(); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_9372__adapter_update(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 175 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t746 = (&("\xff" "UPDATE articles SET ")[1]); | |
| SP_GC_ROOT(_t746); | |
| const char * _t747 = (&("\xff" "body = ")[1]); | |
| SP_GC_ROOT(_t747); | |
| const char * _t748 = sp_Db_cls_escape_string(self->iv_body); | |
| SP_GC_ROOT(_t748); | |
| const char * _t749 = (&("\xff" ", created_at = ")[1]); | |
| SP_GC_ROOT(_t749); | |
| const char * _t750 = sp_Db_cls_escape_string(self->iv_created_at); | |
| SP_GC_ROOT(_t750); | |
| const char * _t751 = (&("\xff" ", title = ")[1]); | |
| SP_GC_ROOT(_t751); | |
| const char * _t752 = sp_Db_cls_escape_string(self->iv_title); | |
| SP_GC_ROOT(_t752); | |
| const char * _t753 = (&("\xff" ", updated_at = ")[1]); | |
| SP_GC_ROOT(_t753); | |
| const char * _t754 = sp_Db_cls_escape_string(self->iv_updated_at); | |
| SP_GC_ROOT(_t754); | |
| const char * _t755 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t755); | |
| const char * _t756 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t756); | |
| const char * _t757 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t757); | |
| return sp_Db_cls_exec(sp_str_concat_arr((const char *const[]){_t746, _t747, _t748, _t749, _t750, _t751, _t752, _t753, _t754, _t755, _t756, _t757}, 12)); | |
| return SP_INT_NIL; | |
| } | |
| static inline mrb_int sp_Article__implicit_9372__adapter_delete(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 179 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t758 = (&("\xff" "DELETE FROM articles")[1]); | |
| SP_GC_ROOT(_t758); | |
| const char * _t759 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t759); | |
| const char * _t760 = (&("\xff" "id = ")[1]); | |
| SP_GC_ROOT(_t760); | |
| const char * _t761 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t761); | |
| return sp_Db_cls_exec(sp_str_concat4(_t758, _t759, _t760, _t761)); | |
| return SP_INT_NIL; | |
| } | |
| static sp_RbVal sp_Article__implicit_9372__adapter_reload(sp_Article__implicit_9372 *self) { | |
| void * lv_stmt = NULL; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 203 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t762 = (&("\xff" "SELECT id, body, created_at, title, updated_at FROM articles WHERE id = ")[1]); | |
| SP_GC_ROOT(_t762); | |
| const char * _t763 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t763); | |
| const char * _t764 = (&("\xff" " LIMIT 1")[1]); | |
| SP_GC_ROOT(_t764); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat3(_t762, _t763, _t764)); | |
| #line 204 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (sp_Db_cls_step_p(lv_stmt)) { | |
| #line 205 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_id = sp_box_int(sp_Db_cls_column_int(sp_box_obj((void *)(lv_stmt), 0), 0LL)); | |
| #line 206 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_body = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 1LL)); | |
| #line 207 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_created_at = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 2LL)); | |
| #line 208 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_title = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 3LL)); | |
| #line 209 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_updated_at = sp_box_str(sp_Db_cls_column_text(sp_box_obj((void *)(lv_stmt), 0), 4LL)); | |
| #line 210 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_ActiveRecord_Base_mark_persisted_bang((sp_ActiveRecord_Base *)self); | |
| } | |
| #line 212 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 213 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t765 = sp_box_obj(self, 83); | |
| SP_GC_RESTORE(); | |
| return _t765; | |
| return sp_box_nil(); | |
| } | |
| static inline sp_StrArray * sp_Article__implicit_9372_validate(sp_Article__implicit_9372 *self) { | |
| mrb_int lv_len = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 224 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t766 = self->iv_title; | |
| mrb_bool _t767 = FALSE; | |
| if (_t766.tag == SP_TAG_STR) _t767 = (sp_str_length(_t766.v.s) == 0); | |
| if (_t766.tag == SP_TAG_OBJ) { | |
| if (_t766.cls_id == 55) _t767 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t766.v.p); | |
| if (_t766.cls_id == 56) _t767 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t766.v.p); | |
| if (_t766.cls_id == SP_BUILTIN_INT_ARRAY) _t767 = (sp_IntArray_length((sp_IntArray *)_t766.v.p) == 0); | |
| if (_t766.cls_id == SP_BUILTIN_FLT_ARRAY) _t767 = (sp_FloatArray_length((sp_FloatArray *)_t766.v.p) == 0); | |
| if (_t766.cls_id == SP_BUILTIN_STR_ARRAY) _t767 = (sp_StrArray_length((sp_StrArray *)_t766.v.p) == 0); | |
| if (_t766.cls_id == SP_BUILTIN_SYM_ARRAY) _t767 = (sp_IntArray_length((sp_IntArray *)_t766.v.p) == 0); | |
| if (_t766.cls_id == SP_BUILTIN_PTR_ARRAY) _t767 = (sp_PtrArray_length((sp_PtrArray *)_t766.v.p) == 0); | |
| if (_t766.cls_id == SP_BUILTIN_POLY_ARRAY) _t767 = (sp_PolyArray_length((sp_PolyArray *)_t766.v.p) == 0); | |
| if (_t766.cls_id == SP_BUILTIN_STR_INT_HASH) _t767 = (sp_StrIntHash_length((sp_StrIntHash *)_t766.v.p) == 0); | |
| if (_t766.cls_id == SP_BUILTIN_STR_STR_HASH) _t767 = (sp_StrStrHash_length((sp_StrStrHash *)_t766.v.p) == 0); | |
| if (_t766.cls_id == SP_BUILTIN_INT_STR_HASH) _t767 = (sp_IntStrHash_length((sp_IntStrHash *)_t766.v.p) == 0); | |
| if (_t766.cls_id == SP_BUILTIN_STR_POLY_HASH) _t767 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t766.v.p) == 0); | |
| if (_t766.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t767 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t766.v.p) == 0); | |
| if (_t766.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t767 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t766.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_title) || _t767)) { | |
| sp_StrArray * _t768 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t768); | |
| sp_StrArray_push(_t768, (&("\xff" "title can't be blank")[1])); | |
| } | |
| #line 225 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t769 = self->iv_body; | |
| mrb_bool _t770 = FALSE; | |
| if (_t769.tag == SP_TAG_STR) _t770 = (sp_str_length(_t769.v.s) == 0); | |
| if (_t769.tag == SP_TAG_OBJ) { | |
| if (_t769.cls_id == 55) _t770 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t769.v.p); | |
| if (_t769.cls_id == 56) _t770 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t769.v.p); | |
| if (_t769.cls_id == SP_BUILTIN_INT_ARRAY) _t770 = (sp_IntArray_length((sp_IntArray *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_FLT_ARRAY) _t770 = (sp_FloatArray_length((sp_FloatArray *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_STR_ARRAY) _t770 = (sp_StrArray_length((sp_StrArray *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_SYM_ARRAY) _t770 = (sp_IntArray_length((sp_IntArray *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_PTR_ARRAY) _t770 = (sp_PtrArray_length((sp_PtrArray *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_POLY_ARRAY) _t770 = (sp_PolyArray_length((sp_PolyArray *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_STR_INT_HASH) _t770 = (sp_StrIntHash_length((sp_StrIntHash *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_STR_STR_HASH) _t770 = (sp_StrStrHash_length((sp_StrStrHash *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_INT_STR_HASH) _t770 = (sp_IntStrHash_length((sp_IntStrHash *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_STR_POLY_HASH) _t770 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t770 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t769.v.p) == 0); | |
| if (_t769.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t770 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t769.v.p) == 0); | |
| } | |
| if ((sp_poly_nil_p(self->iv_body) || _t770)) { | |
| sp_StrArray * _t771 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t771); | |
| sp_StrArray_push(_t771, (&("\xff" "body can't be blank")[1])); | |
| } | |
| #line 226 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if ((!sp_poly_nil_p(self->iv_body))) { | |
| #line 227 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t772 = self->iv_body; | |
| mrb_int _t773 = 0; | |
| if (_t772.tag == SP_TAG_STR) _t773 = sp_str_length(_t772.v.s); | |
| if (_t772.tag == SP_TAG_OBJ) { | |
| if (_t772.cls_id == 55) _t773 = sp_ActionDispatch_Flash_length((sp_ActionDispatch_Flash *)_t772.v.p); | |
| if (_t772.cls_id == 56) _t773 = sp_ActionDispatch_Session_length((sp_ActionDispatch_Session *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_INT_ARRAY) _t773 = sp_IntArray_length((sp_IntArray *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_FLT_ARRAY) _t773 = sp_FloatArray_length((sp_FloatArray *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_STR_ARRAY) _t773 = sp_StrArray_length((sp_StrArray *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_SYM_ARRAY) _t773 = sp_IntArray_length((sp_IntArray *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_PTR_ARRAY) _t773 = sp_PtrArray_length((sp_PtrArray *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_POLY_ARRAY) _t773 = sp_PolyArray_length((sp_PolyArray *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_STR_INT_HASH) _t773 = sp_StrIntHash_length((sp_StrIntHash *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_STR_STR_HASH) _t773 = sp_StrStrHash_length((sp_StrStrHash *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_INT_STR_HASH) _t773 = sp_IntStrHash_length((sp_IntStrHash *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_STR_POLY_HASH) _t773 = sp_StrPolyHash_length((sp_StrPolyHash *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t773 = sp_SymPolyHash_length((sp_SymPolyHash *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t773 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_INT_ARRAY) _t773 = sp_IntArray_length((sp_IntArray *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_FLT_ARRAY) _t773 = sp_FloatArray_length((sp_FloatArray *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_STR_ARRAY) _t773 = sp_StrArray_length((sp_StrArray *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_SYM_ARRAY) _t773 = sp_IntArray_length((sp_IntArray *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_PTR_ARRAY) _t773 = sp_PtrArray_length((sp_PtrArray *)_t772.v.p); | |
| if (_t772.cls_id == SP_BUILTIN_POLY_ARRAY) _t773 = sp_PolyArray_length((sp_PolyArray *)_t772.v.p); | |
| } | |
| lv_len = _t773; | |
| #line 228 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if ((lv_len < 10LL)) { | |
| sp_StrArray * _t774 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)self); | |
| SP_GC_ROOT(_t774); | |
| sp_StrArray_push(_t774, (&("\xff" "body is too short (minimum is 10)")[1])); | |
| return NULL; | |
| } else { | |
| return NULL; | |
| } | |
| } else { | |
| return NULL; | |
| } | |
| return NULL; | |
| } | |
| static sp_RbVal sp_Article__implicit_9372_comments(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| void * lv_stmt = NULL; | |
| sp_IntArray * lv_results = NULL; | |
| SP_GC_ROOT(lv_results); | |
| SP_GC_ROOT(self); | |
| #line 233 "test/models/../../config/../app/controllers/../models/article.rb" | |
| if (self->iv_comments_loaded) { | |
| sp_RbVal _t775 = sp_box_int_array(self->iv_comments_cache); | |
| SP_GC_RESTORE(); | |
| return _t775; | |
| } | |
| #line 234 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t776 = (&("\xff" "SELECT id, article_id, body, commenter, created_at, updated_at FROM comments")[1]); | |
| SP_GC_ROOT(_t776); | |
| const char * _t777 = (&("\xff" " WHERE ")[1]); | |
| SP_GC_ROOT(_t777); | |
| const char * _t778 = (&("\xff" "article_id = ")[1]); | |
| SP_GC_ROOT(_t778); | |
| const char * _t779 = sp_Db_cls_escape_int(self->iv_id); | |
| SP_GC_ROOT(_t779); | |
| lv_stmt = sp_Db_cls_prepare(sp_str_concat4(_t776, _t777, _t778, _t779)); | |
| #line 235 "test/models/../../config/../app/controllers/../models/article.rb" | |
| lv_results = sp_IntArray_new(); | |
| #line 236 "test/models/../../config/../app/controllers/../models/article.rb" | |
| while (sp_Db_cls_step_p(lv_stmt)) { | |
| sp_redo_29: ; | |
| #line 237 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_IntArray_push(lv_results, sp_Comment_cls_from_stmt(sp_box_obj((void *)(lv_stmt), 0))); | |
| } | |
| #line 239 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Db_cls_finalize(lv_stmt); | |
| #line 240 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t780 = sp_box_int_array(lv_results); | |
| SP_GC_RESTORE(); | |
| return _t780; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372__preload_comments(sp_Article__implicit_9372 *self, mrb_int lv_list) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 244 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_cache = lv_list; | |
| #line 245 "test/models/../../config/../app/controllers/../models/article.rb" | |
| self->iv_comments_loaded = TRUE; | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Article__implicit_9372_before_destroy(sp_Article__implicit_9372 *self) { | |
| mrb_int lv_c = 0; | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 249 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_RbVal _t781 = sp_Article__implicit_9372_comments(self); | |
| SP_GC_ROOT_RBVAL(_t781); | |
| if (_t781.tag == SP_TAG_OBJ) { | |
| mrb_int _t782_len = 0; | |
| if (_t781.cls_id == SP_BUILTIN_RANGE) _t782_len = ((sp_Range *)_t781.v.p)->last - ((sp_Range *)_t781.v.p)->first + 1; | |
| else if (_t781.cls_id == SP_BUILTIN_INT_ARRAY) _t782_len = sp_IntArray_length((sp_IntArray *)_t781.v.p); | |
| else if (_t781.cls_id == SP_BUILTIN_FLT_ARRAY) _t782_len = sp_FloatArray_length((sp_FloatArray *)_t781.v.p); | |
| else if (_t781.cls_id == SP_BUILTIN_STR_ARRAY) _t782_len = sp_StrArray_length((sp_StrArray *)_t781.v.p); | |
| else if (_t781.cls_id == SP_BUILTIN_SYM_ARRAY) _t782_len = sp_IntArray_length((sp_IntArray *)_t781.v.p); | |
| else if (_t781.cls_id == SP_BUILTIN_PTR_ARRAY) _t782_len = sp_PtrArray_length((sp_PtrArray *)_t781.v.p); | |
| else if (_t781.cls_id == SP_BUILTIN_POLY_ARRAY) _t782_len = sp_PolyArray_length((sp_PolyArray *)_t781.v.p); | |
| else if (_t781.cls_id == SP_BUILTIN_STR_INT_HASH) _t782_len = ((sp_StrIntHash *)_t781.v.p)->len; | |
| else if (_t781.cls_id == SP_BUILTIN_STR_STR_HASH) _t782_len = ((sp_StrStrHash *)_t781.v.p)->len; | |
| else if (_t781.cls_id == SP_BUILTIN_INT_STR_HASH) _t782_len = ((sp_IntStrHash *)_t781.v.p)->len; | |
| else if (_t781.cls_id == SP_BUILTIN_SYM_INT_HASH) _t782_len = ((sp_SymIntHash *)_t781.v.p)->len; | |
| else if (_t781.cls_id == SP_BUILTIN_SYM_STR_HASH) _t782_len = ((sp_SymStrHash *)_t781.v.p)->len; | |
| else if (_t781.cls_id == SP_BUILTIN_STR_POLY_HASH) _t782_len = ((sp_StrPolyHash *)_t781.v.p)->len; | |
| else if (_t781.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t782_len = ((sp_SymPolyHash *)_t781.v.p)->len; | |
| else if (_t781.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t782_len = ((sp_PolyPolyHash *)_t781.v.p)->len; | |
| for (mrb_int _t782 = 0; _t782 < _t782_len; _t782++) { | |
| sp_RbVal _t783 = sp_box_nil(); | |
| if (_t781.cls_id == SP_BUILTIN_RANGE) _t783 = sp_box_int(((sp_Range *)_t781.v.p)->first + _t782); | |
| else if (_t781.cls_id == SP_BUILTIN_INT_ARRAY) _t783 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t781.v.p, _t782)); | |
| else if (_t781.cls_id == SP_BUILTIN_FLT_ARRAY) _t783 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t781.v.p, _t782)); | |
| else if (_t781.cls_id == SP_BUILTIN_STR_ARRAY) _t783 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t781.v.p, _t782)); | |
| else if (_t781.cls_id == SP_BUILTIN_SYM_ARRAY) _t783 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t781.v.p, _t782)); | |
| else if (_t781.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t781.v.p, _t782); _t783 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t781.cls_id == SP_BUILTIN_POLY_ARRAY) _t783 = sp_PolyArray_get((sp_PolyArray *)_t781.v.p, _t782); | |
| else if (_t781.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t781.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t782])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t782]))); _t783 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t781.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t781.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t782])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t782]))); _t783 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t781.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t781.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t782])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t782]))); _t783 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t781.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t781.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t782])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t782]))); _t783 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t781.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t781.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t782])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t782]))); _t783 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t781.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t781.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t782])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t782])); _t783 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t781.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t781.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t782])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t782])); _t783 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t781.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t781.v.p; mrb_int _pk = _sh->order[_t782]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t783 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_c = _t783; | |
| sp_redo_30: ; | |
| sp_RbVal _t784 = lv_c; | |
| sp_RbVal _t785 = sp_box_nil(); | |
| if (_t784.tag == SP_TAG_OBJ) { | |
| if (_t784.cls_id == 52) _t785 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t784.v.p), 52); | |
| if (_t784.cls_id == 65) _t785 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t784.v.p), 52); | |
| if (_t784.cls_id == 67) _t785 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t784.v.p), 52); | |
| if (_t784.cls_id == 71) _t785 = ((void)(sp_ArticlesController_destroy((sp_ArticlesController *)_t784.v.p)), sp_box_nil()); | |
| if (_t784.cls_id == 73) _t785 = ((void)(sp_CommentsController_destroy((sp_CommentsController *)_t784.v.p)), sp_box_nil()); | |
| if (_t784.cls_id == 78) _t785 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t784.v.p), 52); | |
| if (_t784.cls_id == 79) _t785 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t784.v.p), 52); | |
| if (_t784.cls_id == 80) _t785 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t784.v.p), 52); | |
| if (_t784.cls_id == 81) _t785 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t784.v.p), 52); | |
| if (_t784.cls_id == 82) _t785 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t784.v.p), 52); | |
| if (_t784.cls_id == 83) _t785 = sp_box_obj(sp_ActiveRecord_Base_destroy((sp_ActiveRecord_Base *)_t784.v.p), 52); | |
| } | |
| _t785; | |
| } | |
| } | |
| return sp_box_nil(); | |
| return sp_box_nil(); | |
| } | |
| static inline const char * sp_Article__implicit_9372_dom_prefix(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 253 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return (&("\xff" "article")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_after_create_commit(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 257 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_Broadcasts_cls_prepend((&("\xff" "articles")[1]), (&("\xff" "articles")[1]), sp_Views_Articles_cls_article(sp_box_obj(self, 83), 0, 0)); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_after_update_commit(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 261 "test/models/../../config/../app/controllers/../models/article.rb" | |
| const char * _t786 = sp_sprintf("article_%s", sp_poly_to_s(self->iv_id)); | |
| SP_GC_ROOT(_t786); | |
| sp_String * _t787 = sp_Views_Articles_cls_article(sp_box_obj(self, 83), 0, 0); | |
| SP_GC_ROOT(_t787); | |
| return sp_Broadcasts_cls_replace((&("\xff" "articles")[1]), _t786, _t787); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Article__implicit_9372_after_destroy_commit(sp_Article__implicit_9372 *self) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(self); | |
| #line 265 "test/models/../../config/../app/controllers/../models/article.rb" | |
| return sp_Broadcasts_cls_remove((&("\xff" "articles")[1]), sp_sprintf("article_%s", sp_poly_to_s(self->iv_id))); | |
| return 0; | |
| } | |
| static sp_IntArray * sp_Article__implicit_9372_cls_schema_columns(void) { | |
| SP_GC_SAVE(); | |
| #line 52 "test/models/../../config/../app/controllers/../models/article.rb" | |
| sp_IntArray *_t788 = sp_IntArray_new(); | |
| sp_IntArray_push(_t788, SPS_id); | |
| sp_IntArray_push(_t788, SPS_body); | |
| sp_IntArray_push(_t788, SPS_created_at); | |
| sp_IntArray_push(_t788, SPS_title); | |
| sp_IntArray_push(_t788, SPS_updated_at); | |
| return _t788; | |
| return NULL; | |
| } | |
| /* sp_Class new-dispatch table Tier 5) */ | |
| typedef sp_RbVal (*sp_class_new_fn)(void); | |
| static sp_RbVal sp_class_new_nil_fallback(void) __attribute__((unused)); | |
| static sp_RbVal sp_class_new_nil_fallback(void){return sp_box_nil();} | |
| static sp_RbVal sp_ActionView_Slots_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ActionView_Slots_new_dispatch_adapter(void){return sp_box_obj(sp_ActionView_Slots_new(), 57);} | |
| static sp_RbVal sp_ActionController_Base_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ActionController_Base_new_dispatch_adapter(void){return sp_box_obj(sp_ActionController_Base_new(), 58);} | |
| static sp_RbVal sp_Broadcasts_SeedTransport_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_Broadcasts_SeedTransport_new_dispatch_adapter(void){return sp_box_obj(sp_Broadcasts_SeedTransport_new(), 59);} | |
| static sp_RbVal sp_ActionDispatch_IntegrationTest_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ActionDispatch_IntegrationTest_new_dispatch_adapter(void){return sp_box_obj(sp_ActionDispatch_IntegrationTest_new(), 60);} | |
| static sp_RbVal sp_ApplicationController_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ApplicationController_new_dispatch_adapter(void){return sp_box_obj(sp_ApplicationController_new(), 64);} | |
| static sp_RbVal sp_CommentRow_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_CommentRow_new_dispatch_adapter(void){return sp_box_obj(sp_CommentRow_new(), 66);} | |
| static sp_RbVal sp_ArticleRow_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ArticleRow_new_dispatch_adapter(void){return sp_box_obj(sp_ArticleRow_new(), 68);} | |
| static sp_RbVal sp_ArticleParams_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ArticleParams_new_dispatch_adapter(void){return sp_box_obj(sp_ArticleParams_new(), 70);} | |
| static sp_RbVal sp_ArticlesController_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ArticlesController_new_dispatch_adapter(void){return sp_box_obj(sp_ArticlesController_new(), 71);} | |
| static sp_RbVal sp_CommentParams_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_CommentParams_new_dispatch_adapter(void){return sp_box_obj(sp_CommentParams_new(), 72);} | |
| static sp_RbVal sp_CommentsController_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_CommentsController_new_dispatch_adapter(void){return sp_box_obj(sp_CommentsController_new(), 73);} | |
| static sp_RbVal sp_TestBase_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_TestBase_new_dispatch_adapter(void){return sp_box_obj(sp_TestBase_new(), 75);} | |
| static sp_RbVal sp_ArticleTest_new_dispatch_adapter(void) __attribute__((unused)); | |
| static sp_RbVal sp_ArticleTest_new_dispatch_adapter(void){return sp_box_obj(sp_ArticleTest_new(), 76);} | |
| static const sp_class_new_fn sp_class_constructors[SP_CLASS_COUNT] __attribute__((unused)) = {sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_ActionView_Slots_new_dispatch_adapter,sp_ActionController_Base_new_dispatch_adapter,sp_Broadcasts_SeedTransport_new_dispatch_adapter,sp_ActionDispatch_IntegrationTest_new_dispatch_adapter,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_ApplicationController_new_dispatch_adapter,sp_class_new_nil_fallback,sp_CommentRow_new_dispatch_adapter,sp_class_new_nil_fallback,sp_ArticleRow_new_dispatch_adapter,sp_class_new_nil_fallback,sp_ArticleParams_new_dispatch_adapter,sp_ArticlesController_new_dispatch_adapter,sp_CommentParams_new_dispatch_adapter,sp_CommentsController_new_dispatch_adapter,sp_class_new_nil_fallback,sp_TestBase_new_dispatch_adapter,sp_ArticleTest_new_dispatch_adapter,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback,sp_class_new_nil_fallback}; | |
| static sp_RbVal sp_class_new_dispatch(sp_Class c) __attribute__((unused)); | |
| static sp_RbVal sp_class_new_dispatch(sp_Class c){if(c.cls_id<0||c.cls_id>=SP_CLASS_COUNT)return sp_box_nil();return sp_class_constructors[c.cls_id]();} | |
| static const char * sp_Base64_cls_strict_encode64(const char * lv_s) { | |
| SP_GC_SAVE(); | |
| sp_IntArray * lv_bytes = NULL; | |
| mrb_int lv_n = 0; | |
| const char * lv_out = (&("\xff")[1]); | |
| mrb_int lv_i = 0; | |
| mrb_int lv_b0 = SP_INT_NIL; | |
| mrb_int lv_b1 = SP_INT_NIL; | |
| mrb_int lv_b2 = SP_INT_NIL; | |
| mrb_int lv_rem = 0; | |
| SP_GC_ROOT(lv_bytes); | |
| SP_GC_ROOT(lv_out); | |
| SP_GC_ROOT(lv_s); | |
| SP_GC_ROOT(lv_s); | |
| #line 21 "test/models/../../runtime/base64.rb" | |
| lv_bytes = sp_str_bytes(lv_s); | |
| #line 22 "test/models/../../runtime/base64.rb" | |
| lv_n = sp_IntArray_length(lv_bytes); | |
| #line 23 "test/models/../../runtime/base64.rb" | |
| lv_out = (&("\xff" "")[1]); | |
| #line 24 "test/models/../../runtime/base64.rb" | |
| lv_i = 0LL; | |
| #line 25 "test/models/../../runtime/base64.rb" | |
| while ((sp_int_add(lv_i, 3LL) <= lv_n)) { | |
| sp_redo_31: ; | |
| #line 26 "test/models/../../runtime/base64.rb" | |
| lv_b0 = sp_IntArray_get(lv_bytes, lv_i); | |
| #line 27 "test/models/../../runtime/base64.rb" | |
| lv_b1 = sp_IntArray_get(lv_bytes, sp_int_add(lv_i, 1LL)); | |
| #line 28 "test/models/../../runtime/base64.rb" | |
| lv_b2 = sp_IntArray_get(lv_bytes, sp_int_add(lv_i, 2LL)); | |
| #line 29 "test/models/../../runtime/base64.rb" | |
| const char * _t789 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 >> 2LL) & 63LL)); | |
| SP_GC_ROOT(_t789); | |
| const char * _t790 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 >> 2LL) & 63LL)); | |
| SP_GC_ROOT(_t790); | |
| lv_out = sp_str_concat(lv_out, _t790); | |
| #line 30 "test/models/../../runtime/base64.rb" | |
| const char * _t791 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (((lv_b0 << 4LL) | (lv_b1 >> 4LL)) & 63LL)); | |
| SP_GC_ROOT(_t791); | |
| const char * _t792 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (((lv_b0 << 4LL) | (lv_b1 >> 4LL)) & 63LL)); | |
| SP_GC_ROOT(_t792); | |
| lv_out = sp_str_concat(lv_out, _t792); | |
| #line 31 "test/models/../../runtime/base64.rb" | |
| const char * _t793 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (((lv_b1 << 2LL) | (lv_b2 >> 6LL)) & 63LL)); | |
| SP_GC_ROOT(_t793); | |
| const char * _t794 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (((lv_b1 << 2LL) | (lv_b2 >> 6LL)) & 63LL)); | |
| SP_GC_ROOT(_t794); | |
| lv_out = sp_str_concat(lv_out, _t794); | |
| #line 32 "test/models/../../runtime/base64.rb" | |
| const char * _t795 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (lv_b2 & 63LL)); | |
| SP_GC_ROOT(_t795); | |
| const char * _t796 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (lv_b2 & 63LL)); | |
| SP_GC_ROOT(_t796); | |
| lv_out = sp_str_concat(lv_out, _t796); | |
| #line 33 "test/models/../../runtime/base64.rb" | |
| lv_i = sp_int_add(lv_i, 3LL); | |
| } | |
| #line 35 "test/models/../../runtime/base64.rb" | |
| lv_rem = sp_int_sub(lv_n, lv_i); | |
| #line 36 "test/models/../../runtime/base64.rb" | |
| if ((lv_rem == 1LL)) { | |
| #line 37 "test/models/../../runtime/base64.rb" | |
| lv_b0 = sp_IntArray_get(lv_bytes, lv_i); | |
| #line 38 "test/models/../../runtime/base64.rb" | |
| const char * _t797 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 >> 2LL) & 63LL)); | |
| SP_GC_ROOT(_t797); | |
| const char * _t798 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 >> 2LL) & 63LL)); | |
| SP_GC_ROOT(_t798); | |
| lv_out = sp_str_concat(lv_out, _t798); | |
| #line 39 "test/models/../../runtime/base64.rb" | |
| const char * _t799 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 << 4LL) & 63LL)); | |
| SP_GC_ROOT(_t799); | |
| const char * _t800 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 << 4LL) & 63LL)); | |
| SP_GC_ROOT(_t800); | |
| lv_out = sp_str_concat(lv_out, _t800); | |
| #line 40 "test/models/../../runtime/base64.rb" | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "==")[1])); | |
| } else { | |
| if ((lv_rem == 2LL)) { | |
| #line 42 "test/models/../../runtime/base64.rb" | |
| lv_b0 = sp_IntArray_get(lv_bytes, lv_i); | |
| #line 43 "test/models/../../runtime/base64.rb" | |
| lv_b1 = sp_IntArray_get(lv_bytes, sp_int_add(lv_i, 1LL)); | |
| #line 44 "test/models/../../runtime/base64.rb" | |
| const char * _t801 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 >> 2LL) & 63LL)); | |
| SP_GC_ROOT(_t801); | |
| const char * _t802 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b0 >> 2LL) & 63LL)); | |
| SP_GC_ROOT(_t802); | |
| lv_out = sp_str_concat(lv_out, _t802); | |
| #line 45 "test/models/../../runtime/base64.rb" | |
| const char * _t803 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (((lv_b0 << 4LL) | (lv_b1 >> 4LL)) & 63LL)); | |
| SP_GC_ROOT(_t803); | |
| const char * _t804 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), (((lv_b0 << 4LL) | (lv_b1 >> 4LL)) & 63LL)); | |
| SP_GC_ROOT(_t804); | |
| lv_out = sp_str_concat(lv_out, _t804); | |
| #line 46 "test/models/../../runtime/base64.rb" | |
| const char * _t805 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b1 << 2LL) & 63LL)); | |
| SP_GC_ROOT(_t805); | |
| const char * _t806 = sp_str_char_at_or_nil((&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]), ((lv_b1 << 2LL) & 63LL)); | |
| SP_GC_ROOT(_t806); | |
| lv_out = sp_str_concat(lv_out, _t806); | |
| #line 47 "test/models/../../runtime/base64.rb" | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "=")[1])); | |
| } | |
| } | |
| #line 49 "test/models/../../runtime/base64.rb" | |
| return (const char *)lv_out; | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_Base64_cls_strict_decode64(sp_RbVal lv_s) { | |
| (void)lv_s; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Base64_cls_char_value(sp_RbVal lv_c) { | |
| (void)lv_c; | |
| return 0; | |
| } | |
| static inline const char * sp_JSON_cls_generate(sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| #line 20 "test/models/../../runtime/json.rb" | |
| sp_RbVal _t807 = lv_value; | |
| if ((_t807.tag == SP_TAG_STR)) { | |
| #line 21 "test/models/../../runtime/json.rb" | |
| const char * _t808 = (&("\xff" "\"")[1]); | |
| SP_GC_ROOT(_t808); | |
| const char * _t809 = sp_JSON_cls_escape_string((lv_value).v.s); | |
| SP_GC_ROOT(_t809); | |
| const char * _t810 = (&("\xff" "\"")[1]); | |
| SP_GC_ROOT(_t810); | |
| return sp_str_concat3(_t808, _t809, _t810); | |
| } else { | |
| #line 26 "test/models/../../runtime/json.rb" | |
| return sp_poly_to_s(lv_value); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_JSON_cls_escape_string(const char * lv_s) { | |
| SP_GC_SAVE(); | |
| const char * lv_out = (&("\xff")[1]); | |
| mrb_int lv_i = 0; | |
| mrb_int lv_n = 0; | |
| const char * lv_c = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_out); | |
| SP_GC_ROOT(lv_c); | |
| SP_GC_ROOT(lv_s); | |
| SP_GC_ROOT(lv_s); | |
| #line 31 "test/models/../../runtime/json.rb" | |
| lv_out = (&("\xff" "")[1]); | |
| #line 32 "test/models/../../runtime/json.rb" | |
| lv_i = 0LL; | |
| #line 33 "test/models/../../runtime/json.rb" | |
| lv_n = sp_str_length(lv_s); | |
| #line 34 "test/models/../../runtime/json.rb" | |
| while ((lv_i < lv_n)) { | |
| sp_redo_32: ; | |
| #line 35 "test/models/../../runtime/json.rb" | |
| lv_c = sp_str_char_at_or_nil(lv_s, lv_i); | |
| #line 36 "test/models/../../runtime/json.rb" | |
| if (sp_str_eq(lv_c, (&("\xff" "\"")[1]))) { | |
| #line 37 "test/models/../../runtime/json.rb" | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "\\\"")[1])); | |
| } else { | |
| if (sp_str_eq(lv_c, (&("\xff" "\\")[1]))) { | |
| #line 39 "test/models/../../runtime/json.rb" | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "\\\\")[1])); | |
| } else { | |
| if (sp_str_eq(lv_c, (&("\xff" "\n")[1]))) { | |
| #line 41 "test/models/../../runtime/json.rb" | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "\\n")[1])); | |
| } else { | |
| if (sp_str_eq(lv_c, (&("\xff" "\r")[1]))) { | |
| #line 43 "test/models/../../runtime/json.rb" | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "\\r")[1])); | |
| } else { | |
| if (sp_str_eq(lv_c, (&("\xff" "\t")[1]))) { | |
| #line 45 "test/models/../../runtime/json.rb" | |
| lv_out = sp_str_concat(lv_out, (&("\xff" "\\t")[1])); | |
| } else { | |
| #line 47 "test/models/../../runtime/json.rb" | |
| lv_out = sp_str_concat(lv_out, lv_c); | |
| } | |
| } | |
| } | |
| } | |
| } | |
| #line 49 "test/models/../../runtime/json.rb" | |
| lv_i = sp_int_add(lv_i, 1LL); | |
| } | |
| #line 51 "test/models/../../runtime/json.rb" | |
| return (const char *)lv_out; | |
| return (&("\xff")[1]); | |
| } | |
| static mrb_int sp_Db_cls_configure(const char * lv_path, mrb_int lv_pool_size) { | |
| SP_GC_SAVE(); | |
| mrb_int lv_n = 0; | |
| const char * lv_ev = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_ev); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_path); | |
| #line 230 "test/models/../../runtime/db.rb" | |
| lv_n = lv_pool_size; | |
| #line 231 "test/models/../../runtime/db.rb" | |
| lv_ev = sp_str_dup_external(getenv((&("\xff" "DATABASE_POOL_SIZE")[1]))); | |
| #line 232 "test/models/../../runtime/db.rb" | |
| mrb_bool _t811 = (!(lv_ev == NULL)); | |
| mrb_bool _t812 = FALSE; | |
| if (_t811) { | |
| _t812 = (!sp_str_eq(lv_ev, (&("\xff" "")[1]))); | |
| } else { | |
| _t812 = _t811; | |
| } | |
| if (_t812) { | |
| #line 233 "test/models/../../runtime/db.rb" | |
| lv_n = sp_str_to_i_cruby(lv_ev); | |
| } | |
| #line 235 "test/models/../../runtime/db.rb" | |
| cst_Db_pool = sp_DbPool_new(lv_path, lv_n); | |
| return 0; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_Db_cls_current_conn(void) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_c = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_c); | |
| #line 245 "test/models/../../runtime/db.rb" | |
| lv_c = sp_Fiber_storage_get(sp_fiber_current, SPS_db_conn); | |
| #line 246 "test/models/../../runtime/db.rb" | |
| if ((!sp_poly_nil_p(lv_c))) { | |
| sp_RbVal _t813 = lv_c; | |
| SP_GC_RESTORE(); | |
| return _t813; | |
| } | |
| #line 247 "test/models/../../runtime/db.rb" | |
| sp_RbVal _t814 = sp_box_obj(sp_DbPool_first(cst_Db_pool), 62); | |
| SP_GC_RESTORE(); | |
| return _t814; | |
| return sp_box_nil(); | |
| } | |
| static mrb_int sp_Db_cls_with_connection(void) { | |
| return 0; | |
| } | |
| static inline mrb_int sp_Db_cls_close(void) { | |
| return SP_INT_NIL; | |
| } | |
| static mrb_int sp_Db_cls_exec(const char * lv_sql) { | |
| SP_GC_SAVE(); | |
| void * lv_h = NULL; | |
| mrb_int lv_rc = 0; | |
| SP_GC_ROOT(lv_sql); | |
| SP_GC_ROOT(lv_sql); | |
| #line 283 "test/models/../../runtime/db.rb" | |
| sp_Db_cls_record_query((const char *)lv_sql); | |
| #line 284 "test/models/../../runtime/db.rb" | |
| sp_RbVal _t815 = sp_Db_cls_current_conn(); | |
| void * _t816 = NULL; | |
| if (_t815.tag == SP_TAG_OBJ) { | |
| if (_t815.cls_id == 62) _t816 = sp_DbConn_dbh((sp_DbConn *)_t815.v.p); | |
| } | |
| lv_h = _t816; | |
| #line 285 "test/models/../../runtime/db.rb" | |
| lv_rc = sqlite3_exec(((void *)(uintptr_t)lv_h), lv_sql, ((void *)(uintptr_t)0), ((void *)(uintptr_t)0), ((void *)(uintptr_t)0)); | |
| #line 286 "test/models/../../runtime/db.rb" | |
| if ((lv_rc != cst_SQL_OK)) { | |
| #line 287 "test/models/../../runtime/db.rb" | |
| const char * _t817 = (&("\xff" "Db.exec failed (")[1]); | |
| SP_GC_ROOT(_t817); | |
| const char * _t818 = sp_int_to_s(lv_rc); | |
| SP_GC_ROOT(_t818); | |
| const char * _t819 = (&("\xff" "): ")[1]); | |
| SP_GC_ROOT(_t819); | |
| const char * _t820 = sp_str_dup_external(sqlite3_errmsg(((void *)(uintptr_t)lv_h))); | |
| SP_GC_ROOT(_t820); | |
| const char * _t821 = (&("\xff" " \xE2\x80\x94 sql: ")[1]); | |
| SP_GC_ROOT(_t821); | |
| const char * _t822 = lv_sql; | |
| SP_GC_ROOT(_t822); | |
| sp_raise(sp_str_concat_arr((const char *const[]){_t817, _t818, _t819, _t820, _t821, _t822}, 6)); | |
| return SP_INT_NIL; | |
| } else { | |
| return SP_INT_NIL; | |
| } | |
| return SP_INT_NIL; | |
| } | |
| static inline void * sp_Db_cls_prepare(const char * lv_sql) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_sql); | |
| SP_GC_ROOT(lv_sql); | |
| #line 296 "test/models/../../runtime/db.rb" | |
| sp_Db_cls_record_query((const char *)lv_sql); | |
| #line 297 "test/models/../../runtime/db.rb" | |
| sp_RbVal _t823 = sp_Db_cls_current_conn(); | |
| void * _t824 = NULL; | |
| if (_t823.tag == SP_TAG_OBJ) { | |
| if (_t823.cls_id == 62) _t824 = sp_DbConn_prepare_cached((sp_DbConn *)_t823.v.p, lv_sql); | |
| } | |
| return _t824; | |
| return NULL; | |
| } | |
| static sp_IntArray * sp_Db_cls_capture_sql(void) { | |
| return NULL; | |
| } | |
| static inline sp_RbVal sp_Db_cls_record_query(const char * lv_sql) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_sql); | |
| SP_GC_ROOT(lv_sql); | |
| #line 319 "test/models/../../runtime/db.rb" | |
| if (!(sp_poly_nil_p(cst_Db_query_log))) { | |
| sp_RbVal _t825 = cst_Db_query_log; | |
| mrb_int _t826 = 0; | |
| if (_t825.tag == SP_TAG_OBJ) { | |
| } | |
| _t826; | |
| return sp_box_nil(); | |
| } else { | |
| return sp_box_nil(); | |
| } | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_bool sp_Db_cls_step_p(void * lv_stmt) { | |
| SP_GC_SAVE(); | |
| #line 323 "test/models/../../runtime/db.rb" | |
| return (sqlite3_step(((void *)(uintptr_t)lv_stmt)) == cst_SQL_ROW); | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_Db_cls_column_int(sp_RbVal lv_stmt, mrb_int lv_i) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_stmt); | |
| #line 327 "test/models/../../runtime/db.rb" | |
| return sqlite3_column_int(((void *)(lv_stmt).v.p), ((int)(lv_i))); | |
| return 0; | |
| } | |
| static inline const char * sp_Db_cls_column_text(sp_RbVal lv_stmt, mrb_int lv_i) { | |
| SP_GC_SAVE(); | |
| const char * lv_s = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_s); | |
| SP_GC_ROOT_RBVAL(lv_stmt); | |
| #line 335 "test/models/../../runtime/db.rb" | |
| lv_s = sp_str_dup_external(sqlite3_column_text(((void *)(lv_stmt).v.p), ((int)(lv_i)))); | |
| #line 336 "test/models/../../runtime/db.rb" | |
| if ((lv_s == NULL)) { | |
| #line 337 "test/models/../../runtime/db.rb" | |
| return (&("\xff" "")[1]); | |
| } else { | |
| #line 339 "test/models/../../runtime/db.rb" | |
| return sp_str_concat(lv_s, (&("\xff" "")[1])); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Db_cls_column_count(mrb_int lv_stmt) { | |
| (void)lv_stmt; | |
| return 0; | |
| } | |
| static inline const char * sp_Db_cls_column_name(mrb_int lv_stmt, mrb_int lv_i) { | |
| (void)lv_stmt; | |
| (void)lv_i; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_Db_cls_finalize(void * lv_stmt) { | |
| SP_GC_SAVE(); | |
| #line 363 "test/models/../../runtime/db.rb" | |
| sqlite3_reset(((void *)(uintptr_t)lv_stmt)); | |
| #line 364 "test/models/../../runtime/db.rb" | |
| return sqlite3_clear_bindings(((void *)(uintptr_t)lv_stmt)); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Db_cls_last_insert_rowid(void) { | |
| SP_GC_SAVE(); | |
| #line 368 "test/models/../../runtime/db.rb" | |
| sp_RbVal _t827 = sp_Db_cls_current_conn(); | |
| void * _t828 = NULL; | |
| if (_t827.tag == SP_TAG_OBJ) { | |
| if (_t827.cls_id == 62) _t828 = sp_DbConn_dbh((sp_DbConn *)_t827.v.p); | |
| } | |
| return sqlite3_last_insert_rowid(((void *)(uintptr_t)_t828)); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Db_cls_changes(void) { | |
| return 0; | |
| } | |
| static inline const char * sp_Db_cls_escape_string(sp_RbVal lv_s) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_s); | |
| #line 379 "test/models/../../runtime/db.rb" | |
| const char * _t829 = sp_poly_to_s(lv_s); | |
| SP_GC_ROOT(_t829); | |
| const char * _t830 = (&("\xff" "'")[1]); | |
| SP_GC_ROOT(_t830); | |
| const char * _t831 = sp_str_gsub(_t829, (&("\xff" "'")[1]), (&("\xff" "''")[1])); | |
| SP_GC_ROOT(_t831); | |
| const char * _t832 = (&("\xff" "'")[1]); | |
| SP_GC_ROOT(_t832); | |
| return sp_str_concat3(_t830, _t831, _t832); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_Db_cls_escape_int(sp_RbVal lv_n) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_n); | |
| #line 383 "test/models/../../runtime/db.rb" | |
| sp_RbVal _t834 = lv_n; | |
| mrb_int _t833 = (_t834.tag == SP_TAG_INT) ? _t834.v.i : 0; | |
| return sp_int_to_s(_t833); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_Db_cls_escape_int_list(sp_PolyArray * lv_ids) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_i = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_i); | |
| SP_GC_ROOT(lv_ids); | |
| SP_GC_ROOT(lv_ids); | |
| #line 390 "test/models/../../runtime/db.rb" | |
| if ((sp_PolyArray_length(lv_ids) == 0)) { | |
| const char * _t835 = (&("\xff" "NULL")[1]); | |
| SP_GC_RESTORE(); | |
| return _t835; | |
| } | |
| #line 392 "test/models/../../runtime/db.rb" | |
| SP_GC_ROOT(lv_ids); | |
| sp_StrArray *_t836 = sp_StrArray_new(); | |
| SP_GC_ROOT(_t836); | |
| for (mrb_int _t837 = 0; _t837 < sp_PolyArray_length(lv_ids); _t837++) { | |
| sp_RbVal lv_i = sp_PolyArray_get(lv_ids, _t837); | |
| sp_RbVal _t839 = lv_i; | |
| mrb_int _t838 = (_t839.tag == SP_TAG_INT) ? _t839.v.i : 0; | |
| sp_StrArray_push(_t836, sp_int_to_s(_t838)); | |
| } | |
| sp_StrArray * _t840 = _t836; | |
| SP_GC_ROOT(_t840); | |
| return sp_StrArray_join(_t840, (&("\xff" ", ")[1])); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_Db_cls_escape_bool(mrb_int lv_b) { | |
| (void)lv_b; | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_bool sp_Db_cls_column_bool(mrb_int lv_stmt, mrb_int lv_idx) { | |
| (void)lv_stmt; | |
| (void)lv_idx; | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Registry_cls_register(const char * lv_name, sp_RbVal lv_klass) { | |
| (void)lv_name; | |
| (void)lv_klass; | |
| return 0; | |
| } | |
| static inline sp_RbVal sp_ActiveRecord_Registry_cls_lookup(const char * lv_name) { | |
| (void)lv_name; | |
| return sp_box_nil(); | |
| } | |
| static inline mrb_bool sp_ActiveRecord_Registry_cls_registered_p(const char * lv_name) { | |
| (void)lv_name; | |
| return FALSE; | |
| } | |
| static inline mrb_int sp_ActiveRecord_Registry_cls_clear_bang(void) { | |
| return 0; | |
| } | |
| static inline sp_StrArray * sp_Schema_cls_statements(void) { | |
| SP_GC_SAVE(); | |
| #line 3 "test/models/../../config/schema.rb" | |
| sp_StrArray *_t841 = sp_StrArray_new(); | |
| SP_GC_ROOT(_t841); | |
| sp_StrArray_push(_t841, (&("\xff" "CREATE TABLE IF NOT EXISTS articles (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n body TEXT,\n created_at TEXT NOT NULL,\n title TEXT,\n updated_at TEXT NOT NULL\n)")[1])); | |
| sp_StrArray_push(_t841, (&("\xff" "CREATE TABLE IF NOT EXISTS comments (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n article_id INTEGER NOT NULL,\n body TEXT,\n commenter TEXT,\n created_at TEXT NOT NULL,\n updated_at TEXT NOT NULL\n)")[1])); | |
| sp_StrArray_push(_t841, (&("\xff" "CREATE INDEX IF NOT EXISTS index_comments_on_article_id ON comments (article_id)")[1])); | |
| return _t841; | |
| return NULL; | |
| } | |
| static sp_ActionDispatch_Router_MatchResult * sp_ActionDispatch_Router_cls_match(const char * lv_method, const char * lv_path, sp_PtrArray * lv_table) { | |
| SP_GC_SAVE(); | |
| const char * lv_method_upcase = (&("\xff")[1]); | |
| mrb_int lv_i = 0; | |
| sp_ActionDispatch_Router_Route * lv_route = NULL; | |
| sp_StrStrHash * lv_params = NULL; | |
| SP_GC_ROOT(lv_method_upcase); | |
| SP_GC_ROOT(lv_route); | |
| SP_GC_ROOT(lv_params); | |
| SP_GC_ROOT(lv_method); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_table); | |
| SP_GC_ROOT(lv_method); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_table); | |
| #line 60 "test/models/../../runtime/action_dispatch/router.rb" | |
| const char * _t842 = lv_method; | |
| SP_GC_ROOT(_t842); | |
| lv_method_upcase = sp_str_upcase(_t842); | |
| #line 61 "test/models/../../runtime/action_dispatch/router.rb" | |
| lv_i = 0LL; | |
| #line 62 "test/models/../../runtime/action_dispatch/router.rb" | |
| mrb_int _t843 = sp_PtrArray_length(lv_table); | |
| while ((lv_i < sp_PtrArray_length(lv_table))) { | |
| sp_redo_33: ; | |
| #line 63 "test/models/../../runtime/action_dispatch/router.rb" | |
| lv_route = ((sp_ActionDispatch_Router_Route *)sp_PtrArray_get(lv_table, lv_i)); | |
| #line 64 "test/models/../../runtime/action_dispatch/router.rb" | |
| const char * _t844 = lv_route->iv_verb; | |
| SP_GC_ROOT(_t844); | |
| if (sp_str_eq(_t844, lv_method_upcase)) { | |
| #line 65 "test/models/../../runtime/action_dispatch/router.rb" | |
| const char * _t845 = lv_route->iv_pattern; | |
| SP_GC_ROOT(_t845); | |
| lv_params = sp_ActionDispatch_Router_cls_match_pattern(_t845, (const char *)lv_path); | |
| #line 66 "test/models/../../runtime/action_dispatch/router.rb" | |
| if (!((lv_params == NULL))) { | |
| #line 67 "test/models/../../runtime/action_dispatch/router.rb" | |
| sp_ActionDispatch_Router_MatchResult * _t846 = sp_ActionDispatch_Router_MatchResult_new(lv_route->iv_controller, lv_route->iv_action, lv_params); | |
| SP_GC_RESTORE(); | |
| return _t846; | |
| } | |
| } | |
| #line 70 "test/models/../../runtime/action_dispatch/router.rb" | |
| lv_i += 1LL; | |
| } | |
| #line 72 "test/models/../../runtime/action_dispatch/router.rb" | |
| return 0; | |
| return NULL; | |
| } | |
| static sp_StrStrHash * sp_ActionDispatch_Router_cls_match_pattern(const char * lv_pattern, const char * lv_path) { | |
| SP_GC_SAVE(); | |
| sp_StrArray * lv_pattern_parts = NULL; | |
| sp_StrArray * lv_path_parts = NULL; | |
| sp_StrStrHash * lv_params = NULL; | |
| mrb_int lv_i = 0; | |
| const char * lv_pp = (&("\xff")[1]); | |
| const char * lv_ap = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_pattern_parts); | |
| SP_GC_ROOT(lv_path_parts); | |
| SP_GC_ROOT(lv_params); | |
| SP_GC_ROOT(lv_pp); | |
| SP_GC_ROOT(lv_ap); | |
| SP_GC_ROOT(lv_pattern); | |
| SP_GC_ROOT(lv_path); | |
| SP_GC_ROOT(lv_pattern); | |
| SP_GC_ROOT(lv_path); | |
| #line 82 "test/models/../../runtime/action_dispatch/router.rb" | |
| lv_pattern_parts = sp_str_split_drop_trailing(lv_pattern, (&("\xff" "/")[1])); | |
| #line 83 "test/models/../../runtime/action_dispatch/router.rb" | |
| lv_path_parts = sp_str_split_drop_trailing(lv_path, (&("\xff" "/")[1])); | |
| #line 84 "test/models/../../runtime/action_dispatch/router.rb" | |
| if ((sp_StrArray_length(lv_pattern_parts) != sp_StrArray_length(lv_path_parts))) { | |
| SP_GC_RESTORE(); | |
| return NULL; | |
| } | |
| #line 85 "test/models/../../runtime/action_dispatch/router.rb" | |
| lv_params = sp_StrStrHash_new(); | |
| #line 86 "test/models/../../runtime/action_dispatch/router.rb" | |
| lv_i = 0LL; | |
| #line 87 "test/models/../../runtime/action_dispatch/router.rb" | |
| mrb_int _t847 = sp_StrArray_length(lv_pattern_parts); | |
| while ((lv_i < sp_StrArray_length(lv_pattern_parts))) { | |
| sp_redo_34: ; | |
| #line 88 "test/models/../../runtime/action_dispatch/router.rb" | |
| lv_pp = sp_StrArray_get(lv_pattern_parts, lv_i); | |
| #line 89 "test/models/../../runtime/action_dispatch/router.rb" | |
| lv_ap = sp_StrArray_get(lv_path_parts, lv_i); | |
| #line 90 "test/models/../../runtime/action_dispatch/router.rb" | |
| if (sp_str_start_with(lv_pp, (&("\xff" ":")[1]))) { | |
| #line 91 "test/models/../../runtime/action_dispatch/router.rb" | |
| if (sp_gc_is_frozen(lv_params)) sp_raise_frozen_hash(); | |
| sp_StrStrHash_set(lv_params, sp_str_sub_range_r(lv_pp, 1LL, -1, 0), lv_ap); | |
| } else { | |
| if ((!sp_str_eq(lv_pp, lv_ap))) { | |
| #line 93 "test/models/../../runtime/action_dispatch/router.rb" | |
| SP_GC_RESTORE(); | |
| return NULL; | |
| } | |
| } | |
| #line 95 "test/models/../../runtime/action_dispatch/router.rb" | |
| lv_i += 1LL; | |
| } | |
| #line 97 "test/models/../../runtime/action_dispatch/router.rb" | |
| return (sp_StrStrHash *)lv_params; | |
| return NULL; | |
| } | |
| static inline mrb_int sp_ActionView_ViewHelpers_cls_reset_slots_bang(void) { | |
| SP_GC_SAVE(); | |
| #line 35 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| cst_ActionView_ViewHelpers_slots = sp_SymStrHash_new(); | |
| return 0; | |
| return 0; | |
| } | |
| static inline mrb_int sp_ActionView_ViewHelpers_cls_content_for_set(sp_sym lv_slot, const char * lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_value); | |
| SP_GC_ROOT(lv_value); | |
| #line 39 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| if (sp_gc_is_frozen(cst_ActionView_ViewHelpers_slots)) sp_raise_frozen_hash(); | |
| sp_SymStrHash_set(cst_ActionView_ViewHelpers_slots, lv_slot, lv_value); | |
| #line 40 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_content_for_get(sp_sym lv_slot) { | |
| (void)lv_slot; | |
| return NULL; | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_get_slot(sp_sym lv_slot) { | |
| (void)lv_slot; | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_get_yield(void) { | |
| return (&("\xff")[1]); | |
| } | |
| static inline mrb_int sp_ActionView_ViewHelpers_cls_set_yield(const char * lv_content) { | |
| (void)lv_content; | |
| return 0; | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_html_escape(const char * lv_s) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_s); | |
| SP_GC_ROOT(lv_s); | |
| #line 86 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| return sp_re_gsub_str_str_hash((sp_re_pat_err_0 ? (sp_raise_cls("RegexpError", sp_re_pat_err_0), (mrb_regexp_pattern *)NULL) : sp_re_pat_0), lv_s, cst_ActionView_ViewHelpers_HTML_ESCAPES); | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_ActionView_ViewHelpers_cls_truncate(const char * lv_s, mrb_int lv_length, const char * lv_omission) { | |
| SP_GC_SAVE(); | |
| mrb_int lv_cutoff = 0; | |
| SP_GC_ROOT(lv_s); | |
| SP_GC_ROOT(lv_omission); | |
| SP_GC_ROOT(lv_s); | |
| SP_GC_ROOT(lv_omission); | |
| #line 90 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| if ((sp_str_length(lv_s) <= lv_length)) { | |
| const char * _t848 = lv_s; | |
| SP_GC_RESTORE(); | |
| return _t848; | |
| } | |
| #line 91 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| lv_cutoff = sp_int_sub(lv_length, sp_str_length(lv_omission)); | |
| #line 92 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| if ((lv_cutoff < 0LL)) { | |
| lv_cutoff = 0LL; | |
| } | |
| #line 93 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| return sp_sprintf("%s%s", sp_str_sub_range(lv_s, 0LL, lv_cutoff), lv_omission); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_dom_id(sp_RbVal lv_record, sp_RbVal lv_suffix) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_record); | |
| SP_GC_ROOT_RBVAL(lv_suffix); | |
| #line 115 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| if (sp_poly_nil_p(lv_suffix)) { | |
| #line 117 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| sp_RbVal _t849 = lv_record; | |
| const char * _t850 = (&("\xff")[1]); | |
| if (_t849.tag == SP_TAG_OBJ) { | |
| if (_t849.cls_id == 52) _t850 = sp_ActiveRecord_Base_dom_prefix((sp_ActiveRecord_Base *)_t849.v.p); | |
| if (_t849.cls_id == 65) _t850 = sp_ActiveRecord_Base_dom_prefix((sp_ActiveRecord_Base *)_t849.v.p); | |
| if (_t849.cls_id == 67) _t850 = sp_Comment_dom_prefix((sp_Comment *)_t849.v.p); | |
| if (_t849.cls_id == 78) _t850 = sp_Article__implicit_6872_dom_prefix((sp_Article__implicit_6872 *)_t849.v.p); | |
| if (_t849.cls_id == 79) _t850 = sp_Article__implicit_6906_dom_prefix((sp_Article__implicit_6906 *)_t849.v.p); | |
| if (_t849.cls_id == 80) _t850 = sp_Article__implicit_7484_dom_prefix((sp_Article__implicit_7484 *)_t849.v.p); | |
| if (_t849.cls_id == 81) _t850 = sp_Article__implicit_7995_dom_prefix((sp_Article__implicit_7995 *)_t849.v.p); | |
| if (_t849.cls_id == 82) _t850 = sp_Article__implicit_9355_dom_prefix((sp_Article__implicit_9355 *)_t849.v.p); | |
| if (_t849.cls_id == 83) _t850 = sp_Article__implicit_9372_dom_prefix((sp_Article__implicit_9372 *)_t849.v.p); | |
| } | |
| sp_RbVal _t851 = lv_record; | |
| sp_RbVal _t852 = sp_box_nil(); | |
| if (_t851.tag == SP_TAG_OBJ) { | |
| if (_t851.cls_id == 52) _t852 = ((sp_ActiveRecord_Base *)_t851.v.p)->iv_id; | |
| if (_t851.cls_id == 65) _t852 = ((sp_ApplicationRecord *)_t851.v.p)->iv_id; | |
| if (_t851.cls_id == 66) _t852 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t851.v.p)); | |
| if (_t851.cls_id == 67) _t852 = sp_Comment_id((sp_Comment *)_t851.v.p); | |
| if (_t851.cls_id == 68) _t852 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t851.v.p)); | |
| if (_t851.cls_id == 78) _t852 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t851.v.p); | |
| if (_t851.cls_id == 79) _t852 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t851.v.p); | |
| if (_t851.cls_id == 80) _t852 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t851.v.p); | |
| if (_t851.cls_id == 81) _t852 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t851.v.p); | |
| if (_t851.cls_id == 82) _t852 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t851.v.p); | |
| if (_t851.cls_id == 83) _t852 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t851.v.p); | |
| } | |
| const char *_t853 = _t850; | |
| SP_GC_ROOT(_t853); | |
| const char *_t854 = sp_poly_to_s(_t852); | |
| SP_GC_ROOT(_t854); | |
| return sp_sprintf("%s_%s", _t853, _t854); | |
| } else { | |
| #line 121 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| sp_RbVal _t855 = lv_record; | |
| const char * _t856 = (&("\xff")[1]); | |
| if (_t855.tag == SP_TAG_OBJ) { | |
| if (_t855.cls_id == 52) _t856 = sp_ActiveRecord_Base_dom_prefix((sp_ActiveRecord_Base *)_t855.v.p); | |
| if (_t855.cls_id == 65) _t856 = sp_ActiveRecord_Base_dom_prefix((sp_ActiveRecord_Base *)_t855.v.p); | |
| if (_t855.cls_id == 67) _t856 = sp_Comment_dom_prefix((sp_Comment *)_t855.v.p); | |
| if (_t855.cls_id == 78) _t856 = sp_Article__implicit_6872_dom_prefix((sp_Article__implicit_6872 *)_t855.v.p); | |
| if (_t855.cls_id == 79) _t856 = sp_Article__implicit_6906_dom_prefix((sp_Article__implicit_6906 *)_t855.v.p); | |
| if (_t855.cls_id == 80) _t856 = sp_Article__implicit_7484_dom_prefix((sp_Article__implicit_7484 *)_t855.v.p); | |
| if (_t855.cls_id == 81) _t856 = sp_Article__implicit_7995_dom_prefix((sp_Article__implicit_7995 *)_t855.v.p); | |
| if (_t855.cls_id == 82) _t856 = sp_Article__implicit_9355_dom_prefix((sp_Article__implicit_9355 *)_t855.v.p); | |
| if (_t855.cls_id == 83) _t856 = sp_Article__implicit_9372_dom_prefix((sp_Article__implicit_9372 *)_t855.v.p); | |
| } | |
| sp_RbVal _t857 = lv_record; | |
| sp_RbVal _t858 = sp_box_nil(); | |
| if (_t857.tag == SP_TAG_OBJ) { | |
| if (_t857.cls_id == 52) _t858 = ((sp_ActiveRecord_Base *)_t857.v.p)->iv_id; | |
| if (_t857.cls_id == 65) _t858 = ((sp_ApplicationRecord *)_t857.v.p)->iv_id; | |
| if (_t857.cls_id == 66) _t858 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t857.v.p)); | |
| if (_t857.cls_id == 67) _t858 = sp_Comment_id((sp_Comment *)_t857.v.p); | |
| if (_t857.cls_id == 68) _t858 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t857.v.p)); | |
| if (_t857.cls_id == 78) _t858 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t857.v.p); | |
| if (_t857.cls_id == 79) _t858 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t857.v.p); | |
| if (_t857.cls_id == 80) _t858 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t857.v.p); | |
| if (_t857.cls_id == 81) _t858 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t857.v.p); | |
| if (_t857.cls_id == 82) _t858 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t857.v.p); | |
| if (_t857.cls_id == 83) _t858 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t857.v.p); | |
| } | |
| const char *_t859 = _t856; | |
| SP_GC_ROOT(_t859); | |
| const char *_t860 = sp_poly_to_s(_t858); | |
| SP_GC_ROOT(_t860); | |
| return sp_sprintf("%s_%s_%s", sp_poly_to_s(lv_suffix), _t859, _t860); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_link_to(mrb_int lv_text, mrb_int lv_href, sp_StrIntHash * lv_opts) { | |
| (void)lv_text; | |
| (void)lv_href; | |
| (void)lv_opts; | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_ActionView_ViewHelpers_cls_button_to(mrb_int lv_text, mrb_int lv_href, sp_StrIntHash * lv_opts) { | |
| (void)lv_text; | |
| (void)lv_href; | |
| (void)lv_opts; | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_csrf_meta_tags(void) { | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_csp_meta_tag(void) { | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_stylesheet_link_tag(const char * lv_name, sp_SymStrHash * lv_opts) { | |
| (void)lv_name; | |
| (void)lv_opts; | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_ActionView_ViewHelpers_cls_javascript_importmap_tags(sp_RbVal lv_pins, const char * lv_entry) { | |
| (void)lv_pins; | |
| (void)lv_entry; | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_turbo_stream_from(sp_RbVal lv_stream) { | |
| SP_GC_SAVE(); | |
| const char * lv_encoded = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_encoded); | |
| SP_GC_ROOT_RBVAL(lv_stream); | |
| #line 263 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| lv_encoded = sp_Base64_cls_strict_encode64(sp_json_val(lv_stream)); | |
| #line 264 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| return sp_sprintf("<turbo-cable-stream-source channel=\"Turbo::StreamsChannel\" signed-stream-name=\"%s--unsigned\"></turbo-cable-stream-source>", lv_encoded); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(void) { | |
| SP_GC_SAVE(); | |
| #line 280 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| return (&("\xff" "<input type=\"hidden\" name=\"authenticity_token\" value=\"\">")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_method_override_input(sp_sym lv_method) { | |
| SP_GC_SAVE(); | |
| const char * lv_method_str = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_method_str); | |
| #line 290 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| lv_method_str = sp_sym_to_s(lv_method); | |
| #line 291 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| if ((sp_str_eq(lv_method_str, (&("\xff" "get")[1])) || sp_str_eq(lv_method_str, (&("\xff" "post")[1])))) { | |
| #line 292 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| return (&("\xff" "")[1]); | |
| } else { | |
| #line 294 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| return sp_sprintf("<input type=\"hidden\" name=\"_method\" value=\"%s\">", lv_method_str); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_optional_value_attr(sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| #line 305 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| const char * _t861 = sp_poly_to_s(lv_value); | |
| SP_GC_ROOT(_t861); | |
| if ((sp_poly_nil_p(lv_value) || (strlen(_t861) == 0))) { | |
| #line 306 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| return (&("\xff" "")[1]); | |
| } else { | |
| #line 308 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| return sp_sprintf(" value=\"%s\"", sp_ActionView_ViewHelpers_cls_html_escape(sp_poly_to_s(lv_value))); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_ActionView_ViewHelpers_cls_escape_or_empty(sp_RbVal lv_value) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_value); | |
| #line 320 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| if (sp_poly_nil_p(lv_value)) { | |
| #line 321 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| return (&("\xff" "")[1]); | |
| } else { | |
| #line 323 "test/models/../../runtime/action_controller/../action_view/view_helpers.rb" | |
| return sp_ActionView_ViewHelpers_cls_html_escape(sp_poly_to_s(lv_value)); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_ActionView_ViewHelpers_cls_render_attrs(sp_StrPolyHash * lv_attrs) { | |
| (void)lv_attrs; | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_JsonBuilder_cls_encode_string(const char * lv_s) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_s); | |
| SP_GC_ROOT(lv_s); | |
| #line 50 "test/models/../../runtime/json_builder.rb" | |
| return sp_re_gsub_str_str_hash((sp_re_pat_err_1 ? (sp_raise_cls("RegexpError", sp_re_pat_err_1), (mrb_regexp_pattern *)NULL) : sp_re_pat_1), lv_s, cst_JsonBuilder_ESCAPES); | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_JsonBuilder_cls_encode_value(sp_RbVal lv_v) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT_RBVAL(lv_v); | |
| #line 57 "test/models/../../runtime/json_builder.rb" | |
| if (sp_poly_nil_p(lv_v)) { | |
| const char * _t862 = (&("\xff" "null")[1]); | |
| SP_GC_RESTORE(); | |
| return _t862; | |
| } | |
| #line 58 "test/models/../../runtime/json_builder.rb" | |
| sp_RbVal _t863 = lv_v; | |
| if ((_t863.tag == SP_TAG_BOOL && _t863.v.b)) { | |
| const char * _t864 = (&("\xff" "true")[1]); | |
| SP_GC_RESTORE(); | |
| return _t864; | |
| } | |
| #line 59 "test/models/../../runtime/json_builder.rb" | |
| sp_RbVal _t865 = lv_v; | |
| if ((_t865.tag == SP_TAG_BOOL && !_t865.v.b)) { | |
| const char * _t866 = (&("\xff" "false")[1]); | |
| SP_GC_RESTORE(); | |
| return _t866; | |
| } | |
| #line 60 "test/models/../../runtime/json_builder.rb" | |
| sp_RbVal _t867 = lv_v; | |
| if ((_t867.tag == SP_TAG_INT)) { | |
| const char * _t868 = sp_int_to_s((lv_v).v.i); | |
| SP_GC_RESTORE(); | |
| return _t868; | |
| } | |
| #line 61 "test/models/../../runtime/json_builder.rb" | |
| sp_RbVal _t869 = lv_v; | |
| if ((_t869.tag == SP_TAG_FLT)) { | |
| const char * _t870 = sp_float_to_s((lv_v).v.f); | |
| SP_GC_RESTORE(); | |
| return _t870; | |
| } | |
| #line 62 "test/models/../../runtime/json_builder.rb" | |
| sp_RbVal _t871 = lv_v; | |
| if ((_t871.tag == SP_TAG_STR)) { | |
| const char * _t872 = sp_sprintf("\"%s\"", sp_JsonBuilder_cls_encode_string((lv_v).v.s)); | |
| SP_GC_RESTORE(); | |
| return _t872; | |
| } | |
| #line 65 "test/models/../../runtime/json_builder.rb" | |
| return sp_sprintf("\"%s\"", sp_JsonBuilder_cls_encode_string(sp_poly_to_s(lv_v))); | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_JsonBuilder_cls_encode_datetime(sp_RbVal lv_s) { | |
| SP_GC_SAVE(); | |
| const char * lv_str = (&("\xff")[1]); | |
| const char * lv_date = (&("\xff")[1]); | |
| const char * lv_time = (&("\xff")[1]); | |
| const char * lv_ms = (&("\xff")[1]); | |
| const char * lv_frac = (&("\xff")[1]); | |
| const char * lv_padded = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_str); | |
| SP_GC_ROOT(lv_date); | |
| SP_GC_ROOT(lv_time); | |
| SP_GC_ROOT(lv_ms); | |
| SP_GC_ROOT(lv_frac); | |
| SP_GC_ROOT(lv_padded); | |
| SP_GC_ROOT_RBVAL(lv_s); | |
| #line 80 "test/models/../../runtime/json_builder.rb" | |
| if (sp_poly_nil_p(lv_s)) { | |
| const char * _t873 = (&("\xff" "null")[1]); | |
| SP_GC_RESTORE(); | |
| return _t873; | |
| } | |
| #line 81 "test/models/../../runtime/json_builder.rb" | |
| lv_str = sp_poly_to_s(lv_s); | |
| #line 82 "test/models/../../runtime/json_builder.rb" | |
| if ((sp_str_length(lv_str) < 19LL)) { | |
| const char * _t874 = sp_sprintf("\"%s\"", sp_JsonBuilder_cls_encode_string((const char *)lv_str)); | |
| SP_GC_RESTORE(); | |
| return _t874; | |
| } | |
| #line 83 "test/models/../../runtime/json_builder.rb" | |
| lv_date = sp_str_sub_range(lv_str, 0LL, 10LL); | |
| #line 84 "test/models/../../runtime/json_builder.rb" | |
| lv_time = sp_str_sub_range(lv_str, 11LL, 8LL); | |
| #line 85 "test/models/../../runtime/json_builder.rb" | |
| lv_ms = (&("\xff" "000")[1]); | |
| #line 86 "test/models/../../runtime/json_builder.rb" | |
| mrb_bool _t875 = (sp_str_length(lv_str) > 20LL); | |
| mrb_bool _t876 = FALSE; | |
| if (_t875) { | |
| _t876 = sp_str_eq(sp_str_sub_range(lv_str, 19LL, 1LL), (&("\xff" ".")[1])); | |
| } else { | |
| _t876 = _t875; | |
| } | |
| if (_t876) { | |
| #line 94 "test/models/../../runtime/json_builder.rb" | |
| lv_frac = sp_str_sub_range_r(lv_str, 20LL, -1, 0); | |
| #line 95 "test/models/../../runtime/json_builder.rb" | |
| lv_padded = sp_sprintf("%s000", lv_frac); | |
| #line 96 "test/models/../../runtime/json_builder.rb" | |
| lv_ms = sp_str_sub_range(lv_padded, 0LL, 3LL); | |
| } | |
| #line 98 "test/models/../../runtime/json_builder.rb" | |
| return sp_sprintf("\"%sT%s.%sZ\"", lv_date, lv_time, lv_ms); | |
| return (&("\xff")[1]); | |
| } | |
| static inline sp_PolyArray * sp_Broadcasts_cls_reset_log_bang(void) { | |
| return NULL; | |
| } | |
| static inline sp_PolyArray * sp_Broadcasts_cls_log(void) { | |
| return NULL; | |
| } | |
| static inline sp_IntArray * sp_Broadcasts_cls_set_transport(mrb_int lv_transport) { | |
| SP_GC_SAVE(); | |
| #line 42 "test/models/../../runtime/broadcasts.rb" | |
| cst_Broadcasts_TRANSPORTS->len = 0; cst_Broadcasts_TRANSPORTS->start = 0; | |
| #line 43 "test/models/../../runtime/broadcasts.rb" | |
| sp_IntArray_push(cst_Broadcasts_TRANSPORTS, lv_transport); | |
| return NULL; | |
| return NULL; | |
| } | |
| static inline mrb_int sp_Broadcasts_cls_append(const char * lv_stream, const char * lv_target, sp_String * lv_html) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_html); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_html); | |
| #line 47 "test/models/../../runtime/broadcasts.rb" | |
| return sp_Broadcasts_cls_record(SPS_append, lv_stream, lv_target, ({ sp_String *_t877 = lv_html; _t877 ? sp_box_str(sp_str_dup_external((_t877)->data)) : sp_box_nil(); })); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Broadcasts_cls_prepend(const char * lv_stream, const char * lv_target, sp_String * lv_html) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_html); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_html); | |
| #line 51 "test/models/../../runtime/broadcasts.rb" | |
| return sp_Broadcasts_cls_record(SPS_prepend, lv_stream, lv_target, ({ sp_String *_t878 = lv_html; _t878 ? sp_box_str(sp_str_dup_external((_t878)->data)) : sp_box_nil(); })); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Broadcasts_cls_replace(const char * lv_stream, const char * lv_target, sp_String * lv_html) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_html); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_html); | |
| #line 55 "test/models/../../runtime/broadcasts.rb" | |
| return sp_Broadcasts_cls_record(SPS_replace, lv_stream, lv_target, ({ sp_String *_t879 = lv_html; _t879 ? sp_box_str(sp_str_dup_external((_t879)->data)) : sp_box_nil(); })); | |
| return 0; | |
| } | |
| static inline mrb_int sp_Broadcasts_cls_remove(const char * lv_stream, const char * lv_target) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| #line 59 "test/models/../../runtime/broadcasts.rb" | |
| return sp_Broadcasts_cls_record(SPS_remove, lv_stream, lv_target, sp_box_str((&("\xff" "")[1]))); | |
| return 0; | |
| } | |
| static mrb_int sp_Broadcasts_cls_record(sp_sym lv_action, const char * lv_stream, const char * lv_target, sp_RbVal lv_html) { | |
| SP_GC_SAVE(); | |
| sp_SymPolyHash * lv_entry = NULL; | |
| const char * lv_fragment = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_entry); | |
| SP_GC_ROOT(lv_fragment); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT_RBVAL(lv_html); | |
| SP_GC_ROOT(lv_stream); | |
| SP_GC_ROOT(lv_target); | |
| #line 63 "test/models/../../runtime/broadcasts.rb" | |
| sp_SymPolyHash *_t880 = sp_SymPolyHash_new(); | |
| sp_SymPolyHash_set(_t880, SPS_action, sp_box_sym(lv_action)); | |
| sp_SymPolyHash_set(_t880, SPS_stream, sp_box_str(lv_stream)); | |
| sp_SymPolyHash_set(_t880, SPS_target, sp_box_str(lv_target)); | |
| sp_SymPolyHash_set(_t880, SPS_html, lv_html); | |
| lv_entry = _t880; | |
| #line 64 "test/models/../../runtime/broadcasts.rb" | |
| sp_PolyArray_push(cst_Broadcasts_LOG, sp_box_obj((void *)(lv_entry), SP_BUILTIN_SYM_POLY_HASH)); | |
| #line 65 "test/models/../../runtime/broadcasts.rb" | |
| if ((sp_IntArray_length(cst_Broadcasts_TRANSPORTS) > 0LL)) { | |
| #line 66 "test/models/../../runtime/broadcasts.rb" | |
| lv_fragment = sp_Broadcasts_cls_render_fragment(lv_action, lv_target, lv_html); | |
| #line 67 "test/models/../../runtime/broadcasts.rb" | |
| } | |
| #line 69 "test/models/../../runtime/broadcasts.rb" | |
| return 0; | |
| return 0; | |
| } | |
| static inline const char * sp_Broadcasts_cls_render_fragment(sp_sym lv_action, const char * lv_target, sp_RbVal lv_html) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_target); | |
| SP_GC_ROOT_RBVAL(lv_html); | |
| SP_GC_ROOT(lv_target); | |
| #line 76 "test/models/../../runtime/broadcasts.rb" | |
| if ((lv_action == SPS_remove)) { | |
| #line 77 "test/models/../../runtime/broadcasts.rb" | |
| return sp_sprintf("<turbo-stream action=\"remove\" target=\"%s\"></turbo-stream>", lv_target); | |
| } else { | |
| #line 79 "test/models/../../runtime/broadcasts.rb" | |
| return sp_sprintf("<turbo-stream action=\"%s\" target=\"%s\"><template>%s</template></turbo-stream>", sp_sym_to_s(lv_action), lv_target, sp_poly_to_s(lv_html)); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static inline sp_PolyArray * sp_Importmap_cls_pins(void) { | |
| return NULL; | |
| } | |
| static inline const char * sp_Importmap_cls_entry(void) { | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_root_path(void) { | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_articles_path(void) { | |
| SP_GC_SAVE(); | |
| #line 7 "test/models/../../config/../app/controllers/../models/../views/comments/../../route_helpers.rb" | |
| return (&("\xff" "/articles")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_new_article_path(void) { | |
| SP_GC_SAVE(); | |
| #line 11 "test/models/../../config/../app/controllers/../models/../views/comments/../../route_helpers.rb" | |
| return (&("\xff" "/articles/new")[1]); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_article_path(mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| #line 15 "test/models/../../config/../app/controllers/../models/../views/comments/../../route_helpers.rb" | |
| return sp_sprintf("/articles/%lld", (long long)lv_id); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_edit_article_path(mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| #line 19 "test/models/../../config/../app/controllers/../models/../views/comments/../../route_helpers.rb" | |
| return sp_sprintf("/articles/%lld/edit", (long long)lv_id); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_article_comments_path(mrb_int lv_article_id) { | |
| SP_GC_SAVE(); | |
| #line 23 "test/models/../../config/../app/controllers/../models/../views/comments/../../route_helpers.rb" | |
| return sp_sprintf("/articles/%lld/comments", (long long)lv_article_id); | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_RouteHelpers_cls_article_comment_path(mrb_int lv_article_id, mrb_int lv_id) { | |
| SP_GC_SAVE(); | |
| #line 27 "test/models/../../config/../app/controllers/../models/../views/comments/../../route_helpers.rb" | |
| return sp_sprintf("/articles/%lld/comments/%lld", (long long)lv_article_id, (long long)lv_id); | |
| return (&("\xff")[1]); | |
| } | |
| static inline sp_String * sp_Views_Comments_cls_comment(sp_Comment * lv_comment, sp_String * lv_notice, sp_String * lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT(lv_comment); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| SP_GC_ROOT(lv_comment); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| #line 6 "test/models/../../config/../app/controllers/../models/../views/comments/_comment.rb" | |
| lv_io = sp_String_new(""); | |
| #line 7 "test/models/../../config/../app/controllers/../models/../views/comments/_comment.rb" | |
| const char *_t881 = sp_ActionView_ViewHelpers_cls_dom_id(sp_box_obj(lv_comment, 67), ((void)(0), sp_box_nil())); | |
| SP_GC_ROOT(_t881); | |
| const char *_t882 = sp_ActionView_ViewHelpers_cls_html_escape(lv_comment->iv_commenter); | |
| SP_GC_ROOT(_t882); | |
| const char *_t883 = sp_ActionView_ViewHelpers_cls_html_escape(lv_comment->iv_body); | |
| SP_GC_ROOT(_t883); | |
| const char *_t884 = sp_ActionView_ViewHelpers_cls_html_escape(sp_RouteHelpers_cls_article_comment_path(lv_comment->iv_article_id, (lv_comment->iv_id).v.i)); | |
| SP_GC_ROOT(_t884); | |
| const char *_t885 = sp_ActionView_ViewHelpers_cls_method_override_input(SPS_delete); | |
| SP_GC_ROOT(_t885); | |
| const char *_t886 = sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(); | |
| SP_GC_ROOT(_t886); | |
| sp_String_append(lv_io, sp_sprintf("<div id=\"%s\" class=\"p-4 bg-gray-50 rounded\">\n <p class=\"font-semibold\">%s</p>\n <p class=\"text-gray-700\">%s</p>\n <form action=\"%s\" method=\"post\" class=\"%s\">%s<button type=\"submit\" class=\"%s\" data-turbo-confirm=\"%s\">%s</button>%s</form>\n</div>\n", _t881, _t882, _t883, _t884, (&("\xff" "button_to")[1]), _t885, (&("\xff" "text-red-600 text-sm mt-2")[1]), (&("\xff" "Are you sure?")[1]), (&("\xff" "Delete")[1]), _t886)); | |
| #line 8 "test/models/../../config/../app/controllers/../models/../views/comments/_comment.rb" | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static inline const char * sp_Inflector_cls_pluralize(mrb_int lv_count, const char * lv_word) { | |
| SP_GC_SAVE(); | |
| SP_GC_ROOT(lv_word); | |
| SP_GC_ROOT(lv_word); | |
| #line 3 "test/models/../../config/../app/controllers/../models/../views/articles/../../../runtime/inflector.rb" | |
| if ((lv_count == 1LL)) { | |
| return sp_sprintf("1 %s", lv_word); | |
| } else { | |
| return sp_sprintf("%lld %ss", (long long)lv_count, lv_word); | |
| } | |
| return (&("\xff")[1]); | |
| } | |
| static inline sp_String * sp_Views_Articles_cls_article(sp_RbVal lv_article, sp_String * lv_notice, sp_String * lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT_RBVAL(lv_article); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| #line 7 "test/models/../../config/../app/controllers/../models/../views/articles/_article.rb" | |
| lv_io = sp_String_new(""); | |
| #line 8 "test/models/../../config/../app/controllers/../models/../views/articles/_article.rb" | |
| sp_RbVal _t887 = lv_article; | |
| sp_RbVal _t888 = sp_box_nil(); | |
| if (_t887.tag == SP_TAG_OBJ) { | |
| if (_t887.cls_id == 52) _t888 = ((sp_ActiveRecord_Base *)_t887.v.p)->iv_id; | |
| if (_t887.cls_id == 65) _t888 = ((sp_ApplicationRecord *)_t887.v.p)->iv_id; | |
| if (_t887.cls_id == 66) _t888 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t887.v.p)); | |
| if (_t887.cls_id == 67) _t888 = sp_Comment_id((sp_Comment *)_t887.v.p); | |
| if (_t887.cls_id == 68) _t888 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t887.v.p)); | |
| if (_t887.cls_id == 78) _t888 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t887.v.p); | |
| if (_t887.cls_id == 79) _t888 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t887.v.p); | |
| if (_t887.cls_id == 80) _t888 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t887.v.p); | |
| if (_t887.cls_id == 81) _t888 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t887.v.p); | |
| if (_t887.cls_id == 82) _t888 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t887.v.p); | |
| if (_t887.cls_id == 83) _t888 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t887.v.p); | |
| } | |
| sp_RbVal _t889 = lv_article; | |
| sp_RbVal _t890 = sp_box_nil(); | |
| if (_t889.tag == SP_TAG_OBJ) { | |
| if (_t889.cls_id == 68) _t890 = sp_box_str(sp_ArticleRow_title((sp_ArticleRow *)_t889.v.p)); | |
| if (_t889.cls_id == 70) _t890 = sp_ArticleParams_title((sp_ArticleParams *)_t889.v.p); | |
| if (_t889.cls_id == 78) _t890 = sp_Article__implicit_6872_title((sp_Article__implicit_6872 *)_t889.v.p); | |
| if (_t889.cls_id == 79) _t890 = sp_Article__implicit_6906_title((sp_Article__implicit_6906 *)_t889.v.p); | |
| if (_t889.cls_id == 80) _t890 = sp_Article__implicit_7484_title((sp_Article__implicit_7484 *)_t889.v.p); | |
| if (_t889.cls_id == 81) _t890 = sp_Article__implicit_7995_title((sp_Article__implicit_7995 *)_t889.v.p); | |
| if (_t889.cls_id == 82) _t890 = sp_Article__implicit_9355_title((sp_Article__implicit_9355 *)_t889.v.p); | |
| if (_t889.cls_id == 83) _t890 = sp_Article__implicit_9372_title((sp_Article__implicit_9372 *)_t889.v.p); | |
| } | |
| sp_RbVal _t891 = lv_article; | |
| sp_RbVal _t892 = sp_box_nil(); | |
| if (_t891.tag == SP_TAG_OBJ) { | |
| if (_t891.cls_id == 78) _t892 = sp_Article__implicit_6872_comments((sp_Article__implicit_6872 *)_t891.v.p); | |
| if (_t891.cls_id == 79) _t892 = sp_Article__implicit_6906_comments((sp_Article__implicit_6906 *)_t891.v.p); | |
| if (_t891.cls_id == 80) _t892 = sp_Article__implicit_7484_comments((sp_Article__implicit_7484 *)_t891.v.p); | |
| if (_t891.cls_id == 81) _t892 = sp_Article__implicit_7995_comments((sp_Article__implicit_7995 *)_t891.v.p); | |
| if (_t891.cls_id == 82) _t892 = sp_Article__implicit_9355_comments((sp_Article__implicit_9355 *)_t891.v.p); | |
| if (_t891.cls_id == 83) _t892 = sp_Article__implicit_9372_comments((sp_Article__implicit_9372 *)_t891.v.p); | |
| } | |
| sp_RbVal _t893 = _t892; | |
| mrb_int _t894 = 0; | |
| if (_t893.tag == SP_TAG_STR) _t894 = sp_str_length(_t893.v.s); | |
| if (_t893.tag == SP_TAG_OBJ) { | |
| if (_t893.cls_id == 51) _t894 = ((sp_ActiveRecord_ConnectionAdapters_ConnectionPool *)_t893.v.p)->iv_size; | |
| if (_t893.cls_id == 55) _t894 = sp_ActionDispatch_Flash_size((sp_ActionDispatch_Flash *)_t893.v.p); | |
| if (_t893.cls_id == 56) _t894 = sp_ActionDispatch_Session_size((sp_ActionDispatch_Session *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_INT_ARRAY) _t894 = sp_IntArray_length((sp_IntArray *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_FLT_ARRAY) _t894 = sp_FloatArray_length((sp_FloatArray *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_STR_ARRAY) _t894 = sp_StrArray_length((sp_StrArray *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_SYM_ARRAY) _t894 = sp_IntArray_length((sp_IntArray *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_PTR_ARRAY) _t894 = sp_PtrArray_length((sp_PtrArray *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_POLY_ARRAY) _t894 = sp_PolyArray_length((sp_PolyArray *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_STR_INT_HASH) _t894 = sp_StrIntHash_length((sp_StrIntHash *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_STR_STR_HASH) _t894 = sp_StrStrHash_length((sp_StrStrHash *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_INT_STR_HASH) _t894 = sp_IntStrHash_length((sp_IntStrHash *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_STR_POLY_HASH) _t894 = sp_StrPolyHash_length((sp_StrPolyHash *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t894 = sp_SymPolyHash_length((sp_SymPolyHash *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t894 = sp_PolyPolyHash_length((sp_PolyPolyHash *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_INT_ARRAY) _t894 = sp_IntArray_length((sp_IntArray *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_FLT_ARRAY) _t894 = sp_FloatArray_length((sp_FloatArray *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_STR_ARRAY) _t894 = sp_StrArray_length((sp_StrArray *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_SYM_ARRAY) _t894 = sp_IntArray_length((sp_IntArray *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_PTR_ARRAY) _t894 = sp_PtrArray_length((sp_PtrArray *)_t893.v.p); | |
| if (_t893.cls_id == SP_BUILTIN_POLY_ARRAY) _t894 = sp_PolyArray_length((sp_PolyArray *)_t893.v.p); | |
| } | |
| sp_RbVal _t895 = lv_article; | |
| sp_RbVal _t896 = sp_box_nil(); | |
| if (_t895.tag == SP_TAG_OBJ) { | |
| if (_t895.cls_id == 58) _t896 = ((sp_ActionController_Base *)_t895.v.p)->iv_body; | |
| if (_t895.cls_id == 64) _t896 = ((sp_ApplicationController *)_t895.v.p)->iv_body; | |
| if (_t895.cls_id == 66) _t896 = sp_box_str(sp_CommentRow_body((sp_CommentRow *)_t895.v.p)); | |
| if (_t895.cls_id == 67) _t896 = sp_Comment_body((sp_Comment *)_t895.v.p); | |
| if (_t895.cls_id == 68) _t896 = sp_box_str(sp_ArticleRow_body((sp_ArticleRow *)_t895.v.p)); | |
| if (_t895.cls_id == 70) _t896 = sp_ArticleParams_body((sp_ArticleParams *)_t895.v.p); | |
| if (_t895.cls_id == 71) _t896 = ((sp_ArticlesController *)_t895.v.p)->iv_body; | |
| if (_t895.cls_id == 72) _t896 = sp_CommentParams_body((sp_CommentParams *)_t895.v.p); | |
| if (_t895.cls_id == 73) _t896 = ((sp_CommentsController *)_t895.v.p)->iv_body; | |
| if (_t895.cls_id == 74) _t896 = ((sp_ActionResponse *)_t895.v.p)->iv_body; | |
| if (_t895.cls_id == 78) _t896 = sp_Article__implicit_6872_body((sp_Article__implicit_6872 *)_t895.v.p); | |
| if (_t895.cls_id == 79) _t896 = sp_Article__implicit_6906_body((sp_Article__implicit_6906 *)_t895.v.p); | |
| if (_t895.cls_id == 80) _t896 = sp_Article__implicit_7484_body((sp_Article__implicit_7484 *)_t895.v.p); | |
| if (_t895.cls_id == 81) _t896 = sp_Article__implicit_7995_body((sp_Article__implicit_7995 *)_t895.v.p); | |
| if (_t895.cls_id == 82) _t896 = sp_Article__implicit_9355_body((sp_Article__implicit_9355 *)_t895.v.p); | |
| if (_t895.cls_id == 83) _t896 = sp_Article__implicit_9372_body((sp_Article__implicit_9372 *)_t895.v.p); | |
| } | |
| sp_RbVal _t897 = lv_article; | |
| sp_RbVal _t898 = sp_box_nil(); | |
| if (_t897.tag == SP_TAG_OBJ) { | |
| if (_t897.cls_id == 52) _t898 = ((sp_ActiveRecord_Base *)_t897.v.p)->iv_id; | |
| if (_t897.cls_id == 65) _t898 = ((sp_ApplicationRecord *)_t897.v.p)->iv_id; | |
| if (_t897.cls_id == 66) _t898 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t897.v.p)); | |
| if (_t897.cls_id == 67) _t898 = sp_Comment_id((sp_Comment *)_t897.v.p); | |
| if (_t897.cls_id == 68) _t898 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t897.v.p)); | |
| if (_t897.cls_id == 78) _t898 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t897.v.p); | |
| if (_t897.cls_id == 79) _t898 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t897.v.p); | |
| if (_t897.cls_id == 80) _t898 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t897.v.p); | |
| if (_t897.cls_id == 81) _t898 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t897.v.p); | |
| if (_t897.cls_id == 82) _t898 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t897.v.p); | |
| if (_t897.cls_id == 83) _t898 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t897.v.p); | |
| } | |
| sp_RbVal _t899 = lv_article; | |
| sp_RbVal _t900 = sp_box_nil(); | |
| if (_t899.tag == SP_TAG_OBJ) { | |
| if (_t899.cls_id == 52) _t900 = ((sp_ActiveRecord_Base *)_t899.v.p)->iv_id; | |
| if (_t899.cls_id == 65) _t900 = ((sp_ApplicationRecord *)_t899.v.p)->iv_id; | |
| if (_t899.cls_id == 66) _t900 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t899.v.p)); | |
| if (_t899.cls_id == 67) _t900 = sp_Comment_id((sp_Comment *)_t899.v.p); | |
| if (_t899.cls_id == 68) _t900 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t899.v.p)); | |
| if (_t899.cls_id == 78) _t900 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t899.v.p); | |
| if (_t899.cls_id == 79) _t900 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t899.v.p); | |
| if (_t899.cls_id == 80) _t900 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t899.v.p); | |
| if (_t899.cls_id == 81) _t900 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t899.v.p); | |
| if (_t899.cls_id == 82) _t900 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t899.v.p); | |
| if (_t899.cls_id == 83) _t900 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t899.v.p); | |
| } | |
| sp_RbVal _t901 = lv_article; | |
| sp_RbVal _t902 = sp_box_nil(); | |
| if (_t901.tag == SP_TAG_OBJ) { | |
| if (_t901.cls_id == 52) _t902 = ((sp_ActiveRecord_Base *)_t901.v.p)->iv_id; | |
| if (_t901.cls_id == 65) _t902 = ((sp_ApplicationRecord *)_t901.v.p)->iv_id; | |
| if (_t901.cls_id == 66) _t902 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t901.v.p)); | |
| if (_t901.cls_id == 67) _t902 = sp_Comment_id((sp_Comment *)_t901.v.p); | |
| if (_t901.cls_id == 68) _t902 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t901.v.p)); | |
| if (_t901.cls_id == 78) _t902 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t901.v.p); | |
| if (_t901.cls_id == 79) _t902 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t901.v.p); | |
| if (_t901.cls_id == 80) _t902 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t901.v.p); | |
| if (_t901.cls_id == 81) _t902 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t901.v.p); | |
| if (_t901.cls_id == 82) _t902 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t901.v.p); | |
| if (_t901.cls_id == 83) _t902 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t901.v.p); | |
| } | |
| const char *_t903 = sp_ActionView_ViewHelpers_cls_dom_id(lv_article, ((void)(0), sp_box_nil())); | |
| SP_GC_ROOT(_t903); | |
| const char *_t904 = sp_ActionView_ViewHelpers_cls_html_escape(sp_RouteHelpers_cls_article_path((_t888).v.i)); | |
| SP_GC_ROOT(_t904); | |
| const char *_t905 = sp_ActionView_ViewHelpers_cls_html_escape((_t890).v.s); | |
| SP_GC_ROOT(_t905); | |
| const char *_t906 = sp_ActionView_ViewHelpers_cls_dom_id(lv_article, sp_box_sym(SPS_comments_count)); | |
| SP_GC_ROOT(_t906); | |
| const char *_t907 = sp_Inflector_cls_pluralize(_t894, (&("\xff" "comment")[1])); | |
| SP_GC_ROOT(_t907); | |
| const char *_t908 = sp_ActionView_ViewHelpers_cls_html_escape(sp_ActionView_ViewHelpers_cls_truncate((_t896).v.s, 100LL, (&("\xff" "...")[1]))); | |
| SP_GC_ROOT(_t908); | |
| const char *_t909 = sp_ActionView_ViewHelpers_cls_html_escape(sp_RouteHelpers_cls_article_path((_t898).v.i)); | |
| SP_GC_ROOT(_t909); | |
| const char *_t910 = sp_ActionView_ViewHelpers_cls_html_escape(sp_RouteHelpers_cls_edit_article_path((_t900).v.i)); | |
| SP_GC_ROOT(_t910); | |
| const char *_t911 = sp_ActionView_ViewHelpers_cls_html_escape(sp_RouteHelpers_cls_article_path((_t902).v.i)); | |
| SP_GC_ROOT(_t911); | |
| const char *_t912 = sp_ActionView_ViewHelpers_cls_method_override_input(SPS_delete); | |
| SP_GC_ROOT(_t912); | |
| const char *_t913 = sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(); | |
| SP_GC_ROOT(_t913); | |
| sp_String_append(lv_io, sp_sprintf("<div id=\"%s\" class=\"flex flex-col sm:flex-row justify-between items-center pb-5 sm:pb-0\">\n <div class=\"p-4 border rounded mb-4 flex-grow\">\n <h2 class=\"text-xl font-bold\">\n <a href=\"%s\" class=\"%s\">%s</a>\n <span id=\"%s\" class=\"text-gray-500 text-sm font-normal ml-2\">\n (%s)\n </span>\n </h2>\n <p class=\"text-gray-700 mt-2\">%s</p>\n </div>\n <div class=\"w-full sm:w-auto flex flex-col sm:flex-row space-x-2 space-y-2\">\n <a href=\"%s\" class=\"%s\">%s</a>\n <a href=\"%s\" class=\"%s\">%s</a>\n <form action=\"%s\" method=\"post\" class=\"%s\">%s<button type=\"submit\" class=\"%s\" data-turbo-confirm=\"%s\">%s</button>%s</form>\n </div>\n</div>\n", _t903, _t904, (&("\xff" "text-blue-600 hover:underline")[1]), _t905, _t906, _t907, _t908, _t909, (&("\xff" "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Show")[1]), _t910, (&("\xff" "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Edit")[1]), _t911, (&("\xff" "button_to")[1]), _t912, (&("\xff" "w-full sm:w-auto rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer")[1]), (&("\xff" "Are you sure?")[1]), (&("\xff" "Destroy")[1]), _t913)); | |
| #line 9 "test/models/../../config/../app/controllers/../models/../views/articles/_article.rb" | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static sp_String * sp_Views_Articles_cls_form(sp_RbVal lv_article, sp_String * lv_notice, sp_String * lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| sp_sym lv_form_method = ((sp_sym)-1); | |
| const char * lv_error = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT(lv_error); | |
| SP_GC_ROOT_RBVAL(lv_article); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| SP_GC_ROOT(lv_notice); | |
| SP_GC_ROOT(lv_alert); | |
| #line 7 "test/models/../../config/../app/controllers/../models/../views/articles/_form.rb" | |
| lv_io = sp_String_new(""); | |
| #line 8 "test/models/../../config/../app/controllers/../models/../views/articles/_form.rb" | |
| sp_RbVal _t914 = lv_article; | |
| mrb_bool _t915 = FALSE; | |
| if (_t914.tag == SP_TAG_OBJ) { | |
| if (_t914.cls_id == 52) _t915 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t914.v.p); | |
| if (_t914.cls_id == 65) _t915 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t914.v.p); | |
| if (_t914.cls_id == 67) _t915 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t914.v.p); | |
| if (_t914.cls_id == 78) _t915 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t914.v.p); | |
| if (_t914.cls_id == 79) _t915 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t914.v.p); | |
| if (_t914.cls_id == 80) _t915 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t914.v.p); | |
| if (_t914.cls_id == 81) _t915 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t914.v.p); | |
| if (_t914.cls_id == 82) _t915 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t914.v.p); | |
| if (_t914.cls_id == 83) _t915 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t914.v.p); | |
| } | |
| lv_form_method = (_t915 ? SPS_patch : SPS_post); | |
| #line 13 "test/models/../../config/../app/controllers/../models/../views/articles/_form.rb" | |
| sp_RbVal _t916 = lv_article; | |
| mrb_bool _t917 = FALSE; | |
| if (_t916.tag == SP_TAG_OBJ) { | |
| if (_t916.cls_id == 52) _t917 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t916.v.p); | |
| if (_t916.cls_id == 65) _t917 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t916.v.p); | |
| if (_t916.cls_id == 67) _t917 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t916.v.p); | |
| if (_t916.cls_id == 78) _t917 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t916.v.p); | |
| if (_t916.cls_id == 79) _t917 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t916.v.p); | |
| if (_t916.cls_id == 80) _t917 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t916.v.p); | |
| if (_t916.cls_id == 81) _t917 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t916.v.p); | |
| if (_t916.cls_id == 82) _t917 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t916.v.p); | |
| if (_t916.cls_id == 83) _t917 = sp_ActiveRecord_Base_persisted_p((sp_ActiveRecord_Base *)_t916.v.p); | |
| } | |
| sp_RbVal _t918 = lv_article; | |
| sp_RbVal _t919 = sp_box_nil(); | |
| if (_t918.tag == SP_TAG_OBJ) { | |
| if (_t918.cls_id == 52) _t919 = ((sp_ActiveRecord_Base *)_t918.v.p)->iv_id; | |
| if (_t918.cls_id == 65) _t919 = ((sp_ApplicationRecord *)_t918.v.p)->iv_id; | |
| if (_t918.cls_id == 66) _t919 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t918.v.p)); | |
| if (_t918.cls_id == 67) _t919 = sp_Comment_id((sp_Comment *)_t918.v.p); | |
| if (_t918.cls_id == 68) _t919 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t918.v.p)); | |
| if (_t918.cls_id == 78) _t919 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t918.v.p); | |
| if (_t918.cls_id == 79) _t919 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t918.v.p); | |
| if (_t918.cls_id == 80) _t919 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t918.v.p); | |
| if (_t918.cls_id == 81) _t919 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t918.v.p); | |
| if (_t918.cls_id == 82) _t919 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t918.v.p); | |
| if (_t918.cls_id == 83) _t919 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t918.v.p); | |
| } | |
| const char *_t920 = sp_ActionView_ViewHelpers_cls_html_escape((_t917 ? sp_RouteHelpers_cls_article_path((_t919).v.i) : sp_RouteHelpers_cls_articles_path())); | |
| SP_GC_ROOT(_t920); | |
| const char *_t921 = sp_ActionView_ViewHelpers_cls_method_override_input(lv_form_method); | |
| SP_GC_ROOT(_t921); | |
| const char *_t922 = sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(); | |
| SP_GC_ROOT(_t922); | |
| sp_String_append(lv_io, sp_sprintf("<form action=\"%s\" accept-charset=\"UTF-8\" method=\"post\" class=\"%s\">%s%s\n", _t920, (&("\xff" "contents")[1]), _t921, _t922)); | |
| #line 18 "test/models/../../config/../app/controllers/../models/../views/articles/_form.rb" | |
| sp_RbVal _t923 = lv_article; | |
| sp_StrArray * _t924 = NULL; | |
| if (_t923.tag == SP_TAG_OBJ) { | |
| if (_t923.cls_id == 52) _t924 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t923.v.p); | |
| if (_t923.cls_id == 65) _t924 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t923.v.p); | |
| if (_t923.cls_id == 67) _t924 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t923.v.p); | |
| if (_t923.cls_id == 78) _t924 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t923.v.p); | |
| if (_t923.cls_id == 79) _t924 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t923.v.p); | |
| if (_t923.cls_id == 80) _t924 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t923.v.p); | |
| if (_t923.cls_id == 81) _t924 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t923.v.p); | |
| if (_t923.cls_id == 82) _t924 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t923.v.p); | |
| if (_t923.cls_id == 83) _t924 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t923.v.p); | |
| } | |
| sp_StrArray * _t925 = _t924; | |
| SP_GC_ROOT(_t925); | |
| if ((!sp_StrArray_empty(_t925))) { | |
| #line 19 "test/models/../../config/../app/controllers/../models/../views/articles/_form.rb" | |
| sp_RbVal _t926 = lv_article; | |
| sp_StrArray * _t927 = NULL; | |
| if (_t926.tag == SP_TAG_OBJ) { | |
| if (_t926.cls_id == 52) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 65) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 67) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 78) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 79) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 80) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 81) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 82) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| if (_t926.cls_id == 83) _t927 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t926.v.p); | |
| } | |
| sp_StrArray * _t928 = _t927; | |
| SP_GC_ROOT(_t928); | |
| sp_String_append(lv_io, sp_sprintf(" <div id=\"error_explanation\" class=\"bg-red-50 text-red-500 px-3 py-2 font-medium rounded-md mt-3\">\n <h2>%s prohibited this article from being saved:</h2>\n\n <ul class=\"list-disc ml-6\">\n ", sp_Inflector_cls_pluralize(sp_StrArray_length(_t928), (&("\xff" "error")[1])))); | |
| #line 20 "test/models/../../config/../app/controllers/../models/../views/articles/_form.rb" | |
| sp_RbVal _t929 = lv_article; | |
| sp_StrArray * _t930 = NULL; | |
| if (_t929.tag == SP_TAG_OBJ) { | |
| if (_t929.cls_id == 52) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 65) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 67) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 78) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 79) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 80) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 81) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 82) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| if (_t929.cls_id == 83) _t930 = sp_ActiveRecord_Base_errors((sp_ActiveRecord_Base *)_t929.v.p); | |
| } | |
| sp_StrArray * _t931 = _t930; | |
| SP_GC_ROOT(_t931); | |
| for (mrb_int _t932 = 0; _t932 < sp_StrArray_length(_t931); _t932++) { | |
| const char * lv_error = sp_StrArray_get(_t931, _t932); | |
| sp_redo_35: ; | |
| sp_String_append(lv_io, sp_sprintf("\n <li>%s</li>\n ", sp_ActionView_ViewHelpers_cls_html_escape((const char *)lv_error))); | |
| } | |
| #line 21 "test/models/../../config/../app/controllers/../models/../views/articles/_form.rb" | |
| sp_String_append(lv_io, (&("\xff" "\n </ul>\n </div>\n")[1])); | |
| } | |
| #line 23 "test/models/../../config/../app/controllers/../models/../views/articles/_form.rb" | |
| sp_RbVal _t933 = lv_article; | |
| sp_RbVal _t934 = sp_box_nil(); | |
| if (_t933.tag == SP_TAG_OBJ) { | |
| if (_t933.cls_id == 52) _t934 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t933.v.p, SPS_title); | |
| if (_t933.cls_id == 55) _t934 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t933.v.p, sp_box_sym(SPS_title))); | |
| if (_t933.cls_id == 56) _t934 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t933.v.p, sp_box_sym(SPS_title)); | |
| if (_t933.cls_id == 65) _t934 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t933.v.p, SPS_title); | |
| if (_t933.cls_id == 67) _t934 = sp_Comment__aref((sp_Comment *)_t933.v.p, SPS_title); | |
| if (_t933.cls_id == 78) _t934 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t933.v.p, sp_box_sym(SPS_title)); | |
| if (_t933.cls_id == 79) _t934 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t933.v.p, sp_box_sym(SPS_title)); | |
| if (_t933.cls_id == 80) _t934 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t933.v.p, sp_box_sym(SPS_title)); | |
| if (_t933.cls_id == 81) _t934 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t933.v.p, sp_box_sym(SPS_title)); | |
| if (_t933.cls_id == 82) _t934 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t933.v.p, sp_box_sym(SPS_title)); | |
| if (_t933.cls_id == 83) _t934 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t933.v.p, sp_box_sym(SPS_title)); | |
| if (_t933.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t934 = sp_SymPolyHash_get((sp_SymPolyHash *)_t933.v.p, SPS_title); | |
| if (_t933.cls_id == SP_BUILTIN_SYM_INT_HASH) _t934 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t933.v.p, SPS_title)); | |
| if (_t933.cls_id == SP_BUILTIN_SYM_STR_HASH) _t934 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t933.v.p, SPS_title)); | |
| } | |
| sp_RbVal _t935 = lv_article; | |
| sp_RbVal _t936 = sp_box_nil(); | |
| if (_t935.tag == SP_TAG_OBJ) { | |
| if (_t935.cls_id == 52) _t936 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t935.v.p, SPS_body); | |
| if (_t935.cls_id == 55) _t936 = sp_box_nullable_str(sp_ActionDispatch_Flash__aref((sp_ActionDispatch_Flash *)_t935.v.p, sp_box_sym(SPS_body))); | |
| if (_t935.cls_id == 56) _t936 = sp_ActionDispatch_Session__aref((sp_ActionDispatch_Session *)_t935.v.p, sp_box_sym(SPS_body)); | |
| if (_t935.cls_id == 65) _t936 = sp_ActiveRecord_Base__aref((sp_ActiveRecord_Base *)_t935.v.p, SPS_body); | |
| if (_t935.cls_id == 67) _t936 = sp_Comment__aref((sp_Comment *)_t935.v.p, SPS_body); | |
| if (_t935.cls_id == 78) _t936 = sp_Article__implicit_6872__aref((sp_Article__implicit_6872 *)_t935.v.p, sp_box_sym(SPS_body)); | |
| if (_t935.cls_id == 79) _t936 = sp_Article__implicit_6906__aref((sp_Article__implicit_6906 *)_t935.v.p, sp_box_sym(SPS_body)); | |
| if (_t935.cls_id == 80) _t936 = sp_Article__implicit_7484__aref((sp_Article__implicit_7484 *)_t935.v.p, sp_box_sym(SPS_body)); | |
| if (_t935.cls_id == 81) _t936 = sp_Article__implicit_7995__aref((sp_Article__implicit_7995 *)_t935.v.p, sp_box_sym(SPS_body)); | |
| if (_t935.cls_id == 82) _t936 = sp_Article__implicit_9355__aref((sp_Article__implicit_9355 *)_t935.v.p, sp_box_sym(SPS_body)); | |
| if (_t935.cls_id == 83) _t936 = sp_Article__implicit_9372__aref((sp_Article__implicit_9372 *)_t935.v.p, sp_box_sym(SPS_body)); | |
| if (_t935.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t936 = sp_SymPolyHash_get((sp_SymPolyHash *)_t935.v.p, SPS_body); | |
| if (_t935.cls_id == SP_BUILTIN_SYM_INT_HASH) _t936 = sp_box_int(sp_SymIntHash_get((sp_SymIntHash *)_t935.v.p, SPS_body)); | |
| if (_t935.cls_id == SP_BUILTIN_SYM_STR_HASH) _t936 = sp_box_str(sp_SymStrHash_get((sp_SymStrHash *)_t935.v.p, SPS_body)); | |
| } | |
| const char *_t937 = sp_ActionView_ViewHelpers_cls_optional_value_attr(_t934); | |
| SP_GC_ROOT(_t937); | |
| const char *_t938 = sp_ActionView_ViewHelpers_cls_html_escape(sp_int_to_s(4LL)); | |
| SP_GC_ROOT(_t938); | |
| const char *_t939 = sp_ActionView_ViewHelpers_cls_escape_or_empty(_t936); | |
| SP_GC_ROOT(_t939); | |
| const char *_t940 = sp_ActionView_ViewHelpers_cls_html_escape(((lv_form_method == SPS_patch) ? (&("\xff" "Update Article")[1]) : (&("\xff" "Create Article")[1]))); | |
| SP_GC_ROOT(_t940); | |
| const char *_t941 = sp_ActionView_ViewHelpers_cls_html_escape(((lv_form_method == SPS_patch) ? (&("\xff" "Update Article")[1]) : (&("\xff" "Create Article")[1]))); | |
| SP_GC_ROOT(_t941); | |
| sp_String_append(lv_io, sp_sprintf("\n <div class=\"my-5\">\n <label for=\"article_title\">Title</label>\n <input type=\"text\" name=\"article[title]\" id=\"article_title\"%s class=\"%s\">\n </div>\n\n <div class=\"my-5\">\n <label for=\"article_body\">Body</label>\n <textarea name=\"article[body]\" id=\"article_body\" rows=\"%s\" class=\"%s\">%s</textarea>\n </div>\n\n <div class=\"inline\">\n <input type=\"submit\" name=\"commit\" value=\"%s\" data-disable-with=\"%s\" class=\"%s\">\n </div>\n</form>", _t937, (&("\xff" "block shadow-sm rounded-md border px-3 py-2 mt-2 w-full border-gray-400 focus:outline-blue-600")[1]), _t938, (&("\xff" "block shadow-sm rounded-md border px-3 py-2 mt-2 w-full border-gray-400 focus:outline-blue-600")[1]), _t939, _t940, _t941, (&("\xff" "w-full sm:w-auto rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer")[1]))); | |
| #line 32 "test/models/../../config/../app/controllers/../models/../views/articles/_form.rb" | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static sp_String * sp_Views_Articles_cls_index(sp_PtrArray * lv_articles, sp_RbVal lv_notice, sp_RbVal lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| sp_Article__implicit_6906 * lv_a = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT(lv_a); | |
| SP_GC_ROOT(lv_articles); | |
| SP_GC_ROOT_RBVAL(lv_notice); | |
| SP_GC_ROOT_RBVAL(lv_alert); | |
| SP_GC_ROOT(lv_articles); | |
| #line 7 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| lv_io = sp_String_new(""); | |
| #line 8 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| sp_String_append(lv_io, sp_sprintf("%s\n\n", sp_ActionView_ViewHelpers_cls_turbo_stream_from(sp_box_str((&("\xff" "articles")[1]))))); | |
| #line 9 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| sp_ActionView_ViewHelpers_cls_content_for_set(SPS_title, (&("\xff" "Articles")[1])); | |
| #line 10 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| sp_String_append(lv_io, (&("\xff" "\n<div class=\"w-full\">\n")[1])); | |
| #line 11 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| mrb_bool _t942 = (!sp_poly_nil_p(lv_notice)); | |
| mrb_bool _t943 = FALSE; | |
| if (_t942) { | |
| sp_RbVal _t944 = lv_notice; | |
| mrb_bool _t945 = FALSE; | |
| if (_t944.tag == SP_TAG_STR) _t945 = (sp_str_length(_t944.v.s) == 0); | |
| if (_t944.tag == SP_TAG_OBJ) { | |
| if (_t944.cls_id == 55) _t945 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t944.v.p); | |
| if (_t944.cls_id == 56) _t945 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t944.v.p); | |
| if (_t944.cls_id == SP_BUILTIN_INT_ARRAY) _t945 = (sp_IntArray_length((sp_IntArray *)_t944.v.p) == 0); | |
| if (_t944.cls_id == SP_BUILTIN_FLT_ARRAY) _t945 = (sp_FloatArray_length((sp_FloatArray *)_t944.v.p) == 0); | |
| if (_t944.cls_id == SP_BUILTIN_STR_ARRAY) _t945 = (sp_StrArray_length((sp_StrArray *)_t944.v.p) == 0); | |
| if (_t944.cls_id == SP_BUILTIN_SYM_ARRAY) _t945 = (sp_IntArray_length((sp_IntArray *)_t944.v.p) == 0); | |
| if (_t944.cls_id == SP_BUILTIN_PTR_ARRAY) _t945 = (sp_PtrArray_length((sp_PtrArray *)_t944.v.p) == 0); | |
| if (_t944.cls_id == SP_BUILTIN_POLY_ARRAY) _t945 = (sp_PolyArray_length((sp_PolyArray *)_t944.v.p) == 0); | |
| if (_t944.cls_id == SP_BUILTIN_STR_INT_HASH) _t945 = (sp_StrIntHash_length((sp_StrIntHash *)_t944.v.p) == 0); | |
| if (_t944.cls_id == SP_BUILTIN_STR_STR_HASH) _t945 = (sp_StrStrHash_length((sp_StrStrHash *)_t944.v.p) == 0); | |
| if (_t944.cls_id == SP_BUILTIN_INT_STR_HASH) _t945 = (sp_IntStrHash_length((sp_IntStrHash *)_t944.v.p) == 0); | |
| if (_t944.cls_id == SP_BUILTIN_STR_POLY_HASH) _t945 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t944.v.p) == 0); | |
| if (_t944.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t945 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t944.v.p) == 0); | |
| if (_t944.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t945 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t944.v.p) == 0); | |
| } | |
| _t943 = (!_t945); | |
| } else { | |
| _t943 = _t942; | |
| } | |
| if (_t943) { | |
| #line 12 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| sp_String_append(lv_io, sp_sprintf(" <p class=\"py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-md inline-block\" id=\"notice\">%s</p>\n", sp_ActionView_ViewHelpers_cls_html_escape((lv_notice).v.s))); | |
| } | |
| #line 14 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| sp_String_append(lv_io, sp_sprintf("\n <div class=\"flex justify-between items-center\">\n <h1 class=\"font-bold text-4xl\">Articles</h1>\n <a href=\"%s\" class=\"%s\">%s</a>\n </div>\n\n <div id=\"articles\" class=\"min-w-full divide-y divide-gray-200 space-y-5\">\n", sp_ActionView_ViewHelpers_cls_html_escape(sp_RouteHelpers_cls_new_article_path()), (&("\xff" "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white block font-medium")[1]), (&("\xff" "New article")[1]))); | |
| #line 15 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| if ((!sp_PtrArray_empty(lv_articles))) { | |
| #line 16 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| sp_String_append(lv_io, (&("\xff" " ")[1])); | |
| #line 17 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| for (mrb_int _t946 = 0; _t946 < sp_PtrArray_length(lv_articles); _t946++) { | |
| sp_Article__implicit_6906 * _t947 = (sp_Article__implicit_6906 *)sp_PtrArray_get(lv_articles, _t946); | |
| lv_a = _t947; | |
| sp_redo_36: ; | |
| sp_String_append(lv_io, sp_Views_Articles_cls_article(sp_box_obj(lv_a, 79), 0, 0)->data); | |
| } | |
| #line 18 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| sp_String_append(lv_io, (&("\xff" "\n")[1])); | |
| } else { | |
| #line 20 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| sp_String_append(lv_io, (&("\xff" " <p class=\"text-center my-10\">No articles found.</p>\n")[1])); | |
| } | |
| #line 22 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| sp_String_append(lv_io, (&("\xff" " </div>\n</div>\n")[1])); | |
| #line 23 "test/models/../../config/../app/controllers/../models/../views/articles/index.rb" | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static sp_String * sp_Views_Articles_cls_show(sp_RbVal lv_article, sp_RbVal lv_notice, sp_RbVal lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| mrb_int lv_c = 0; | |
| sp_Comment * lv_form_record = NULL; | |
| sp_sym lv_form_method = ((sp_sym)-1); | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT(lv_form_record); | |
| SP_GC_ROOT_RBVAL(lv_article); | |
| SP_GC_ROOT_RBVAL(lv_notice); | |
| SP_GC_ROOT_RBVAL(lv_alert); | |
| #line 8 "test/models/../../config/../app/controllers/../models/../views/articles/show.rb" | |
| lv_io = sp_String_new(""); | |
| #line 9 "test/models/../../config/../app/controllers/../models/../views/articles/show.rb" | |
| sp_ActionView_ViewHelpers_cls_content_for_set(SPS_title, (&("\xff" "Showing article")[1])); | |
| #line 10 "test/models/../../config/../app/controllers/../models/../views/articles/show.rb" | |
| sp_String_append(lv_io, (&("\xff" "\n<div class=\"md:w-2/3 w-full\">\n")[1])); | |
| #line 11 "test/models/../../config/../app/controllers/../models/../views/articles/show.rb" | |
| mrb_bool _t948 = (!sp_poly_nil_p(lv_notice)); | |
| mrb_bool _t949 = FALSE; | |
| if (_t948) { | |
| sp_RbVal _t950 = lv_notice; | |
| mrb_bool _t951 = FALSE; | |
| if (_t950.tag == SP_TAG_STR) _t951 = (sp_str_length(_t950.v.s) == 0); | |
| if (_t950.tag == SP_TAG_OBJ) { | |
| if (_t950.cls_id == 55) _t951 = sp_ActionDispatch_Flash_empty_p((sp_ActionDispatch_Flash *)_t950.v.p); | |
| if (_t950.cls_id == 56) _t951 = sp_ActionDispatch_Session_empty_p((sp_ActionDispatch_Session *)_t950.v.p); | |
| if (_t950.cls_id == SP_BUILTIN_INT_ARRAY) _t951 = (sp_IntArray_length((sp_IntArray *)_t950.v.p) == 0); | |
| if (_t950.cls_id == SP_BUILTIN_FLT_ARRAY) _t951 = (sp_FloatArray_length((sp_FloatArray *)_t950.v.p) == 0); | |
| if (_t950.cls_id == SP_BUILTIN_STR_ARRAY) _t951 = (sp_StrArray_length((sp_StrArray *)_t950.v.p) == 0); | |
| if (_t950.cls_id == SP_BUILTIN_SYM_ARRAY) _t951 = (sp_IntArray_length((sp_IntArray *)_t950.v.p) == 0); | |
| if (_t950.cls_id == SP_BUILTIN_PTR_ARRAY) _t951 = (sp_PtrArray_length((sp_PtrArray *)_t950.v.p) == 0); | |
| if (_t950.cls_id == SP_BUILTIN_POLY_ARRAY) _t951 = (sp_PolyArray_length((sp_PolyArray *)_t950.v.p) == 0); | |
| if (_t950.cls_id == SP_BUILTIN_STR_INT_HASH) _t951 = (sp_StrIntHash_length((sp_StrIntHash *)_t950.v.p) == 0); | |
| if (_t950.cls_id == SP_BUILTIN_STR_STR_HASH) _t951 = (sp_StrStrHash_length((sp_StrStrHash *)_t950.v.p) == 0); | |
| if (_t950.cls_id == SP_BUILTIN_INT_STR_HASH) _t951 = (sp_IntStrHash_length((sp_IntStrHash *)_t950.v.p) == 0); | |
| if (_t950.cls_id == SP_BUILTIN_STR_POLY_HASH) _t951 = (sp_StrPolyHash_length((sp_StrPolyHash *)_t950.v.p) == 0); | |
| if (_t950.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t951 = (sp_SymPolyHash_length((sp_SymPolyHash *)_t950.v.p) == 0); | |
| if (_t950.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t951 = (sp_PolyPolyHash_length((sp_PolyPolyHash *)_t950.v.p) == 0); | |
| } | |
| _t949 = (!_t951); | |
| } else { | |
| _t949 = _t948; | |
| } | |
| if (_t949) { | |
| #line 12 "test/models/../../config/../app/controllers/../models/../views/articles/show.rb" | |
| sp_String_append(lv_io, sp_sprintf(" <p class=\"py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-md inline-block\" id=\"notice\">%s</p>\n", sp_ActionView_ViewHelpers_cls_html_escape((lv_notice).v.s))); | |
| } | |
| #line 14 "test/models/../../config/../app/controllers/../models/../views/articles/show.rb" | |
| sp_RbVal _t952 = lv_article; | |
| sp_RbVal _t953 = sp_box_nil(); | |
| if (_t952.tag == SP_TAG_OBJ) { | |
| if (_t952.cls_id == 68) _t953 = sp_box_str(sp_ArticleRow_title((sp_ArticleRow *)_t952.v.p)); | |
| if (_t952.cls_id == 70) _t953 = sp_ArticleParams_title((sp_ArticleParams *)_t952.v.p); | |
| if (_t952.cls_id == 78) _t953 = sp_Article__implicit_6872_title((sp_Article__implicit_6872 *)_t952.v.p); | |
| if (_t952.cls_id == 79) _t953 = sp_Article__implicit_6906_title((sp_Article__implicit_6906 *)_t952.v.p); | |
| if (_t952.cls_id == 80) _t953 = sp_Article__implicit_7484_title((sp_Article__implicit_7484 *)_t952.v.p); | |
| if (_t952.cls_id == 81) _t953 = sp_Article__implicit_7995_title((sp_Article__implicit_7995 *)_t952.v.p); | |
| if (_t952.cls_id == 82) _t953 = sp_Article__implicit_9355_title((sp_Article__implicit_9355 *)_t952.v.p); | |
| if (_t952.cls_id == 83) _t953 = sp_Article__implicit_9372_title((sp_Article__implicit_9372 *)_t952.v.p); | |
| } | |
| sp_RbVal _t954 = lv_article; | |
| sp_RbVal _t955 = sp_box_nil(); | |
| if (_t954.tag == SP_TAG_OBJ) { | |
| if (_t954.cls_id == 58) _t955 = ((sp_ActionController_Base *)_t954.v.p)->iv_body; | |
| if (_t954.cls_id == 64) _t955 = ((sp_ApplicationController *)_t954.v.p)->iv_body; | |
| if (_t954.cls_id == 66) _t955 = sp_box_str(sp_CommentRow_body((sp_CommentRow *)_t954.v.p)); | |
| if (_t954.cls_id == 67) _t955 = sp_Comment_body((sp_Comment *)_t954.v.p); | |
| if (_t954.cls_id == 68) _t955 = sp_box_str(sp_ArticleRow_body((sp_ArticleRow *)_t954.v.p)); | |
| if (_t954.cls_id == 70) _t955 = sp_ArticleParams_body((sp_ArticleParams *)_t954.v.p); | |
| if (_t954.cls_id == 71) _t955 = ((sp_ArticlesController *)_t954.v.p)->iv_body; | |
| if (_t954.cls_id == 72) _t955 = sp_CommentParams_body((sp_CommentParams *)_t954.v.p); | |
| if (_t954.cls_id == 73) _t955 = ((sp_CommentsController *)_t954.v.p)->iv_body; | |
| if (_t954.cls_id == 74) _t955 = ((sp_ActionResponse *)_t954.v.p)->iv_body; | |
| if (_t954.cls_id == 78) _t955 = sp_Article__implicit_6872_body((sp_Article__implicit_6872 *)_t954.v.p); | |
| if (_t954.cls_id == 79) _t955 = sp_Article__implicit_6906_body((sp_Article__implicit_6906 *)_t954.v.p); | |
| if (_t954.cls_id == 80) _t955 = sp_Article__implicit_7484_body((sp_Article__implicit_7484 *)_t954.v.p); | |
| if (_t954.cls_id == 81) _t955 = sp_Article__implicit_7995_body((sp_Article__implicit_7995 *)_t954.v.p); | |
| if (_t954.cls_id == 82) _t955 = sp_Article__implicit_9355_body((sp_Article__implicit_9355 *)_t954.v.p); | |
| if (_t954.cls_id == 83) _t955 = sp_Article__implicit_9372_body((sp_Article__implicit_9372 *)_t954.v.p); | |
| } | |
| sp_RbVal _t956 = lv_article; | |
| sp_RbVal _t957 = sp_box_nil(); | |
| if (_t956.tag == SP_TAG_OBJ) { | |
| if (_t956.cls_id == 52) _t957 = ((sp_ActiveRecord_Base *)_t956.v.p)->iv_id; | |
| if (_t956.cls_id == 65) _t957 = ((sp_ApplicationRecord *)_t956.v.p)->iv_id; | |
| if (_t956.cls_id == 66) _t957 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t956.v.p)); | |
| if (_t956.cls_id == 67) _t957 = sp_Comment_id((sp_Comment *)_t956.v.p); | |
| if (_t956.cls_id == 68) _t957 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t956.v.p)); | |
| if (_t956.cls_id == 78) _t957 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t956.v.p); | |
| if (_t956.cls_id == 79) _t957 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t956.v.p); | |
| if (_t956.cls_id == 80) _t957 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t956.v.p); | |
| if (_t956.cls_id == 81) _t957 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t956.v.p); | |
| if (_t956.cls_id == 82) _t957 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t956.v.p); | |
| if (_t956.cls_id == 83) _t957 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t956.v.p); | |
| } | |
| sp_RbVal _t958 = lv_article; | |
| sp_RbVal _t959 = sp_box_nil(); | |
| if (_t958.tag == SP_TAG_OBJ) { | |
| if (_t958.cls_id == 52) _t959 = ((sp_ActiveRecord_Base *)_t958.v.p)->iv_id; | |
| if (_t958.cls_id == 65) _t959 = ((sp_ApplicationRecord *)_t958.v.p)->iv_id; | |
| if (_t958.cls_id == 66) _t959 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t958.v.p)); | |
| if (_t958.cls_id == 67) _t959 = sp_Comment_id((sp_Comment *)_t958.v.p); | |
| if (_t958.cls_id == 68) _t959 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t958.v.p)); | |
| if (_t958.cls_id == 78) _t959 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t958.v.p); | |
| if (_t958.cls_id == 79) _t959 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t958.v.p); | |
| if (_t958.cls_id == 80) _t959 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t958.v.p); | |
| if (_t958.cls_id == 81) _t959 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t958.v.p); | |
| if (_t958.cls_id == 82) _t959 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t958.v.p); | |
| if (_t958.cls_id == 83) _t959 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t958.v.p); | |
| } | |
| sp_RbVal _t960 = lv_article; | |
| sp_RbVal _t961 = sp_box_nil(); | |
| if (_t960.tag == SP_TAG_OBJ) { | |
| if (_t960.cls_id == 52) _t961 = ((sp_ActiveRecord_Base *)_t960.v.p)->iv_id; | |
| if (_t960.cls_id == 65) _t961 = ((sp_ApplicationRecord *)_t960.v.p)->iv_id; | |
| if (_t960.cls_id == 66) _t961 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t960.v.p)); | |
| if (_t960.cls_id == 67) _t961 = sp_Comment_id((sp_Comment *)_t960.v.p); | |
| if (_t960.cls_id == 68) _t961 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t960.v.p)); | |
| if (_t960.cls_id == 78) _t961 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t960.v.p); | |
| if (_t960.cls_id == 79) _t961 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t960.v.p); | |
| if (_t960.cls_id == 80) _t961 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t960.v.p); | |
| if (_t960.cls_id == 81) _t961 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t960.v.p); | |
| if (_t960.cls_id == 82) _t961 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t960.v.p); | |
| if (_t960.cls_id == 83) _t961 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t960.v.p); | |
| } | |
| const char *_t962 = sp_ActionView_ViewHelpers_cls_html_escape((_t953).v.s); | |
| SP_GC_ROOT(_t962); | |
| const char *_t963 = sp_ActionView_ViewHelpers_cls_html_escape((_t955).v.s); | |
| SP_GC_ROOT(_t963); | |
| const char *_t964 = sp_ActionView_ViewHelpers_cls_html_escape(sp_RouteHelpers_cls_edit_article_path((_t957).v.i)); | |
| SP_GC_ROOT(_t964); | |
| const char *_t965 = sp_ActionView_ViewHelpers_cls_html_escape(sp_RouteHelpers_cls_articles_path()); | |
| SP_GC_ROOT(_t965); | |
| const char *_t966 = sp_ActionView_ViewHelpers_cls_html_escape(sp_RouteHelpers_cls_article_path((_t959).v.i)); | |
| SP_GC_ROOT(_t966); | |
| const char *_t967 = sp_ActionView_ViewHelpers_cls_method_override_input(SPS_delete); | |
| SP_GC_ROOT(_t967); | |
| const char *_t968 = sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(); | |
| SP_GC_ROOT(_t968); | |
| const char *_t969 = sp_ActionView_ViewHelpers_cls_turbo_stream_from(sp_box_str(sp_sprintf("article_%s_comments", sp_poly_to_s(_t961)))); | |
| SP_GC_ROOT(_t969); | |
| sp_String_append(lv_io, sp_sprintf("\n <h1 class=\"font-bold text-4xl\">%s</h1>\n\n <div class=\"my-4\">\n <p class=\"text-gray-700\">%s</p>\n </div>\n\n <a href=\"%s\" class=\"%s\">%s</a>\n <a href=\"%s\" class=\"%s\">%s</a>\n <form action=\"%s\" method=\"post\" class=\"%s\">%s<button type=\"submit\" class=\"%s\" data-turbo-confirm=\"%s\">%s</button>%s</form>\n</div>\n\n<hr class=\"my-8\">\n\n<h2 class=\"text-xl font-bold mb-4\">Comments</h2>\n\n%s\n\n<div id=\"comments\" class=\"space-y-4 mb-8\">\n ", _t962, _t963, _t964, (&("\xff" "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Edit this article")[1]), _t965, (&("\xff" "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Back to articles")[1]), _t966, (&("\xff" "sm:inline-block mt-2 sm:mt-0 sm:ml-2")[1]), _t967, (&("\xff" "w-full rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer")[1]), (&("\xff" "Are you sure?")[1]), (&("\xff" "Destroy this article")[1]), _t968, _t969)); | |
| #line 15 "test/models/../../config/../app/controllers/../models/../views/articles/show.rb" | |
| sp_RbVal _t970 = lv_article; | |
| sp_RbVal _t971 = sp_box_nil(); | |
| if (_t970.tag == SP_TAG_OBJ) { | |
| if (_t970.cls_id == 78) _t971 = sp_Article__implicit_6872_comments((sp_Article__implicit_6872 *)_t970.v.p); | |
| if (_t970.cls_id == 79) _t971 = sp_Article__implicit_6906_comments((sp_Article__implicit_6906 *)_t970.v.p); | |
| if (_t970.cls_id == 80) _t971 = sp_Article__implicit_7484_comments((sp_Article__implicit_7484 *)_t970.v.p); | |
| if (_t970.cls_id == 81) _t971 = sp_Article__implicit_7995_comments((sp_Article__implicit_7995 *)_t970.v.p); | |
| if (_t970.cls_id == 82) _t971 = sp_Article__implicit_9355_comments((sp_Article__implicit_9355 *)_t970.v.p); | |
| if (_t970.cls_id == 83) _t971 = sp_Article__implicit_9372_comments((sp_Article__implicit_9372 *)_t970.v.p); | |
| } | |
| sp_RbVal _t972 = _t971; | |
| SP_GC_ROOT_RBVAL(_t972); | |
| if (_t972.tag == SP_TAG_OBJ) { | |
| mrb_int _t973_len = 0; | |
| if (_t972.cls_id == SP_BUILTIN_RANGE) _t973_len = ((sp_Range *)_t972.v.p)->last - ((sp_Range *)_t972.v.p)->first + 1; | |
| else if (_t972.cls_id == SP_BUILTIN_INT_ARRAY) _t973_len = sp_IntArray_length((sp_IntArray *)_t972.v.p); | |
| else if (_t972.cls_id == SP_BUILTIN_FLT_ARRAY) _t973_len = sp_FloatArray_length((sp_FloatArray *)_t972.v.p); | |
| else if (_t972.cls_id == SP_BUILTIN_STR_ARRAY) _t973_len = sp_StrArray_length((sp_StrArray *)_t972.v.p); | |
| else if (_t972.cls_id == SP_BUILTIN_SYM_ARRAY) _t973_len = sp_IntArray_length((sp_IntArray *)_t972.v.p); | |
| else if (_t972.cls_id == SP_BUILTIN_PTR_ARRAY) _t973_len = sp_PtrArray_length((sp_PtrArray *)_t972.v.p); | |
| else if (_t972.cls_id == SP_BUILTIN_POLY_ARRAY) _t973_len = sp_PolyArray_length((sp_PolyArray *)_t972.v.p); | |
| else if (_t972.cls_id == SP_BUILTIN_STR_INT_HASH) _t973_len = ((sp_StrIntHash *)_t972.v.p)->len; | |
| else if (_t972.cls_id == SP_BUILTIN_STR_STR_HASH) _t973_len = ((sp_StrStrHash *)_t972.v.p)->len; | |
| else if (_t972.cls_id == SP_BUILTIN_INT_STR_HASH) _t973_len = ((sp_IntStrHash *)_t972.v.p)->len; | |
| else if (_t972.cls_id == SP_BUILTIN_SYM_INT_HASH) _t973_len = ((sp_SymIntHash *)_t972.v.p)->len; | |
| else if (_t972.cls_id == SP_BUILTIN_SYM_STR_HASH) _t973_len = ((sp_SymStrHash *)_t972.v.p)->len; | |
| else if (_t972.cls_id == SP_BUILTIN_STR_POLY_HASH) _t973_len = ((sp_StrPolyHash *)_t972.v.p)->len; | |
| else if (_t972.cls_id == SP_BUILTIN_SYM_POLY_HASH) _t973_len = ((sp_SymPolyHash *)_t972.v.p)->len; | |
| else if (_t972.cls_id == SP_BUILTIN_POLY_POLY_HASH) _t973_len = ((sp_PolyPolyHash *)_t972.v.p)->len; | |
| for (mrb_int _t973 = 0; _t973 < _t973_len; _t973++) { | |
| sp_RbVal _t974 = sp_box_nil(); | |
| if (_t972.cls_id == SP_BUILTIN_RANGE) _t974 = sp_box_int(((sp_Range *)_t972.v.p)->first + _t973); | |
| else if (_t972.cls_id == SP_BUILTIN_INT_ARRAY) _t974 = sp_box_int(sp_IntArray_get((sp_IntArray *)_t972.v.p, _t973)); | |
| else if (_t972.cls_id == SP_BUILTIN_FLT_ARRAY) _t974 = sp_box_float(sp_FloatArray_get((sp_FloatArray *)_t972.v.p, _t973)); | |
| else if (_t972.cls_id == SP_BUILTIN_STR_ARRAY) _t974 = sp_box_str(sp_StrArray_get((sp_StrArray *)_t972.v.p, _t973)); | |
| else if (_t972.cls_id == SP_BUILTIN_SYM_ARRAY) _t974 = sp_box_sym((sp_sym)sp_IntArray_get((sp_IntArray *)_t972.v.p, _t973)); | |
| else if (_t972.cls_id == SP_BUILTIN_PTR_ARRAY) { void *_pe = sp_PtrArray_get((sp_PtrArray *)_t972.v.p, _t973); _t974 = sp_box_obj(_pe, sp_obj_cls_id_of(_pe)); } | |
| else if (_t972.cls_id == SP_BUILTIN_POLY_ARRAY) _t974 = sp_PolyArray_get((sp_PolyArray *)_t972.v.p, _t973); | |
| else if (_t972.cls_id == SP_BUILTIN_STR_INT_HASH) { sp_StrIntHash *_sh = (sp_StrIntHash *)_t972.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t973])); sp_PolyArray_push(_kv, sp_box_int(sp_StrIntHash_get(_sh, _sh->order[_t973]))); _t974 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t972.cls_id == SP_BUILTIN_STR_STR_HASH) { sp_StrStrHash *_sh = (sp_StrStrHash *)_t972.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t973])); sp_PolyArray_push(_kv, sp_box_str(sp_StrStrHash_get(_sh, _sh->order[_t973]))); _t974 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t972.cls_id == SP_BUILTIN_INT_STR_HASH) { sp_IntStrHash *_sh = (sp_IntStrHash *)_t972.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_int(_sh->order[_t973])); sp_PolyArray_push(_kv, sp_box_str(sp_IntStrHash_get(_sh, _sh->order[_t973]))); _t974 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t972.cls_id == SP_BUILTIN_SYM_INT_HASH) { sp_SymIntHash *_sh = (sp_SymIntHash *)_t972.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t973])); sp_PolyArray_push(_kv, sp_box_int(sp_SymIntHash_get(_sh, _sh->order[_t973]))); _t974 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t972.cls_id == SP_BUILTIN_SYM_STR_HASH) { sp_SymStrHash *_sh = (sp_SymStrHash *)_t972.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t973])); sp_PolyArray_push(_kv, sp_box_str(sp_SymStrHash_get(_sh, _sh->order[_t973]))); _t974 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t972.cls_id == SP_BUILTIN_STR_POLY_HASH) { sp_StrPolyHash *_sh = (sp_StrPolyHash *)_t972.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_str(_sh->order[_t973])); sp_PolyArray_push(_kv, sp_StrPolyHash_get(_sh, _sh->order[_t973])); _t974 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t972.cls_id == SP_BUILTIN_SYM_POLY_HASH) { sp_SymPolyHash *_sh = (sp_SymPolyHash *)_t972.v.p; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, sp_box_sym(_sh->order[_t973])); sp_PolyArray_push(_kv, sp_SymPolyHash_get(_sh, _sh->order[_t973])); _t974 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| else if (_t972.cls_id == SP_BUILTIN_POLY_POLY_HASH) { sp_PolyPolyHash *_sh = (sp_PolyPolyHash *)_t972.v.p; mrb_int _pk = _sh->order[_t973]; sp_PolyArray *_kv = sp_PolyArray_new(); sp_PolyArray_push(_kv, _sh->keys[_pk]); sp_PolyArray_push(_kv, _sh->vals[_pk]); _t974 = sp_box_obj(_kv, SP_BUILTIN_POLY_ARRAY); } | |
| sp_RbVal lv_c = _t974; | |
| sp_redo_37: ; | |
| sp_String_append(lv_io, sp_Views_Comments_cls_comment(((sp_Comment *)(lv_c).v.p), 0, 0)->data); | |
| } | |
| } | |
| #line 16 "test/models/../../config/../app/controllers/../models/../views/articles/show.rb" | |
| sp_String_append(lv_io, (&("\xff" "\n</div>\n\n<h3 class=\"text-lg font-semibold mb-2\">Add a Comment</h3>\n\n")[1])); | |
| #line 17 "test/models/../../config/../app/controllers/../models/../views/articles/show.rb" | |
| sp_StrIntHash * _t975 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t975); | |
| lv_form_record = sp_Comment_new(_t975); | |
| #line 18 "test/models/../../config/../app/controllers/../models/../views/articles/show.rb" | |
| lv_form_method = SPS_post; | |
| #line 19 "test/models/../../config/../app/controllers/../models/../views/articles/show.rb" | |
| sp_RbVal _t976 = lv_article; | |
| sp_RbVal _t977 = sp_box_nil(); | |
| if (_t976.tag == SP_TAG_OBJ) { | |
| if (_t976.cls_id == 52) _t977 = ((sp_ActiveRecord_Base *)_t976.v.p)->iv_id; | |
| if (_t976.cls_id == 65) _t977 = ((sp_ApplicationRecord *)_t976.v.p)->iv_id; | |
| if (_t976.cls_id == 66) _t977 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t976.v.p)); | |
| if (_t976.cls_id == 67) _t977 = sp_Comment_id((sp_Comment *)_t976.v.p); | |
| if (_t976.cls_id == 68) _t977 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t976.v.p)); | |
| if (_t976.cls_id == 78) _t977 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t976.v.p); | |
| if (_t976.cls_id == 79) _t977 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t976.v.p); | |
| if (_t976.cls_id == 80) _t977 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t976.v.p); | |
| if (_t976.cls_id == 81) _t977 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t976.v.p); | |
| if (_t976.cls_id == 82) _t977 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t976.v.p); | |
| if (_t976.cls_id == 83) _t977 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t976.v.p); | |
| } | |
| const char *_t978 = sp_ActionView_ViewHelpers_cls_html_escape(sp_RouteHelpers_cls_article_comments_path((_t977).v.i)); | |
| SP_GC_ROOT(_t978); | |
| const char *_t979 = sp_ActionView_ViewHelpers_cls_method_override_input(lv_form_method); | |
| SP_GC_ROOT(_t979); | |
| const char *_t980 = sp_ActionView_ViewHelpers_cls_csrf_token_hidden_input(); | |
| SP_GC_ROOT(_t980); | |
| const char *_t981 = sp_ActionView_ViewHelpers_cls_optional_value_attr(sp_Comment__aref(lv_form_record, SPS_commenter)); | |
| SP_GC_ROOT(_t981); | |
| const char *_t982 = sp_ActionView_ViewHelpers_cls_html_escape(sp_int_to_s(3LL)); | |
| SP_GC_ROOT(_t982); | |
| const char *_t983 = sp_ActionView_ViewHelpers_cls_escape_or_empty(sp_Comment__aref(lv_form_record, SPS_body)); | |
| SP_GC_ROOT(_t983); | |
| sp_String_append(lv_io, sp_sprintf("<form action=\"%s\" accept-charset=\"UTF-8\" method=\"post\" class=\"%s\">%s%s\n <div>\n <label for=\"comment_commenter\" class=\"%s\">Commenter</label>\n <input type=\"text\" name=\"comment[commenter]\" id=\"comment_commenter\"%s class=\"%s\">\n </div>\n <div>\n <label for=\"comment_body\" class=\"%s\">Body</label>\n <textarea name=\"comment[body]\" id=\"comment_body\" rows=\"%s\" class=\"%s\">%s</textarea>\n </div>\n <input type=\"submit\" name=\"commit\" value=\"%s\" data-disable-with=\"%s\" class=\"%s\">\n</form>", _t978, (&("\xff" "space-y-4")[1]), _t979, _t980, (&("\xff" "block font-medium")[1]), _t981, (&("\xff" "block w-full border rounded p-2")[1]), (&("\xff" "block font-medium")[1]), _t982, (&("\xff" "block w-full border rounded p-2")[1]), _t983, (&("\xff" "Add Comment")[1]), (&("\xff" "Add Comment")[1]), (&("\xff" "bg-blue-600 text-white px-4 py-2 rounded")[1]))); | |
| #line 20 "test/models/../../config/../app/controllers/../models/../views/articles/show.rb" | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static sp_String * sp_Views_Articles_cls_new(sp_RbVal lv_article, sp_RbVal lv_notice, sp_RbVal lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT_RBVAL(lv_article); | |
| SP_GC_ROOT_RBVAL(lv_notice); | |
| SP_GC_ROOT_RBVAL(lv_alert); | |
| #line 7 "test/models/../../config/../app/controllers/../models/../views/articles/new.rb" | |
| lv_io = sp_String_new(""); | |
| #line 8 "test/models/../../config/../app/controllers/../models/../views/articles/new.rb" | |
| sp_ActionView_ViewHelpers_cls_content_for_set(SPS_title, (&("\xff" "New article")[1])); | |
| #line 9 "test/models/../../config/../app/controllers/../models/../views/articles/new.rb" | |
| const char *_t984 = sp_String_cstr(sp_Views_Articles_cls_form(lv_article, 0, 0)); | |
| SP_GC_ROOT(_t984); | |
| const char *_t985 = sp_ActionView_ViewHelpers_cls_html_escape(sp_RouteHelpers_cls_articles_path()); | |
| SP_GC_ROOT(_t985); | |
| sp_String_append(lv_io, sp_sprintf("\n<div class=\"md:w-2/3 w-full\">\n <h1 class=\"font-bold text-4xl\">New article</h1>\n\n %s\n\n <a href=\"%s\" class=\"%s\">%s</a>\n</div>\n", _t984, _t985, (&("\xff" "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Back to articles")[1]))); | |
| #line 10 "test/models/../../config/../app/controllers/../models/../views/articles/new.rb" | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static sp_String * sp_Views_Articles_cls_edit(sp_RbVal lv_article, sp_RbVal lv_notice, sp_RbVal lv_alert) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT_RBVAL(lv_article); | |
| SP_GC_ROOT_RBVAL(lv_notice); | |
| SP_GC_ROOT_RBVAL(lv_alert); | |
| #line 7 "test/models/../../config/../app/controllers/../models/../views/articles/edit.rb" | |
| lv_io = sp_String_new(""); | |
| #line 8 "test/models/../../config/../app/controllers/../models/../views/articles/edit.rb" | |
| sp_ActionView_ViewHelpers_cls_content_for_set(SPS_title, (&("\xff" "Editing article")[1])); | |
| #line 9 "test/models/../../config/../app/controllers/../models/../views/articles/edit.rb" | |
| sp_RbVal _t986 = lv_article; | |
| sp_RbVal _t987 = sp_box_nil(); | |
| if (_t986.tag == SP_TAG_OBJ) { | |
| if (_t986.cls_id == 52) _t987 = ((sp_ActiveRecord_Base *)_t986.v.p)->iv_id; | |
| if (_t986.cls_id == 65) _t987 = ((sp_ApplicationRecord *)_t986.v.p)->iv_id; | |
| if (_t986.cls_id == 66) _t987 = sp_box_int(sp_CommentRow_id((sp_CommentRow *)_t986.v.p)); | |
| if (_t986.cls_id == 67) _t987 = sp_Comment_id((sp_Comment *)_t986.v.p); | |
| if (_t986.cls_id == 68) _t987 = sp_box_int(sp_ArticleRow_id((sp_ArticleRow *)_t986.v.p)); | |
| if (_t986.cls_id == 78) _t987 = sp_Article__implicit_6872_id((sp_Article__implicit_6872 *)_t986.v.p); | |
| if (_t986.cls_id == 79) _t987 = sp_Article__implicit_6906_id((sp_Article__implicit_6906 *)_t986.v.p); | |
| if (_t986.cls_id == 80) _t987 = sp_Article__implicit_7484_id((sp_Article__implicit_7484 *)_t986.v.p); | |
| if (_t986.cls_id == 81) _t987 = sp_Article__implicit_7995_id((sp_Article__implicit_7995 *)_t986.v.p); | |
| if (_t986.cls_id == 82) _t987 = sp_Article__implicit_9355_id((sp_Article__implicit_9355 *)_t986.v.p); | |
| if (_t986.cls_id == 83) _t987 = sp_Article__implicit_9372_id((sp_Article__implicit_9372 *)_t986.v.p); | |
| } | |
| const char *_t988 = sp_String_cstr(sp_Views_Articles_cls_form(lv_article, 0, 0)); | |
| SP_GC_ROOT(_t988); | |
| const char *_t989 = sp_ActionView_ViewHelpers_cls_html_escape(sp_RouteHelpers_cls_article_path((_t987).v.i)); | |
| SP_GC_ROOT(_t989); | |
| const char *_t990 = sp_ActionView_ViewHelpers_cls_html_escape(sp_RouteHelpers_cls_articles_path()); | |
| SP_GC_ROOT(_t990); | |
| sp_String_append(lv_io, sp_sprintf("\n<div class=\"md:w-2/3 w-full\">\n <h1 class=\"font-bold text-4xl\">Editing article</h1>\n\n %s\n\n <a href=\"%s\" class=\"%s\">%s</a>\n <a href=\"%s\" class=\"%s\">%s</a>\n</div>\n", _t988, _t989, (&("\xff" "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Show this article")[1]), _t990, (&("\xff" "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium")[1]), (&("\xff" "Back to articles")[1]))); | |
| #line 10 "test/models/../../config/../app/controllers/../models/../views/articles/edit.rb" | |
| return (sp_String *)lv_io; | |
| return NULL; | |
| } | |
| static inline sp_String * sp_Views_Layouts_cls_application(mrb_int lv_body, sp_String * lv_notice, sp_String * lv_alert) { | |
| (void)lv_body; | |
| (void)lv_notice; | |
| (void)lv_alert; | |
| return NULL; | |
| } | |
| static const char * sp_Views_Articles_cls_article_json(sp_Article * lv_article) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT(lv_article); | |
| SP_GC_ROOT(lv_article); | |
| #line 6 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| lv_io = sp_String_new(""); | |
| #line 7 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, (&("\xff" "{")[1])); | |
| #line 8 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, (&("\xff" "\"id\":")[1])); | |
| #line 9 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, sp_JsonBuilder_cls_encode_value(lv_article->iv_id)); | |
| #line 10 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, (&("\xff" ",")[1])); | |
| #line 11 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, (&("\xff" "\"title\":")[1])); | |
| #line 12 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, sp_JsonBuilder_cls_encode_value(sp_box_str(lv_article->iv_title))); | |
| #line 13 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, (&("\xff" ",")[1])); | |
| #line 14 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, (&("\xff" "\"body\":")[1])); | |
| #line 15 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, sp_JsonBuilder_cls_encode_value(sp_box_str(lv_article->iv_body))); | |
| #line 16 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, (&("\xff" ",")[1])); | |
| #line 17 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, (&("\xff" "\"created_at\":")[1])); | |
| #line 18 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, sp_JsonBuilder_cls_encode_datetime(sp_box_str(lv_article->iv_created_at))); | |
| #line 19 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, (&("\xff" ",")[1])); | |
| #line 20 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, (&("\xff" "\"updated_at\":")[1])); | |
| #line 21 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, sp_JsonBuilder_cls_encode_datetime(sp_box_str(lv_article->iv_updated_at))); | |
| #line 22 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, (&("\xff" ",")[1])); | |
| #line 23 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, (&("\xff" "\"url\":")[1])); | |
| #line 24 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, sp_JsonBuilder_cls_encode_value(sp_box_str(sp_str_concat(sp_RouteHelpers_cls_article_path((lv_article->iv_id).v.i), (&("\xff" ".json")[1]))))); | |
| #line 25 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| sp_String_append(lv_io, (&("\xff" "}")[1])); | |
| #line 26 "test/models/../../config/../app/controllers/../models/../views/articles/_article_json.rb" | |
| return (lv_io)->data; | |
| return (&("\xff")[1]); | |
| } | |
| static const char * sp_Views_Articles_cls_index_json(sp_PtrArray * lv_articles) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| sp_Article * lv_article = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT(lv_article); | |
| SP_GC_ROOT(lv_articles); | |
| SP_GC_ROOT(lv_articles); | |
| #line 6 "test/models/../../config/../app/controllers/../models/../views/articles/index_json.rb" | |
| lv_io = sp_String_new(""); | |
| #line 7 "test/models/../../config/../app/controllers/../models/../views/articles/index_json.rb" | |
| sp_String_append(lv_io, (&("\xff" "[")[1])); | |
| #line 8 "test/models/../../config/../app/controllers/../models/../views/articles/index_json.rb" | |
| SP_GC_ROOT(lv_articles); | |
| sp_StrArray *_t991 = sp_StrArray_new(); | |
| SP_GC_ROOT(_t991); | |
| for (mrb_int _t992 = 0; _t992 < sp_PtrArray_length(lv_articles); _t992++) { | |
| sp_Article * lv_article = (sp_Article *)sp_PtrArray_get(lv_articles, _t992); | |
| sp_StrArray_push(_t991, sp_Views_Articles_cls_article_json((sp_Article *)lv_article)); | |
| } | |
| sp_StrArray * _t993 = _t991; | |
| SP_GC_ROOT(_t993); | |
| sp_String_append(lv_io, sp_StrArray_join(_t993, (&("\xff" ",")[1]))); | |
| #line 9 "test/models/../../config/../app/controllers/../models/../views/articles/index_json.rb" | |
| sp_String_append(lv_io, (&("\xff" "]")[1])); | |
| #line 10 "test/models/../../config/../app/controllers/../models/../views/articles/index_json.rb" | |
| return (lv_io)->data; | |
| return (&("\xff")[1]); | |
| } | |
| static inline const char * sp_Views_Articles_cls_show_json(sp_Article * lv_article) { | |
| SP_GC_SAVE(); | |
| sp_String * lv_io = NULL; | |
| SP_GC_ROOT(lv_io); | |
| SP_GC_ROOT(lv_article); | |
| SP_GC_ROOT(lv_article); | |
| #line 6 "test/models/../../config/../app/controllers/../models/../views/articles/show_json.rb" | |
| lv_io = sp_String_new(""); | |
| #line 7 "test/models/../../config/../app/controllers/../models/../views/articles/show_json.rb" | |
| sp_String_append(lv_io, sp_Views_Articles_cls_article_json((sp_Article *)lv_article)); | |
| #line 8 "test/models/../../config/../app/controllers/../models/../views/articles/show_json.rb" | |
| return (lv_io)->data; | |
| return (&("\xff")[1]); | |
| } | |
| static inline sp_PtrArray * sp_Routes_cls_table(void) { | |
| SP_GC_SAVE(); | |
| #line 7 "test/models/../../config/routes.rb" | |
| sp_PtrArray *_t994 = sp_PtrArray_new(); | |
| SP_GC_ROOT(_t994); | |
| sp_PtrArray_push(_t994, sp_ActionDispatch_Router_Route_new((&("\xff" "GET")[1]), (&("\xff" "/articles")[1]), SPS_articles, SPS_index)); | |
| sp_PtrArray_push(_t994, sp_ActionDispatch_Router_Route_new((&("\xff" "GET")[1]), (&("\xff" "/articles/new")[1]), SPS_articles, SPS_new)); | |
| sp_PtrArray_push(_t994, sp_ActionDispatch_Router_Route_new((&("\xff" "POST")[1]), (&("\xff" "/articles")[1]), SPS_articles, SPS_create)); | |
| sp_PtrArray_push(_t994, sp_ActionDispatch_Router_Route_new((&("\xff" "GET")[1]), (&("\xff" "/articles/:id")[1]), SPS_articles, SPS_show)); | |
| sp_PtrArray_push(_t994, sp_ActionDispatch_Router_Route_new((&("\xff" "GET")[1]), (&("\xff" "/articles/:id/edit")[1]), SPS_articles, SPS_edit)); | |
| sp_PtrArray_push(_t994, sp_ActionDispatch_Router_Route_new((&("\xff" "PATCH")[1]), (&("\xff" "/articles/:id")[1]), SPS_articles, SPS_update)); | |
| sp_PtrArray_push(_t994, sp_ActionDispatch_Router_Route_new((&("\xff" "DELETE")[1]), (&("\xff" "/articles/:id")[1]), SPS_articles, SPS_destroy)); | |
| sp_PtrArray_push(_t994, sp_ActionDispatch_Router_Route_new((&("\xff" "POST")[1]), (&("\xff" "/articles/:article_id/comments")[1]), SPS_comments, SPS_create)); | |
| sp_PtrArray_push(_t994, sp_ActionDispatch_Router_Route_new((&("\xff" "DELETE")[1]), (&("\xff" "/articles/:article_id/comments/:id")[1]), SPS_comments, SPS_destroy)); | |
| return _t994; | |
| return NULL; | |
| } | |
| static inline sp_ActionDispatch_Router_Route * sp_Routes_cls_root(void) { | |
| return NULL; | |
| } | |
| static inline mrb_int sp_SchemaSetup_cls_reset_bang(void) { | |
| SP_GC_SAVE(); | |
| #line 59 "test/models/../test_helper.rb" | |
| if (("constant" != NULL)) { | |
| sp_Article_cls__adapter_truncate(); | |
| } | |
| #line 60 "test/models/../test_helper.rb" | |
| if (("constant" != NULL)) { | |
| sp_Comment_cls__adapter_truncate(); | |
| } | |
| #line 61 "test/models/../test_helper.rb" | |
| return sp_FixtureLoader_cls_load_all_bang(); | |
| return 0; | |
| } | |
| static inline mrb_int sp_FixtureLoader_cls_load_all_bang(void) { | |
| SP_GC_SAVE(); | |
| #line 99 "test/models/../test_helper.rb" | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| #line 100 "test/models/../test_helper.rb" | |
| return sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| return 0; | |
| } | |
| static inline sp_Article * sp_ArticlesFixtures_cls_one(void) { | |
| SP_GC_SAVE(); | |
| #line 5 "test/models/../fixtures/articles.rb" | |
| return sp_Article_cls_find(1LL); | |
| return NULL; | |
| } | |
| static inline sp_Article * sp_ArticlesFixtures_cls_two(void) { | |
| return NULL; | |
| } | |
| static mrb_int sp_ArticlesFixtures_cls__fixtures_load_bang(void) { | |
| SP_GC_SAVE(); | |
| sp_RbVal lv_instance = sp_box_nil(); | |
| SP_GC_ROOT_RBVAL(lv_instance); | |
| #line 13 "test/models/../fixtures/articles.rb" | |
| sp_StrIntHash * _t995 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t995); | |
| lv_instance = sp_box_obj(sp_Article__implicit_9355_new(_t995), 82); | |
| #line 14 "test/models/../fixtures/articles.rb" | |
| sp_RbVal _t996 = lv_instance; | |
| sp_RbVal _t997 = sp_box_nil(); | |
| if (_t996.tag == SP_TAG_OBJ) { | |
| if (_t996.cls_id == 52) { ((sp_ActiveRecord_Base *)_t996.v.p)->iv_id = sp_box_int(1LL); _t997 = sp_box_int(1LL); } | |
| if (_t996.cls_id == 65) { ((sp_ApplicationRecord *)_t996.v.p)->iv_id = sp_box_int(1LL); _t997 = sp_box_int(1LL); } | |
| if (_t996.cls_id == 66) _t997 = sp_box_int(sp_CommentRow_id_eq((sp_CommentRow *)_t996.v.p, 1LL)); | |
| if (_t996.cls_id == 67) _t997 = sp_box_int(sp_Comment_id_eq((sp_Comment *)_t996.v.p, sp_box_int(1LL))); | |
| if (_t996.cls_id == 68) _t997 = sp_box_int(sp_ArticleRow_id_eq((sp_ArticleRow *)_t996.v.p, 1LL)); | |
| if (_t996.cls_id == 78) _t997 = sp_box_int(sp_Article__implicit_6872_id_eq((sp_Article__implicit_6872 *)_t996.v.p, sp_box_int(1LL))); | |
| if (_t996.cls_id == 79) _t997 = sp_box_int(sp_Article__implicit_6906_id_eq((sp_Article__implicit_6906 *)_t996.v.p, sp_box_int(1LL))); | |
| if (_t996.cls_id == 80) _t997 = sp_box_int(sp_Article__implicit_7484_id_eq((sp_Article__implicit_7484 *)_t996.v.p, sp_box_int(1LL))); | |
| if (_t996.cls_id == 81) _t997 = sp_box_int(sp_Article__implicit_7995_id_eq((sp_Article__implicit_7995 *)_t996.v.p, sp_box_int(1LL))); | |
| if (_t996.cls_id == 82) _t997 = sp_box_int(sp_Article__implicit_9355_id_eq((sp_Article__implicit_9355 *)_t996.v.p, sp_box_int(1LL))); | |
| if (_t996.cls_id == 83) _t997 = sp_box_int(sp_Article__implicit_9372_id_eq((sp_Article__implicit_9372 *)_t996.v.p, sp_box_int(1LL))); | |
| } | |
| _t997; | |
| #line 15 "test/models/../fixtures/articles.rb" | |
| sp_RbVal _t998 = lv_instance; | |
| mrb_int _t999 = 0; | |
| if (_t998.tag == SP_TAG_OBJ) { | |
| if (_t998.cls_id == 68) _t999 = sp_ArticleRow_title_eq((sp_ArticleRow *)_t998.v.p, (&("\xff" "Getting Started with Rails")[1])); | |
| if (_t998.cls_id == 70) _t999 = sp_ArticleParams_title_eq((sp_ArticleParams *)_t998.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| if (_t998.cls_id == 78) _t999 = sp_Article__implicit_6872_title_eq((sp_Article__implicit_6872 *)_t998.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| if (_t998.cls_id == 79) _t999 = sp_Article__implicit_6906_title_eq((sp_Article__implicit_6906 *)_t998.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| if (_t998.cls_id == 80) _t999 = sp_Article__implicit_7484_title_eq((sp_Article__implicit_7484 *)_t998.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| if (_t998.cls_id == 81) _t999 = sp_Article__implicit_7995_title_eq((sp_Article__implicit_7995 *)_t998.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| if (_t998.cls_id == 82) _t999 = sp_Article__implicit_9355_title_eq((sp_Article__implicit_9355 *)_t998.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| if (_t998.cls_id == 83) _t999 = sp_Article__implicit_9372_title_eq((sp_Article__implicit_9372 *)_t998.v.p, sp_box_str((&("\xff" "Getting Started with Rails")[1]))); | |
| } | |
| _t999; | |
| #line 16 "test/models/../fixtures/articles.rb" | |
| sp_RbVal _t1000 = lv_instance; | |
| mrb_int _t1001 = 0; | |
| if (_t1000.tag == SP_TAG_OBJ) { | |
| if (_t1000.cls_id == 66) _t1001 = sp_CommentRow_body_eq((sp_CommentRow *)_t1000.v.p, (&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1])); | |
| if (_t1000.cls_id == 67) _t1001 = sp_Comment_body_eq((sp_Comment *)_t1000.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1000.cls_id == 68) _t1001 = sp_ArticleRow_body_eq((sp_ArticleRow *)_t1000.v.p, (&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1])); | |
| if (_t1000.cls_id == 70) _t1001 = sp_ArticleParams_body_eq((sp_ArticleParams *)_t1000.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1000.cls_id == 72) _t1001 = sp_CommentParams_body_eq((sp_CommentParams *)_t1000.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1000.cls_id == 78) _t1001 = sp_Article__implicit_6872_body_eq((sp_Article__implicit_6872 *)_t1000.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1000.cls_id == 79) _t1001 = sp_Article__implicit_6906_body_eq((sp_Article__implicit_6906 *)_t1000.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1000.cls_id == 80) _t1001 = sp_Article__implicit_7484_body_eq((sp_Article__implicit_7484 *)_t1000.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1000.cls_id == 81) _t1001 = sp_Article__implicit_7995_body_eq((sp_Article__implicit_7995 *)_t1000.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1000.cls_id == 82) _t1001 = sp_Article__implicit_9355_body_eq((sp_Article__implicit_9355 *)_t1000.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| if (_t1000.cls_id == 83) _t1001 = sp_Article__implicit_9372_body_eq((sp_Article__implicit_9372 *)_t1000.v.p, sp_box_str((&("\xff" "Rails is a web application framework running on the Ruby programming language.")[1]))); | |
| } | |
| _t1001; | |
| #line 17 "test/models/../fixtures/articles.rb" | |
| sp_RbVal _t1002 = lv_instance; | |
| mrb_bool _t1003 = FALSE; | |
| if (_t1002.tag == SP_TAG_OBJ) { | |
| if (_t1002.cls_id == 52) _t1003 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1002.v.p); | |
| if (_t1002.cls_id == 65) _t1003 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1002.v.p); | |
| if (_t1002.cls_id == 67) _t1003 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1002.v.p); | |
| if (_t1002.cls_id == 78) _t1003 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1002.v.p); | |
| if (_t1002.cls_id == 79) _t1003 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1002.v.p); | |
| if (_t1002.cls_id == 80) _t1003 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1002.v.p); | |
| if (_t1002.cls_id == 81) _t1003 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1002.v.p); | |
| if (_t1002.cls_id == 82) _t1003 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1002.v.p); | |
| if (_t1002.cls_id == 83) _t1003 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1002.v.p); | |
| } | |
| _t1003; | |
| #line 18 "test/models/../fixtures/articles.rb" | |
| sp_StrIntHash * _t1004 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t1004); | |
| lv_instance = sp_box_obj(sp_Article__implicit_9372_new(_t1004), 83); | |
| #line 19 "test/models/../fixtures/articles.rb" | |
| sp_RbVal _t1005 = lv_instance; | |
| sp_RbVal _t1006 = sp_box_nil(); | |
| if (_t1005.tag == SP_TAG_OBJ) { | |
| if (_t1005.cls_id == 52) { ((sp_ActiveRecord_Base *)_t1005.v.p)->iv_id = sp_box_int(2LL); _t1006 = sp_box_int(2LL); } | |
| if (_t1005.cls_id == 65) { ((sp_ApplicationRecord *)_t1005.v.p)->iv_id = sp_box_int(2LL); _t1006 = sp_box_int(2LL); } | |
| if (_t1005.cls_id == 66) _t1006 = sp_box_int(sp_CommentRow_id_eq((sp_CommentRow *)_t1005.v.p, 2LL)); | |
| if (_t1005.cls_id == 67) _t1006 = sp_box_int(sp_Comment_id_eq((sp_Comment *)_t1005.v.p, sp_box_int(2LL))); | |
| if (_t1005.cls_id == 68) _t1006 = sp_box_int(sp_ArticleRow_id_eq((sp_ArticleRow *)_t1005.v.p, 2LL)); | |
| if (_t1005.cls_id == 78) _t1006 = sp_box_int(sp_Article__implicit_6872_id_eq((sp_Article__implicit_6872 *)_t1005.v.p, sp_box_int(2LL))); | |
| if (_t1005.cls_id == 79) _t1006 = sp_box_int(sp_Article__implicit_6906_id_eq((sp_Article__implicit_6906 *)_t1005.v.p, sp_box_int(2LL))); | |
| if (_t1005.cls_id == 80) _t1006 = sp_box_int(sp_Article__implicit_7484_id_eq((sp_Article__implicit_7484 *)_t1005.v.p, sp_box_int(2LL))); | |
| if (_t1005.cls_id == 81) _t1006 = sp_box_int(sp_Article__implicit_7995_id_eq((sp_Article__implicit_7995 *)_t1005.v.p, sp_box_int(2LL))); | |
| if (_t1005.cls_id == 82) _t1006 = sp_box_int(sp_Article__implicit_9355_id_eq((sp_Article__implicit_9355 *)_t1005.v.p, sp_box_int(2LL))); | |
| if (_t1005.cls_id == 83) _t1006 = sp_box_int(sp_Article__implicit_9372_id_eq((sp_Article__implicit_9372 *)_t1005.v.p, sp_box_int(2LL))); | |
| } | |
| _t1006; | |
| #line 20 "test/models/../fixtures/articles.rb" | |
| sp_RbVal _t1007 = lv_instance; | |
| mrb_int _t1008 = 0; | |
| if (_t1007.tag == SP_TAG_OBJ) { | |
| if (_t1007.cls_id == 68) _t1008 = sp_ArticleRow_title_eq((sp_ArticleRow *)_t1007.v.p, (&("\xff" "Understanding MVC Architecture")[1])); | |
| if (_t1007.cls_id == 70) _t1008 = sp_ArticleParams_title_eq((sp_ArticleParams *)_t1007.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| if (_t1007.cls_id == 78) _t1008 = sp_Article__implicit_6872_title_eq((sp_Article__implicit_6872 *)_t1007.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| if (_t1007.cls_id == 79) _t1008 = sp_Article__implicit_6906_title_eq((sp_Article__implicit_6906 *)_t1007.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| if (_t1007.cls_id == 80) _t1008 = sp_Article__implicit_7484_title_eq((sp_Article__implicit_7484 *)_t1007.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| if (_t1007.cls_id == 81) _t1008 = sp_Article__implicit_7995_title_eq((sp_Article__implicit_7995 *)_t1007.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| if (_t1007.cls_id == 82) _t1008 = sp_Article__implicit_9355_title_eq((sp_Article__implicit_9355 *)_t1007.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| if (_t1007.cls_id == 83) _t1008 = sp_Article__implicit_9372_title_eq((sp_Article__implicit_9372 *)_t1007.v.p, sp_box_str((&("\xff" "Understanding MVC Architecture")[1]))); | |
| } | |
| _t1008; | |
| #line 21 "test/models/../fixtures/articles.rb" | |
| sp_RbVal _t1009 = lv_instance; | |
| mrb_int _t1010 = 0; | |
| if (_t1009.tag == SP_TAG_OBJ) { | |
| if (_t1009.cls_id == 66) _t1010 = sp_CommentRow_body_eq((sp_CommentRow *)_t1009.v.p, (&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1])); | |
| if (_t1009.cls_id == 67) _t1010 = sp_Comment_body_eq((sp_Comment *)_t1009.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1009.cls_id == 68) _t1010 = sp_ArticleRow_body_eq((sp_ArticleRow *)_t1009.v.p, (&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1])); | |
| if (_t1009.cls_id == 70) _t1010 = sp_ArticleParams_body_eq((sp_ArticleParams *)_t1009.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1009.cls_id == 72) _t1010 = sp_CommentParams_body_eq((sp_CommentParams *)_t1009.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1009.cls_id == 78) _t1010 = sp_Article__implicit_6872_body_eq((sp_Article__implicit_6872 *)_t1009.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1009.cls_id == 79) _t1010 = sp_Article__implicit_6906_body_eq((sp_Article__implicit_6906 *)_t1009.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1009.cls_id == 80) _t1010 = sp_Article__implicit_7484_body_eq((sp_Article__implicit_7484 *)_t1009.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1009.cls_id == 81) _t1010 = sp_Article__implicit_7995_body_eq((sp_Article__implicit_7995 *)_t1009.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1009.cls_id == 82) _t1010 = sp_Article__implicit_9355_body_eq((sp_Article__implicit_9355 *)_t1009.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| if (_t1009.cls_id == 83) _t1010 = sp_Article__implicit_9372_body_eq((sp_Article__implicit_9372 *)_t1009.v.p, sp_box_str((&("\xff" "MVC stands for Model-View-Controller. Models handle data and business logic.")[1]))); | |
| } | |
| _t1010; | |
| #line 22 "test/models/../fixtures/articles.rb" | |
| sp_RbVal _t1011 = lv_instance; | |
| mrb_bool _t1012 = FALSE; | |
| if (_t1011.tag == SP_TAG_OBJ) { | |
| if (_t1011.cls_id == 52) _t1012 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1011.v.p); | |
| if (_t1011.cls_id == 65) _t1012 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1011.v.p); | |
| if (_t1011.cls_id == 67) _t1012 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1011.v.p); | |
| if (_t1011.cls_id == 78) _t1012 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1011.v.p); | |
| if (_t1011.cls_id == 79) _t1012 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1011.v.p); | |
| if (_t1011.cls_id == 80) _t1012 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1011.v.p); | |
| if (_t1011.cls_id == 81) _t1012 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1011.v.p); | |
| if (_t1011.cls_id == 82) _t1012 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1011.v.p); | |
| if (_t1011.cls_id == 83) _t1012 = sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)_t1011.v.p); | |
| } | |
| return _t1012; | |
| return 0; | |
| } | |
| static inline sp_Comment * sp_CommentsFixtures_cls_one(void) { | |
| SP_GC_SAVE(); | |
| #line 5 "test/models/../fixtures/comments.rb" | |
| return sp_Comment_cls_find(1LL); | |
| return NULL; | |
| } | |
| static inline sp_Comment * sp_CommentsFixtures_cls_two(void) { | |
| return NULL; | |
| } | |
| static mrb_int sp_CommentsFixtures_cls__fixtures_load_bang(void) { | |
| SP_GC_SAVE(); | |
| sp_Comment * lv_instance = NULL; | |
| SP_GC_ROOT(lv_instance); | |
| #line 13 "test/models/../fixtures/comments.rb" | |
| sp_StrIntHash * _t1013 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t1013); | |
| lv_instance = sp_Comment_new(_t1013); | |
| #line 14 "test/models/../fixtures/comments.rb" | |
| lv_instance->iv_id = sp_box_int(1LL); | |
| #line 15 "test/models/../fixtures/comments.rb" | |
| sp_Comment_article_id_eq(lv_instance, sp_box_int(1LL)); | |
| #line 16 "test/models/../fixtures/comments.rb" | |
| sp_Comment_commenter_eq(lv_instance, sp_box_str((&("\xff" "Alice")[1]))); | |
| #line 17 "test/models/../fixtures/comments.rb" | |
| sp_Comment_body_eq(lv_instance, sp_box_str((&("\xff" "Great introduction! Rails really does make development faster.")[1]))); | |
| #line 18 "test/models/../fixtures/comments.rb" | |
| sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)lv_instance); | |
| #line 19 "test/models/../fixtures/comments.rb" | |
| sp_StrIntHash * _t1014 = sp_StrIntHash_new(); | |
| SP_GC_ROOT(_t1014); | |
| lv_instance = sp_Comment_new(_t1014); | |
| #line 20 "test/models/../fixtures/comments.rb" | |
| lv_instance->iv_id = sp_box_int(2LL); | |
| #line 21 "test/models/../fixtures/comments.rb" | |
| sp_Comment_article_id_eq(lv_instance, sp_box_int(2LL)); | |
| #line 22 "test/models/../fixtures/comments.rb" | |
| sp_Comment_commenter_eq(lv_instance, sp_box_str((&("\xff" "Bob")[1]))); | |
| #line 23 "test/models/../fixtures/comments.rb" | |
| sp_Comment_body_eq(lv_instance, sp_box_str((&("\xff" "This pattern really helps keep code organized!")[1]))); | |
| #line 24 "test/models/../fixtures/comments.rb" | |
| return sp_ActiveRecord_Base_save((sp_ActiveRecord_Base *)lv_instance); | |
| return 0; | |
| } | |
| static void sp_clsbody_515(void); | |
| static void sp_clsbody_3821(void); | |
| static void sp_clsbody_515(void) { | |
| #line 46 "test/models/../../runtime/db.rb" | |
| #line 48 "test/models/../../runtime/db.rb" | |
| #line 49 "test/models/../../runtime/db.rb" | |
| #line 50 "test/models/../../runtime/db.rb" | |
| #line 52 "test/models/../../runtime/db.rb" | |
| #line 53 "test/models/../../runtime/db.rb" | |
| #line 54 "test/models/../../runtime/db.rb" | |
| #line 55 "test/models/../../runtime/db.rb" | |
| #line 56 "test/models/../../runtime/db.rb" | |
| #line 57 "test/models/../../runtime/db.rb" | |
| #line 62 "test/models/../../runtime/db.rb" | |
| #line 63 "test/models/../../runtime/db.rb" | |
| #line 64 "test/models/../../runtime/db.rb" | |
| #line 65 "test/models/../../runtime/db.rb" | |
| #line 66 "test/models/../../runtime/db.rb" | |
| #line 67 "test/models/../../runtime/db.rb" | |
| #line 68 "test/models/../../runtime/db.rb" | |
| #line 69 "test/models/../../runtime/db.rb" | |
| #line 70 "test/models/../../runtime/db.rb" | |
| #line 74 "test/models/../../runtime/db.rb" | |
| #line 75 "test/models/../../runtime/db.rb" | |
| #line 76 "test/models/../../runtime/db.rb" | |
| } | |
| static void sp_clsbody_3821(void) { | |
| #line 93 "test/models/../../runtime/broadcasts.rb" | |
| } | |
| static mrb_int sp_method_obj_hash_dispatch(int cls_id, void *p) { | |
| if (cls_id == 77) { | |
| sp_Method *m = (sp_Method *)p; | |
| return ((mrb_int)(uintptr_t)m->iv_self_obj * 31) ^ (mrb_int)m->iv_fn_ptr; | |
| } | |
| if (cls_id == SP_BUILTIN_INT_ARRAY) { | |
| sp_IntArray *a = (sp_IntArray *)p; | |
| mrb_int h = 5381; | |
| for (mrb_int i = 0; i < a->len; i++) h = ((h << 5) + h) ^ sp_IntArray_get(a, i); | |
| return h; | |
| } | |
| return (mrb_int)((uintptr_t)p); | |
| } | |
| static mrb_bool sp_method_obj_eql_dispatch(int cls_id, void *a, void *b) { | |
| if (cls_id == 77) { | |
| sp_Method *ma = (sp_Method *)a; | |
| sp_Method *mb = (sp_Method *)b; | |
| return ma->iv_self_obj == mb->iv_self_obj && ma->iv_fn_ptr == mb->iv_fn_ptr; | |
| } | |
| if (cls_id == SP_BUILTIN_INT_ARRAY) { | |
| sp_IntArray *aa = (sp_IntArray *)a; | |
| sp_IntArray *bb = (sp_IntArray *)b; | |
| if (aa->len != bb->len) return FALSE; | |
| for (mrb_int i = 0; i < aa->len; i++) if (sp_IntArray_get(aa, i) != sp_IntArray_get(bb, i)) return FALSE; | |
| return TRUE; | |
| } | |
| return FALSE; | |
| } | |
| int main(int argc,char**argv){ | |
| sp_re_init(); | |
| sp_obj_hash_hook = sp_method_obj_hash_dispatch; | |
| sp_obj_eql_hook = sp_method_obj_eql_dispatch; | |
| SP_GC_SAVE(); | |
| const char * lv_sql = (&("\xff")[1]); | |
| SP_GC_ROOT(lv_sql); | |
| sp_ArticleTest * lv___t = NULL; | |
| SP_GC_ROOT(lv___t); | |
| cst_Base64_ALPHABET = (&("\xff" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")[1]); | |
| SP_GC_ROOT(cst_Base64_ALPHABET); | |
| cst_SQL_OK = 0LL; | |
| cst_SQL_ROW = 100LL; | |
| cst_SQL_DONE = 101LL; | |
| cst_Db_pool = 0; | |
| SP_GC_ROOT(cst_Db_pool); | |
| cst_Db_query_log = ((void)(0), sp_box_nil()); | |
| SP_GC_ROOT_RBVAL(cst_Db_query_log); | |
| cst_ActiveRecord_Registry_entries = sp_StrPolyHash_new(); | |
| SP_GC_ROOT(cst_ActiveRecord_Registry_entries); | |
| cst_ActionView_ViewHelpers_slots = sp_SymStrHash_new(); | |
| SP_GC_ROOT(cst_ActionView_ViewHelpers_slots); | |
| sp_StrStrHash *_t1015 = sp_StrStrHash_new(); | |
| SP_GC_ROOT(_t1015); | |
| sp_StrStrHash_set(_t1015, (&("\xff" "&")[1]), (&("\xff" "&")[1])); | |
| sp_StrStrHash_set(_t1015, (&("\xff" "<")[1]), (&("\xff" "<")[1])); | |
| sp_StrStrHash_set(_t1015, (&("\xff" ">")[1]), (&("\xff" ">")[1])); | |
| sp_StrStrHash_set(_t1015, (&("\xff" "\"")[1]), (&("\xff" """)[1])); | |
| sp_StrStrHash_set(_t1015, (&("\xff" "'")[1]), (&("\xff" "'")[1])); | |
| cst_ActionView_ViewHelpers_HTML_ESCAPES = (sp_StrStrHash *)sp_gc_freeze(_t1015); | |
| SP_GC_ROOT(cst_ActionView_ViewHelpers_HTML_ESCAPES); | |
| cst_ActionView_ViewHelpers_HTML_ESCAPE_PATTERN = 0; | |
| sp_SymIntHash *_t1016 = sp_SymIntHash_new(); | |
| SP_GC_ROOT(_t1016); | |
| sp_SymIntHash_set(_t1016, SPS_ok, 200LL); | |
| sp_SymIntHash_set(_t1016, SPS_created, 201LL); | |
| sp_SymIntHash_set(_t1016, SPS_accepted, 202LL); | |
| sp_SymIntHash_set(_t1016, SPS_no_content, 204LL); | |
| sp_SymIntHash_set(_t1016, SPS_moved_permanently, 301LL); | |
| sp_SymIntHash_set(_t1016, SPS_found, 302LL); | |
| sp_SymIntHash_set(_t1016, SPS_see_other, 303LL); | |
| sp_SymIntHash_set(_t1016, SPS_not_modified, 304LL); | |
| sp_SymIntHash_set(_t1016, SPS_bad_request, 400LL); | |
| sp_SymIntHash_set(_t1016, SPS_unauthorized, 401LL); | |
| sp_SymIntHash_set(_t1016, SPS_forbidden, 403LL); | |
| sp_SymIntHash_set(_t1016, SPS_not_found, 404LL); | |
| sp_SymIntHash_set(_t1016, SPS_unprocessable_entity, 422LL); | |
| sp_SymIntHash_set(_t1016, SPS_unprocessable_content, 422LL); | |
| sp_SymIntHash_set(_t1016, SPS_internal_server_error, 500LL); | |
| cst_ActionController_STATUS_CODES = (sp_SymIntHash *)sp_gc_freeze(_t1016); | |
| SP_GC_ROOT(cst_ActionController_STATUS_CODES); | |
| sp_StrStrHash *_t1017 = sp_StrStrHash_new(); | |
| SP_GC_ROOT(_t1017); | |
| sp_StrStrHash_set(_t1017, (&("\xff" "\\")[1]), (&("\xff" "\\\\")[1])); | |
| sp_StrStrHash_set(_t1017, (&("\xff" "\"")[1]), (&("\xff" "\\\"")[1])); | |
| sp_StrStrHash_set(_t1017, (&("\xff" "\n")[1]), (&("\xff" "\\n")[1])); | |
| sp_StrStrHash_set(_t1017, (&("\xff" "\r")[1]), (&("\xff" "\\r")[1])); | |
| sp_StrStrHash_set(_t1017, (&("\xff" "\t")[1]), (&("\xff" "\\t")[1])); | |
| sp_StrStrHash_set(_t1017, (&("\xff" "")[1]), (&("\xff" "\\b")[1])); | |
| sp_StrStrHash_set(_t1017, (&("\xff" "")[1]), (&("\xff" "\\f")[1])); | |
| cst_JsonBuilder_ESCAPES = (sp_StrStrHash *)sp_gc_freeze(_t1017); | |
| SP_GC_ROOT(cst_JsonBuilder_ESCAPES); | |
| cst_JsonBuilder_ESCAPE_PATTERN = 0; | |
| cst_Broadcasts_LOG = sp_PolyArray_new(); | |
| SP_GC_ROOT(cst_Broadcasts_LOG); | |
| cst_Broadcasts_TRANSPORTS = sp_IntArray_new(); | |
| SP_GC_ROOT(cst_Broadcasts_TRANSPORTS); | |
| sp_SymPolyHash *_t1018 = sp_SymPolyHash_new(); | |
| SP_GC_ROOT(_t1018); | |
| sp_SymPolyHash_set(_t1018, SPS_success, sp_box_range(sp_range_new(200LL, 299LL, 0))); | |
| sp_SymPolyHash_set(_t1018, SPS_redirect, sp_box_range(sp_range_new(300LL, 399LL, 0))); | |
| sp_SymPolyHash_set(_t1018, SPS_missing, sp_box_int(404LL)); | |
| sp_SymPolyHash_set(_t1018, SPS_not_found, sp_box_int(404LL)); | |
| sp_SymPolyHash_set(_t1018, SPS_error, sp_box_range(sp_range_new(500LL, 599LL, 0))); | |
| sp_SymPolyHash_set(_t1018, SPS_ok, sp_box_int(200LL)); | |
| sp_SymPolyHash_set(_t1018, SPS_created, sp_box_int(201LL)); | |
| sp_SymPolyHash_set(_t1018, SPS_no_content, sp_box_int(204LL)); | |
| sp_SymPolyHash_set(_t1018, SPS_moved_permanently, sp_box_int(301LL)); | |
| sp_SymPolyHash_set(_t1018, SPS_found, sp_box_int(302LL)); | |
| sp_SymPolyHash_set(_t1018, SPS_see_other, sp_box_int(303LL)); | |
| sp_SymPolyHash_set(_t1018, SPS_bad_request, sp_box_int(400LL)); | |
| sp_SymPolyHash_set(_t1018, SPS_unauthorized, sp_box_int(401LL)); | |
| sp_SymPolyHash_set(_t1018, SPS_forbidden, sp_box_int(403LL)); | |
| sp_SymPolyHash_set(_t1018, SPS_unprocessable_entity, sp_box_int(422LL)); | |
| sp_SymPolyHash_set(_t1018, SPS_unprocessable_content, sp_box_int(422LL)); | |
| sp_SymPolyHash_set(_t1018, SPS_internal_server_error, sp_box_int(500LL)); | |
| cst_RequestDispatch_STATUS_SYMBOLS = (sp_SymPolyHash *)sp_gc_freeze(_t1018); | |
| SP_GC_ROOT(cst_RequestDispatch_STATUS_SYMBOLS); | |
| cst_DbConn_CAP = 128LL; | |
| sp_clsbody_515(); | |
| sp_clsbody_3821(); | |
| #line 50 "test/models/../test_helper.rb" | |
| sp_Db_cls_configure((&("\xff" ":memory:")[1]), 8LL); | |
| #line 51 "test/models/../test_helper.rb" | |
| sp_StrArray * _t1019 = sp_Schema_cls_statements(); | |
| SP_GC_ROOT(_t1019); | |
| for (mrb_int _t1020 = 0; _t1020 < sp_StrArray_length(_t1019); _t1020++) { | |
| const char * lv_sql = sp_StrArray_get(_t1019, _t1020); | |
| sp_redo_38: ; | |
| sp_Db_cls_exec((const char *)lv_sql); | |
| } | |
| #line 35 "test/models/article_test.rb" | |
| lv___t = sp_ArticleTest_new(); | |
| #line 36 "test/models/article_test.rb" | |
| sp_Article_cls__adapter_truncate(); | |
| #line 37 "test/models/article_test.rb" | |
| sp_Comment_cls__adapter_truncate(); | |
| #line 38 "test/models/article_test.rb" | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| #line 39 "test/models/article_test.rb" | |
| sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| #line 40 "test/models/article_test.rb" | |
| sp_TestBase_setup((sp_TestBase *)lv___t); | |
| #line 41 "test/models/article_test.rb" | |
| sp_ArticleTest_test_creates_an_article_with_valid_attributes(lv___t); | |
| #line 42 "test/models/article_test.rb" | |
| sp_TestBase_teardown((sp_TestBase *)lv___t); | |
| #line 43 "test/models/article_test.rb" | |
| lv___t = sp_ArticleTest_new(); | |
| #line 44 "test/models/article_test.rb" | |
| sp_Article_cls__adapter_truncate(); | |
| #line 45 "test/models/article_test.rb" | |
| sp_Comment_cls__adapter_truncate(); | |
| #line 46 "test/models/article_test.rb" | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| #line 47 "test/models/article_test.rb" | |
| sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| #line 48 "test/models/article_test.rb" | |
| sp_TestBase_setup((sp_TestBase *)lv___t); | |
| #line 49 "test/models/article_test.rb" | |
| sp_ArticleTest_test_validates_title_presence(lv___t); | |
| #line 50 "test/models/article_test.rb" | |
| sp_TestBase_teardown((sp_TestBase *)lv___t); | |
| #line 51 "test/models/article_test.rb" | |
| lv___t = sp_ArticleTest_new(); | |
| #line 52 "test/models/article_test.rb" | |
| sp_Article_cls__adapter_truncate(); | |
| #line 53 "test/models/article_test.rb" | |
| sp_Comment_cls__adapter_truncate(); | |
| #line 54 "test/models/article_test.rb" | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| #line 55 "test/models/article_test.rb" | |
| sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| #line 56 "test/models/article_test.rb" | |
| sp_TestBase_setup((sp_TestBase *)lv___t); | |
| #line 57 "test/models/article_test.rb" | |
| sp_ArticleTest_test_validates_body_minimum_length(lv___t); | |
| #line 58 "test/models/article_test.rb" | |
| sp_TestBase_teardown((sp_TestBase *)lv___t); | |
| #line 59 "test/models/article_test.rb" | |
| lv___t = sp_ArticleTest_new(); | |
| #line 60 "test/models/article_test.rb" | |
| sp_Article_cls__adapter_truncate(); | |
| #line 61 "test/models/article_test.rb" | |
| sp_Comment_cls__adapter_truncate(); | |
| #line 62 "test/models/article_test.rb" | |
| sp_ArticlesFixtures_cls__fixtures_load_bang(); | |
| #line 63 "test/models/article_test.rb" | |
| sp_CommentsFixtures_cls__fixtures_load_bang(); | |
| #line 64 "test/models/article_test.rb" | |
| sp_TestBase_setup((sp_TestBase *)lv___t); | |
| #line 65 "test/models/article_test.rb" | |
| sp_ArticleTest_test_destroys_comments_when_article_is_destroyed(lv___t); | |
| #line 66 "test/models/article_test.rb" | |
| sp_TestBase_teardown((sp_TestBase *)lv___t); | |
| #line 67 "test/models/article_test.rb" | |
| { const char *_ps = (const char *)((&("\xff" "ArticleTest: 4 tests passed")[1])); if (_ps) { fputs(_ps, stdout); if (!*_ps || _ps[strlen(_ps)-1] != '\n') putchar('\n'); } else putchar('\n'); } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment