{: rooto:"YARD::CodeObjects::RootObject:@childrenIC:&YARD::CodeObjects::CodeObjectList[o:#YARD::CodeObjects::ClassObject;IC;[Io:$YARD::CodeObjects::MethodObject:@module_functionF: @scope: class:@visibility: public: @pathI"$Card.serializable_attr_accessor:EF:@parameters[[I" *args;T0: @files[[I"lib/card.rb;Ti:@current_file_has_commentsT: @name:serializable_attr_accessor:@source_type: ruby: @tags[:@docstrings{:@docstringIC:YARD::Docstring")attributes that ActiveJob can handle ;T: @object@ :@hash_flagF:@ref_tags[;[: @allI")attributes that ActiveJob can handle;T:@unresolved_reference0:@line_rangeo: Range: exclF: begini:endi:@namespace@:@signatureI"*def serializable_attr_accessor(*args);T:@explicitT: @sourceI"ndef self.serializable_attr_accessor *args self.serializable_attributes = args attr_accessor *args end;T: @dynamicTo; ; F; : instance;;;I"Card#follower_stash;F;[;[[@i;[I"lib/card.rb;TiB;F;:follower_stash;;;[;{;IC;"2Returns the value of attribute follower_stash ;T;@: @summary0;F;[;[; I"2Returns the value of attribute follower_stash;T;!0;'@;(I"def follower_stash;T;*I"-def follower_stash @follower_stash end;T;+To; ; F; ;,;;;I"Card#follower_stash=;F;[[I" value;T0;[[@i;[@!iB;F;:follower_stash=;;;[;{;IC;"&Sets the attribute follower_stash ;T;@*;.0;F;[;[o:YARD::Tags::Tag :@tag_nameI" param;F: @textI"6the value to set the attribute follower_stash to.;T;I" value;T: @types0;@*; I"eSets the attribute follower_stash @param value the value to set the attribute follower_stash to.;T;!0;'@;(I"def follower_stash=(value);T;*I"=def follower_stash=(value) @follower_stash = value end;T;+To:&YARD::CodeObjects::ConstantObject;[[@iE[@!iW;F;:TRACKED_FIELDS;;;;;[;{;IC;" ;T;@>;.0;F;[;[; I";T;!0;'@;I"Card::TRACKED_FIELDS;F;(I">TRACKED_FIELDS = %w(name type_id db_content trash).freeze;T;*I">TRACKED_FIELDS = %w(name type_id db_content trash).freeze;T: @valueI"-%w(name type_id db_content trash).freeze;T;+To:$YARD::CodeObjects::ModuleObject;IC;[o; ; F; ; ;;;I"Card::Env.reset;F;[[I" args;TI"{};T;[[I"lib/card/env.rb;Ti[I"lib/card/env.rb;Ti ;F;: reset;;;[;{;IC;" ;T;@N;.0;F;[;[; I";T;!0;'@L;(I"def reset(args={});T;)T;*I"def reset args={} @@env = { main_name: nil } if c = args[:controller] self[:controller] = c self[:session] = c.request.session self[:params] = c.params self[:ip] = c.request.remote_ip self[:ajax] = c.request.xhr? || c.request.params[:simulate_xhr] self[:html] = [nil, 'html'].member?(c.params[:format]) self[:host] = Card.config.override_host || c.request.env['HTTP_HOST'] self[:protocol] = Card.config.override_protocol || c.request.protocol end end;T;+To; ; F; ; ;;;I"Card::Env.[];F;[[I"key;T0;[[@Vi;F;:[];;;[;{;IC;" ;T;@a;.0;F;[;[; I";T;!0;'@L;(I"def [](key);T;)T;*I"'def [] key @@env[key.to_sym] end;T;+To; ; F; ; ;;;I"Card::Env.[]=;F;[[I"key;T0[I" value;T0;[[@Vi!;F;:[]=;;;[;{;IC;" ;T;@p;.0;F;[;[; I";T;!0;'@L;(I"def []=(key, value);T;)T;*I"7def []= key, value @@env[key.to_sym] = value end;T;+To; ; F; ; ;;;I"Card::Env.params;F;[;[[@Vi&[@Xi%;F;: params;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@L;(I"def params;T;)T;*I"*def params self[:params] ||= {} end;T;+To; ; F; ; ;;;I"Card::Env.session;F;[;[[@Vi*[@Xi);F;: session;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@L;(I"def session;T;)T;*I",def session self[:session] ||= {} end;T;+To; ; F; ; ;;;I"Card::Env.success;F;[[I" cardname;TI"nil;T;[[@Vi.[@Xi-;F;: success;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@L;(I"def success(cardname=nil);T;)T;*I"ddef success cardname=nil self[:success] ||= Card::Success.new(cardname, params[:success]) end;T;+To; ; F; ; ;;;I"Card::Env.ajax?;F;[;[[@Vi3[@Xi5;F;: ajax?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@L;(I"def ajax?;T;)T;*I" def ajax? self[:ajax] end;T;+To; ; F; ; ;;;I"Card::Env.html?;F;[;[[@Vi7[@Xi9;F;: html?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@L;(I"def html?;T;)T;*I"6def html? !self[:controller] || self[:html] end;T;+To; ; F; ; ;;;I"Card::Env.method_missing;F;[[I"method_id;T0[I" *args;T0;[[@Vi;[@Xi=;F;:method_missing;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@L;(I")def method_missing(method_id, *args);T;)T;*I"def method_missing method_id, *args case args.length when 0 ; self[ method_id ] when 1 ; self[ method_id ] = args[0] else ; super end end;T;+To;7;IC;[ o; ; F; ;,;;;I"0Card::Env::LocationHistory#location_history;F;[;[[@ViI;T;:location_history;;;[;{;IC;"include Card::Location ;T;@;F;[;[; I"include Card::Location;T;!0;"o;#;$F;%iG;&iG;'@;(I"def location_history;T;)T;*I"def location_history #warn "sess #{session.class}, #{session.object_id}" session[:history] ||= [Card::Location.card_path('')] if session[:history] session[:history].shift if session[:history].size > 5 session[:history] end end;T;+To; ; F; ;,;;;I"-Card::Env::LocationHistory#save_location;F;[[I" card;T0;[[@ViR[@XiO;F;:save_location;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def save_location(card);T;)T;*I"def save_location card return if Env.ajax? || !Env.html? || !card.known? || (card.codename == 'signin') discard_locations_for card session[:previous_location] = Card::Location.card_path card.cardname.url_key location_history.push previous_location end;T;+To; ; F; ;,;;;I"1Card::Env::LocationHistory#previous_location;F;[;[[@ViY[@Xi[;F;:previous_location;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def previous_location;T;)T;*I"jdef previous_location session[:previous_location] ||= location_history.last if location_history end;T;+To; ; F; ;,;;;I"5Card::Env::LocationHistory#discard_locations_for;F;[[I" card;T0;[[@Vi][@Xi`;F;:discard_locations_for;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"$def discard_locations_for(card);T;)T;*I".def discard_locations_for(card) # quoting necessary because cards have things like "+*" in the names.. session[:history] = location_history.reject do |loc| if url_key = url_key_for_location(loc) url_key.to_name.key == card.key end end.compact session[:previous_location] = nil end;T;+To; ; F; ;,;;;I"7Card::Env::LocationHistory#save_interrupted_action;F;[[I"uri;T0;[[@Vig[@Xij;F;:save_interrupted_action;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"%def save_interrupted_action(uri);T;)T;*I"Mdef save_interrupted_action uri session[:interrupted_action] = uri end;T;+To; ; F; ;,;;;I"2Card::Env::LocationHistory#interrupted_action;F;[;[[@Vik[@Xin;F;:interrupted_action;;;[;{;IC;" ;T;@/;.0;F;[;[; I";T;!0;'@;(I"def interrupted_action;T;)T;*I"Ddef interrupted_action session.delete :interrupted_action end;T;+To; ; F; ;,;;;I"4Card::Env::LocationHistory#url_key_for_location;F;[[I" location;T0;[[@Vio[@Xir;F;:url_key_for_location;;;[;{;IC;" ;T;@=;.0;F;[;[; I";T;!0;'@;(I"'def url_key_for_location(location);T;)T;*I"Xdef url_key_for_location(location) location.match( /\/([^\/]*$)/ ) ? $1 : nil end;T;+To; ; F; ;,;;;I".Card::Env::LocationHistory#save_location?;F;[[I" card;T0;[[@XiW;F;:save_location?;;;[;{;IC;" ;T;@M;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@M; I";T;!0;'@;(I"def save_location? card;T;)T;*I"hdef save_location? card !Env.ajax? && Env.html? && card.known? && (card.codename != 'signin') end;T;+T: @owner@:@class_mixinsIC;[;I@:@instance_mixinsIC;[;I@:@attributesIC:SymbolHash{; IC;M{:@symbolize_valueT;,IC;M{;NT;NT: @aliases{: @groups[;[[@ViF[@XiH;T;:LocationHistory;;;;;[;{;IC;"session history helpers: we keep a history stack so that in the case of card removal we can crawl back up to the last un-removed location ;T;@;F;[;[; I"session history helpers: we keep a history stack so that in the case of card removal we can crawl back up to the last un-removed location;T;!0;"o;#;$F;%iF;&iG;'@L;I"Card::Env::LocationHistory;F;+To; ; F; ; ;;;I" A$;F;[;[[@Xi1;F;:localhost?;;;[;{;IC;" ;T;@s;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@s; I";T;!0;'@L;(I"def localhost?;T;)T;*I"Ddef localhost? self[:host] && self[:host] =~ /^localhost/ end;T;+T;I@L;JIC;[o:YARD::CodeObjects::Proxy : @imethod0:@origname0:@orignamespace0;;Q;'@L: @obj@: @type: module;I@L;KIC;[;I@L;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Vi [@Xi ;T;:Env;;;;;[;{;IC;"BCard::Env can differ for each request; Card.config should not ;T;@L;F;[;[; I"BCard::Env can differ for each request; Card.config should not;T;!0;"o;#;$F;%i ;&i ;'@;I"Card::Env;F;+To;7;IC;[2o:+YARD::CodeObjects::ClassVariableObject;[[I"lib/card/set.rb;Ti;F;:@@modules;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::@@modules;F;(I"O@@modules = { base: [], base_format: {}, nonbase: {}, nonbase_format: {} };T;*I"O@@modules = { base: [], base_format: {}, nonbase: {}, nonbase_format: {} };T;6I"C{ base: [], base_format: {}, nonbase: {}, nonbase_format: {} };T;+To;7;IC;[o;[;[[@i\;F;: @@views;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::Format::@@views;F;(I"@@views = {};T;*I"@@views = {};T;6I"{};T;+To; ; F; ;,;;;I"Card::Set::Format#view;F;[[I" *args;T0[I" &block;T0;[[@i^[I"lib/card/set/format.rb;Ti';F;: view;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def view(*args, &block);T;)T;*I"def view view, *args, &block view = view.to_viewname.key.to_sym views[self] ||= {} view_block = views[self][view] = if block_given? Card::Format.extract_class_vars view, args[0] block else alias_block view, args end define_method "_view_#{ view }", view_block end;T;+To; ; F; ;,;;;I""Card::Set::Format#alias_block;F;[[I" view;T0[I" args;T0;[[@ij;F;:alias_block;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def alias_block view, args;T;)T;*I"def alias_block view, args opts = Hash===args[0] ? args.shift : { view: args.shift } opts[:mod] ||= self opts[:view] ||= view views[ opts[:mod] ][ opts[:view] ] or fail rescue raise "cannot find #{ opts[:view] } view in #{ opts[:mod] }; failed to alias #{view} in #{self}" end;T;+To; ; F; ;,;;;I"Card::Set::Format#format;F;[[I"*format_names;T0[I" &block;T0;[[@i;F;: format;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"%def format *format_names, &block;T;)T;*I"def format *format_names, &block if format_names.empty? format_names = [:base] elsif format_names.first == :all format_names = Card::Format.registered.reject { |f| Card::Format.aliases[f] } end format_names.each do |f| define_on_format f, &block end end;T;+To; ; F; ;,;;;I"'Card::Set::Format#define_on_format;F;[[I"format_name;TI" :base;T[I" &block;T0;[[@i-;F;:define_on_format;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"3def define_on_format format_name=:base, &block;T;)T;*I"def define_on_format format_name=:base, &block # format class name, eg. HtmlFormat klass = Card::Format.format_class_name format_name # called on current set module, eg Card::Set::Type::Pointer mod = const_get_or_set klass do # yielding set format module, eg Card::Set::Type::Pointer::HtmlFormat m = Module.new register_set_format Card.const_get(klass), m m.extend Card::Set::AbstractFormat m end mod.class_eval(&block) end;T;+To; ; F; ;,;;;I"*Card::Set::Format#register_set_format;F;[[I"format_class;T0[I"mod;T0;[[@i<;F;:register_set_format;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I".def register_set_format format_class, mod;T;)T;*I"|def register_set_format format_class, mod if all_set? all_set_format_mod! format_class, mod else format_type = abstract_set? ? :abstract_format : :nonbase_format # ready to include dynamically in set members' format singletons format_hash = modules[format_type][format_class] ||= {} format_hash[shortname] ||= [] format_hash[shortname] << mod end end;T;+To; ; F; ;,;;;I"*Card::Set::Format#all_set_format_mod!;F;[[I"format_class;T0[I"mod;T0;[[@iI;T;:all_set_format_mod!;;;[;{;IC;"Hmake mod ready to include in base (non-set-specific) format classes ;T;@;F;[;[; I"Hmake mod ready to include in base (non-set-specific) format classes;T;!0;"o;#;$F;%iH;&iH;'@;(I".def all_set_format_mod! format_class, mod;T;)T;*I"def all_set_format_mod! format_class, mod modules[:base_format][format_class] ||= [] modules[:base_format][format_class] << mod end;T;+To; ; F; ;,;;;I""Card::Set::Format#each_format;F;[[I"set;T0;[[@iN;F;:each_format;;;[;{;IC;" ;T;@!;.0;F;[;[; I";T;!0;'@;(I"def each_format set;T;)T;*I""def each_format set set_type = set.abstract_set? ? :abstract : :nonbase format_type = "#{set_type}_format".to_sym modules[format_type].each_pair do |format, set_format_mod_hash| next unless (format_mods = set_format_mod_hash[set.shortname]) yield format, format_mods end end;T;+To; ; F; ;,;;;I")Card::Set::Format#applicable_format?;F;[[I" format;T0[I" except;T0[I" only;T0;[[@iW;F;:applicable_format?;;;[;{;IC;" ;T;@0;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@0; I";T;!0;'@;(I"0def applicable_format? format, except, only;T;)T;*I"def applicable_format? format, except, only return false if except && Array(except).include?(format) return false if only && !Array(only).include?(format) true end;T;+To;7;IC;[o; ; F; ;,;;;I"+Card::Set::Format::AbstractFormat#view;F;[[I" view;T0[I" *args;T0[I" &block;T0;[[@ia;F;;^;;;[;{;IC;" ;T;@J;.0;F;[;[; I";T;!0;'@H;(I"!def view view, *args, &block;T;)T;*I"def view view, *args, &block view = view.to_viewname.key.to_sym views[self] ||= {} view_block = views[self][view] = if block_given? Card::Format.extract_class_vars view, args[0] block else lookup_alias_block view, args end define_method "_view_#{view}", view_block end;T;+To; ; F; ;,;;;I"9Card::Set::Format::AbstractFormat#lookup_alias_block;F;[[I" view;T0[I" args;T0;[[@in;F;:lookup_alias_block;;;[;{;IC;" ;T;@];.0;F;[;[; I";T;!0;'@H;(I"&def lookup_alias_block view, args;T;)T;*I"3def lookup_alias_block view, args opts = args[0].is_a?(Hash) ? args.shift : { view: args.shift } opts[:mod] ||= self opts[:view] ||= view views[opts[:mod]][opts[:view]] || begin raise "cannot find #{opts[:view]} view in #{opts[:mod]}; " \ "failed to alias #{view} in #{self}" end end;T;+T;I@H;JIC;[;I@H;KIC;[;I@H;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i];F;:AbstractFormat;;;;;[;{;IC;" ;T;@H;.0;F;[;[; I";T;!0;'@;I"&Card::Set::Format::AbstractFormat;F;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@iZ[@i;T;: Format;;;;;[;{;IC;"Whenever a Format object is instantiated for a card, it includes all views associated with BOTH (a) sets of which the card is a member and (b) the current format or its ancestors. More on defining views below. View definitions When you declare: view :view_name do |args| #...your code here end Methods are defined on the format The external api with checks: render(:viewname, args) ;T;@;F;[;[; I" Whenever a Format object is instantiated for a card, it includes all views associated with BOTH (a) sets of which the card is a member and (b) the current format or its ancestors. More on defining views below. View definitions When you declare: view :view_name do |args| #...your code here end Methods are defined on the format The external api with checks: render(:viewname, args);T;!0;"o;#;$F;%i ;&i;'@;I"Card::Set::Format;F;+To; ; F; ;,;;;I"Card::Set#format;F;[[I"*format_names;T0[I" &block;T0;[[@iv;F;;`;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"%def format *format_names, &block;T;)T;*I"def format *format_names, &block if format_names.empty? format_names = [:base] elsif format_names.first == :all format_names = Card::Format.registered.reject {|f| Card::Format.aliases[f]} end format_names.each do |f| define_on_format f, &block end end;T;+To; ; F; ;,;;;I"Card::Set#define_on_format;F;[[I"format_name;TI" :base;T[I" &block;T0;[[@i|;F;;a;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"3def define_on_format format_name=:base, &block;T;)T;*I"def define_on_format format_name=:base, &block klass = Card::Format.format_class_name format_name # format class name, eg. HtmlFormat mod = const_get_or_set klass do # called on current set module, eg Card::Set::Type::Pointer m = Module.new # yielding set format module, eg Card::Set::Type::Pointer::HtmlFormat register_set_format Card.const_get(klass), m m.extend Card::Set::Format m end mod.class_eval &block end;T;+To; ; F; ;,;;;I"Card::Set#view;F;[[I" *args;T0[I" &block;T0;[[@i;F;;^;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def view *args, &block;T;)T;*I"Hdef view *args, &block format do view *args, &block end end;T;+To; ; F; ;,;;;I"Card::Set#event;F;[[I" event;T0[I" opts;TI"{};T[I" &final;T0;[[@i;F;: event;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"%def event event, opts={}, &final;T;)T;*I"def event event, opts={}, &final perform_later = (opts[:before] == :subsequent) || (opts[:after] == :subsequent) final_method = "#{event}_without_callbacks" #should be private? opts[:on] = [:create, :update ] if opts[:on] == :save Card.define_callbacks event class_eval do define_method final_method, &final end if perform_later defer_method = "#{event}_perform_later" define_event_perform_later_method event, defer_method define_active_job event, final_method, opts[:queue_as] define_event_method event, defer_method, opts else define_event_method event, final_method, opts end set_event_callbacks event, opts end;T;+To; ; F; ;,;;;I"0Card::Set#define_event_perform_later_method;F;[[I" event;T0[I"method_name;T0;[[@i;F;:&define_event_perform_later_method;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"=def define_event_perform_later_method event, method_name;T;)T;*I"]def define_event_perform_later_method event, method_name class_eval do define_method method_name, proc { s_attr = self.serializable_attributes.each_with_object({}) do |name, hash| value = self.instance_variable_get("@#{name}") hash[name] = if Symbol === value # ActiveJob doesn't accept symbols as arguments { value: value.to_s, symbol: true } else { value: value } end end Object.const_get(event.to_s.camelize).perform_later(self, s_attr) } end end;T;+To; ; F; ;,;;;I""Card::Set#define_event_method;F;[[I" event;T0[I"call_method;T0[I" opts;T0;[[@i;F;:define_event_method;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"5def define_event_method event, call_method, opts;T;)T;*I"def define_event_method event, call_method, opts class_eval do define_method event do run_callbacks event do send call_method end end end end;T;+To; ; F; ;,;;;I" Card::Set#define_active_job;F;[[I" name;T0[I"final_method;T0[I" queue;TI" :default;T;[[@i;T;:define_active_job;;;[;{;IC;"creates an Active Job. The scheduled job gets the card object as argument and all serializable attributes of the card. (when the job is executed ActiveJob fetches the card from the database so all attributes get lost) ;T;@;F;[;[ o;0 ;1I" param;F;2I"+the name for the ActiveJob child class;T;I" name;T;3[I" String;T;@o;0 ;1I" param;F;2I"6the name of the card instance method to be queued;T;I"final_method;T;3[I" String;T;@o:YARD::Tags::OptionTag ;1I" option;F;20;I" queue;T;30: @pairo:YARD::Tags::DefaultTag ;1I" option;F;2I"the name of the queue;T;I"(:default);T;3[I" Symbol;T:@defaults0;@o;0 ;1I" param;F;2I""a customizable set of options;T;@;3[I" Hash;T;@; I"creates an Active Job. The scheduled job gets the card object as argument and all serializable attributes of the card. (when the job is executed ActiveJob fetches the card from the database so all attributes get lost) @param name [String] the name for the ActiveJob child class @param final_method [String] the name of the card instance method to be queued @option queue [Symbol] (:default) the name of the queue;T;!0;"o;#;$F;%i;&i;'@;(I"?def define_active_job name, final_method, queue = :default;T;)T;*I"xdef define_active_job name, final_method, queue = :default class_name = name.to_s.camelize eval %{ class ::#{class_name} < ActiveJob::Base queue_as #{queue} end } Object.const_get(class_name).class_eval do define_method :perform, proc { |card, attributes| attributes.each do |name, args| # symbols are not allowed so all symbols arrive here as strings # convert strings that were symbols before back to symbols value = args[:symbol] ? args[:value].to_sym : args[:value] card.instance_variable_set("@#{name}", value ) end card.send final_method } end end;T;+To; ; F; ;,;;;I"Card::Set#card_accessor;F;[[I" *args;T0;[[@i;T;:card_accessor;;;[;{;IC;";ActiveCard support: accessing plus cards as attributes ;T;@+;F;[;[; I"= ActiveCard support: accessing plus cards as attributes ;T;!0;"o;#;$F;%i;&i;'@;(I"def card_accessor *args;T;)T;*I"|def card_accessor *args options = args.extract_options! add_traits args, options.merge( reader: true, writer: true ) end;T;+To; ; F; ;,;;;I"Card::Set#card_reader;F;[[I" *args;T0;[[@i;F;:card_reader;;;[;{;IC;" ;T;@;;.0;F;[;[; I";T;!0;'@;(I"def card_reader *args;T;)T;*I"qdef card_reader *args options = args.extract_options! add_traits args, options.merge( reader: true ) end;T;+To; ; F; ;,;;;I"Card::Set#card_writer;F;[[I" *args;T0;[[@i;F;:card_writer;;;[;{;IC;" ;T;@J;.0;F;[;[; I";T;!0;'@;(I"def card_writer *args;T;)T;*I"qdef card_writer *args options = args.extract_options! add_traits args, options.merge( writer: true ) end;T;+To; ; F; ;,;;;I"Card::Set#ensure_set;F;[[I" &block;T0;[[@i[I"lib/card/set.rb;Ti;F;:ensure_set;;;[;{;IC;" ;T;@Y;.0;F;[;[; I";T;!0;'@;(I"def ensure_set(&block);T;)T;*I"def ensure_set &block begin set_module = block.call rescue NameError => e if e.message.match /uninitialized constant (?:Card::Set::)?(.+)$/ $1.split('::').inject(Card::Set) do |set_module, module_name| set_module.const_get_or_set module_name do Module.new end end end ensure_set &block # try again - there might be another submodule that doesn't exist else set_module.extend Card::Set end end;T;+To; ; F; ; ;;;I"Card::Set.extended;F;[[I"mod;T0;[[@i ;T;: extended;;;[;{;IC;"7each set file calls `extend Card::Set` when loaded ;T;@j;F;[;[; I"7each set file calls `extend Card::Set` when loaded;T;!0;"o;#;$F;%i ;&i ;'@;(I"def extended mod;T;)T;*I",def extended mod register_set mod end;T;+To; ; F; ; ;;;I"Card::Set.register_set;F;[[I"set_module;T0;[[@i;T;:register_set;;;[;{;IC;"#make the set available for use ;T;@z;F;[;[; I"#make the set available for use;T;!0;"o;#;$F;%i;&i;'@;(I" def register_set set_module;T;)T;*I"def register_set set_module if set_module.abstract_set? # noop; only used by explicit inclusion in other set modules elsif set_module.all_set? # automatically included in Card class modules[ :base ] << set_module else # made ready for dynamic loading via #include_set_modules modules[ :nonbase ][ set_module.shortname ] ||= [] modules[ :nonbase ][ set_module.shortname ] << set_module end end;T;+To; ; F; ; ;;;I"Card::Set.write_tmp_file;F;[[I"from_file;T0[I" to_file;T0[I" rel_path;T0;[[@i;F;:write_tmp_file;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"4def write_tmp_file from_file, to_file, rel_path;T;)T;*I"Xdef write_tmp_file from_file, to_file, rel_path name_parts = rel_path.gsub(/\.rb/,'').split(File::SEPARATOR) submodules = name_parts.map { |a| "module #{a.camelize};" } * ' ' file_content = <;F;:process_base_module_list;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"-def process_base_module_list list, klass;T;)T;*I"def process_base_module_list list, klass list.each do |mod| if mod.instance_methods.any? klass.send :include, mod end if class_methods = mod.const_get_if_defined( :ClassMethods ) klass.send :extend, class_methods end end end;T;+To; ; F; ; ;;;I""Card::Set.clean_empty_modules;F;[;[[@iI;F;:clean_empty_modules;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def clean_empty_modules;T;)T;*I"def clean_empty_modules clean_empty_module_from_hash modules[ :nonbase ] modules[ :nonbase_format ].values.each do |hash| clean_empty_module_from_hash hash end end;T;+To; ; F; ; ;;;I"+Card::Set.clean_empty_module_from_hash;F;[[I" hash;T0;[[@iP;F;:!clean_empty_module_from_hash;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"*def clean_empty_module_from_hash hash;T;)T;*I"def clean_empty_module_from_hash hash hash.each do |mod_name, modlist| modlist.delete_if { |x| x.instance_methods.empty? } hash.delete mod_name if modlist.empty? end end;T;+To; ; F; ;,;;;I""Card::Set#register_set_format;F;[[I"format_class;T0[I"mod;T0;[[@iZ;F;;b;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I".def register_set_format format_class, mod;T;)T;*I"def register_set_format format_class, mod if self.abstract_set? # noop; only used by explicit inclusion in other set modules elsif self.all_set? # ready to include in base format classes modules[ :base_format ][ format_class ] ||= [] modules[ :base_format ][ format_class ] << mod else # ready to include dynamically in set members' format singletons format_hash = modules[ :nonbase_format ][ format_class ] ||= {} format_hash[ shortname ] ||= [] format_hash[ shortname ] << mod end end;T;+To; ; F; ;,;;;I"Card::Set#shortname;F;[;[[@ii[@ai;F;:shortname;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def shortname;T;)T;*I"def shortname parts = name.split '::' first = 2 # shortname eliminates Card::Set set_class = Card::SetPattern.find parts[first].underscore last = first + set_class.anchor_parts_count parts[first..last].join '::' end;T;+To; ; F; ;,;;;I"Card::Set#abstract_set?;F;[;[[@ir[@ai;F;:abstract_set?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def abstract_set?;T;)T;*I"=def abstract_set? name =~ /^Card::Set::Abstract::/ end;T;+To; ; F; ;,;;;I"Card::Set#all_set?;F;[;[[@iv[@ai;F;: all_set?;;;[;{;IC;" ;T;@ ;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@ ; I";T;!0;'@;(I"def all_set?;T;)T;*I"3def all_set? name =~ /^Card::Set::All::/ end;T;+To; ; F; ;,;: private;I""Card::Set#set_event_callbacks;F;[[I" event;T0[I" opts;T0;[[@i};F;:set_event_callbacks;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"(def set_event_callbacks event, opts;T;)T;*I"udef set_event_callbacks event, opts [:before, :after, :around].each do |kind| if object_method = opts.delete(kind) this_set_module = self Card.class_eval do set_callback object_method, kind, event, prepend: true, if: proc { |c| c.singleton_class.include?( this_set_module ) and c.event_applies? opts } end end end end;T;+To; ; F; ;,;;;I"Card::Set#get_traits;F;[[I"mod;T0;[[@i;F;:get_traits;;;[;{;IC;" ;T;@.;.0;F;[;[; I";T;!0;'@;(I"def get_traits mod;T;)T;*I"kdef get_traits mod Card::Set.traits ||= {} Card::Set.traits[mod] or Card::Set.traits[mod] = {} end;T;+To; ; F; ;,;;;I"Card::Set#add_traits;F;[[I" args;T0[I" options;T0;[[@i;F;:add_traits;;;[;{;IC;" ;T;@=;.0;F;[;[; I";T;!0;'@;(I"!def add_traits args, options;T;)T;*I"def add_traits args, options mod = self # raise "Can't define card traits on all set" if mod == Card mod_traits = get_traits mod new_opts = options[:type] ? {type: options[:type]} : {} new_opts.merge!( {content: options[:default]} ) if options[:default] args.each do |trait| define_trait_card trait, new_opts define_trait_reader trait if options[:reader] define_trait_writer trait if options[:writer] mod_traits[trait.to_sym] = options end end;T;+To; ; F; ;,;;;I" Card::Set#define_trait_card;F;[[I" trait;T0[I" opts;T0;[[@i;F;:define_trait_card;;;[;{;IC;" ;T;@N;.0;F;[;[; I";T;!0;'@;(I"&def define_trait_card trait, opts;T;)T;*I"def define_trait_card trait, opts define_method "#{trait}_card" do trait_var "@#{trait}_card" do fetch trait: trait.to_sym, new: opts.clone end end end;T;+To; ; F; ;,;;;I""Card::Set#define_trait_reader;F;[[I" trait;T0;[[@i;F;:define_trait_reader;;;[;{;IC;" ;T;@_;.0;F;[;[; I";T;!0;'@;(I""def define_trait_reader trait;T;)T;*I"def define_trait_reader trait define_method trait do trait_var "@#{trait}" do send( "#{trait}_card" ).content end end end;T;+To; ; F; ;,;;;I""Card::Set#define_trait_writer;F;[[I" trait;T0;[[@i;F;:define_trait_writer;;;[;{;IC;" ;T;@n;.0;F;[;[; I";T;!0;'@;(I""def define_trait_writer trait;T;)T;*I"def define_trait_writer trait define_method "#{trait}=" do |value| card = send "#{trait}_card" self.subcards ||= {} self.subcards[card.name] = {type_id: card.type_id, content: value } instance_variable_set "@#{trait}", value end end;T;+To; ; F; ;,;;;I"&Card::Set#set_specific_attributes;F;[[I" *args;T0;[[@i;F;:set_specific_attributes;;;[;{;IC;" ;T;@};.0;F;[;[; I";T;!0;'@;(I"&def set_specific_attributes *args;T;)T;*I"~def set_specific_attributes *args Card.set_specific_attributes ||= [] Card.set_specific_attributes += args.map(&:to_s) end;T;+To; ; F; ;,;;;I"Card::Set#attachment;F;[[I" name;T0[I" args;T0;[[@i[@ai;F;:attachment;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def attachment(name, args);T;)T;*I"def attachment name, args include Abstract::Attachment set_specific_attributes name, :load_from_mod, "remote_#{name}_url".to_sym, uploader_class = args[:uploader] || FileUploader mount_uploader name, uploader_class end;T;+To;7;IC;[1o;7;IC;[;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;:Set;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"*tmpsets/set/mod001-01_core/all/erb.rb;Ti;F;:Erb;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Erb;F;+To;7;IC;[o; ; F; ;,;;;I"Card::Set::All::Name#name=;F;[[I" newname;T0;[[I"+tmpsets/set/mod001-01_core/all/name.rb;Ti [I"+tmpsets/set/mod001-01_core/all/name.rb;Ti;F;: name=;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def name=(newname);T;)T;*I"def name= newname cardname = newname.to_name if @supercard @relative_name = cardname.to_s relparts = @relative_name.to_name.parts @superleft = @supercard if relparts.size==2 && relparts.first.blank? cardname = @relative_name.to_name.to_absolute_name @supercard.name end newkey = cardname.key if key != newkey self.key = newkey reset_patterns_if_rule # reset the old name - should be handled in tracked_attributes!! reset_patterns end subcards.each do |subkey, subcard| next unless Card===subcard subcard.name = subkey.to_name.to_absolute cardname end write_attribute :name, cardname.s end;T;+To; ; F; ;,;;;I""Card::Set::All::Name#cardname;F;[;[[@i"[@i8;F;: cardname;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def cardname;T;)T;*I"$def cardname name.to_name end;T;+To; ; F; ;,;;;I""Card::Set::All::Name#autoname;F;[[I" name;T0;[[@i&[@i<;F;: autoname;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def autoname(name);T;)T;*I"^def autoname name if Card.exists? name autoname name.next else name end end;T;+To; ; F; ;,;;;I"!Card::Set::All::Name#simple?;F;[;[[@i/[@iE;T;: simple?;;;[;{;IC;">FIXME: use delegations and include all cardname functions ;T;@;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I">FIXME: use delegations and include all cardname functions;T;!0;"o;#;$F;%iD;&iD;'@;(I"def simple?;T;)T;*I"'def simple? cardname.simple? end;T;+To; ; F; ;,;;;I"#Card::Set::All::Name#junction?;F;[;[[@i3[@iI;F;:junction?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def junction?;T;)T;*I"+def junction? cardname.junction? end;T;+To; ; F; ;,;;;I"'Card::Set::All::Name#relative_name;F;[[I"context_name;TI"nil;T;[[@i8[@iQ;F;:relative_name;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"(def relative_name(context_name=nil);T;)T;*I"3def relative_name @relative_name || name end;T;+To; ; F; ;,;;;I"Card::Set::All::Name#left;F;[[I" *args;T0;[[@i<[@i_;F;: left;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def left(*args);T;)T;*I"def left *args if !simple? @superleft or begin unless name_changed? and name.to_name.trunk_name.key == name_was.to_name.key # prevent recursion when, eg, renaming A+B to A+B+C Card.fetch cardname.left, *args end end end end;T;+To; ; F; ;,;;;I"Card::Set::All::Name#right;F;[[I" *args;T0;[[@iG[@ij;F;: right;;;[;{;IC;" ;T;@/;.0;F;[;[; I";T;!0;'@;(I"def right(*args);T;)T;*I"Jdef right *args Card.fetch( cardname.right, *args ) if !simple? end;T;+To; ; F; ;,;;;I"Card::Set::All::Name#[];F;[[I" *args;T0;[[@iK[@in;F;;9;;;[;{;IC;" ;T;@?;.0;F;[;[; I";T;!0;'@;(I"def [](*args);T;)T;*I"def [] *args if args[0].kind_of?(Fixnum) || args[0].kind_of?(Range) fetch_name = Array.wrap(cardname.parts[args[0]]).compact.join '+' Card.fetch( fetch_name, args[1] || {} ) if !simple? else super end end;T;+To; ; F; ;,;;;I"Card::Set::All::Name#trunk;F;[[I" *args;T0;[[@iT[@ix;F;: trunk;;;[;{;IC;" ;T;@O;.0;F;[;[; I";T;!0;'@;(I"def trunk(*args);T;)T;*I"9def trunk *args simple? ? self : left( *args ) end;T;+To; ; F; ;,;;;I"Card::Set::All::Name#tag;F;[[I" *args;T0;[[@iX[@i|;F;:tag;;;[;{;IC;" ;T;@_;.0;F;[;[; I";T;!0;'@;(I"def tag(*args);T;)T;*I"Mdef tag *args simple? ? self : Card.fetch( cardname.right, *args ) end;T;+To; ; F; ;,;;;I"%Card::Set::All::Name#left_or_new;F;[[I" args;TI"{};T;[[@i\[@i{;F;:left_or_new;;;[;{;IC;" ;T;@o;.0;F;[;[; I";T;!0;'@;(I"def left_or_new(args={});T;)T;*I"Ydef left_or_new args={} left args or Card.new args.merge(:name=>cardname.left) end;T;+To; ; F; ;,;;;I""Card::Set::All::Name#children;F;[;[[@i`[@i;F;: children;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def children;T;)T;*I"Qdef children Card.search( { (simple? ? :part : :left) => name } ).to_a end;T;+To; ; F; ;,;;;I"$Card::Set::All::Name#dependents;F;[;[[@id;F;:dependents;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def dependents;T;)T;*I"?def dependents return [] if new_card? if @dependents.nil? @dependents = Auth.as_bot do deps = children deps.inject(deps) do |array, card| array + card.dependents end end #Rails.logger.warn "dependents[#{inspect}] #{@dependents.inspect}" end @dependents end;T;+To; ; F; ;,;;;I"$Card::Set::All::Name#repair_key;F;[;[[@it[@i;F;:repair_key;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def repair_key;T;)T;*I"def repair_key Auth.as_bot do correct_key = cardname.key current_key = key return self if current_key==correct_key if key_blocker = Card.find_by_key_and_trash(correct_key, true) key_blocker.cardname = key_blocker.cardname + "*trash#{rand(4)}" key_blocker.save end saved = ( self.key = correct_key and self.save! ) saved ||= ( self.cardname = current_key and self.save! ) if saved self.dependents.each { |c| c.repair_key } else Rails.logger.debug "FAILED TO REPAIR BROKEN KEY: #{key}" self.name = "BROKEN KEY: #{name}" end self end rescue Rails.logger.info "BROKE ATTEMPTING TO REPAIR BROKEN KEY: #{key}" self end;T;+To; ; F; ;,;;;I"&Card::Set::All::Name#suspend_name;F;[[I" name;T0;[[@i[@i;F;:suspend_name;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def suspend_name(name);T;)T;*I"$def suspend_name(name) # move the current card out of the way, in case the new name will require # re-creating a card with the current name, ie. A -> A+B Card.expire name tmp_name = "tmp:" + UUID.new.generate Card.where(:id=>self.id).update_all(:name=>tmp_name, :key=>tmp_name) end;T;+To;7;IC;[o; ; F; ;,;;;I"5Card::Set::All::Name::ClassMethods#uniquify_name;F;[[I" name;T0[I" rename;TI" :new;T;[[@i ;F;:uniquify_name;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"(def uniquify_name name, rename=:new;T;)T;*I"def uniquify_name name, rename=:new return name unless Card.exists?(name) uniq_name = "#{name} 1" while Card.exists?(uniq_name) uniq_name.next! end if rename == :old # name conflict resolved; original name can be used Card[name].update_attributes! name: uniq_name, update_referencers: true name else uniq_name end end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i ;F;:ClassMethods;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"'Card::Set::All::Name::ClassMethods;F;+To; ; F; ;,;;;I")Card::Set::All::Name#contextual_name;F;[;[[@iM;F;:contextual_name;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def contextual_name;T;)T;*I"7def contextual_name @contextual_name || name end;T;+To; ; F; ;,;;;I"'Card::Set::All::Name#absolute_name;F;[[I"context_name;TI"nil;T;[[@iX;F;:absolute_name;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"'def absolute_name context_name=nil;T;)T;*I"def absolute_name context_name=nil if !context_name && @supercard context_name = @supercard.cardname end cardname.absolute_name(context_name) end;T;+To; ; F; ;,;;;I" Card::Set::All::Name#fields;F;[;[[@i;F;: fields;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def fields;T;)T;*I";def fields field_names.map { |name| Card[name] } end;T;+To; ; F; ;,;;;I"%Card::Set::All::Name#field_names;F;[[I"parent_name;TI"nil;T;[[@i;F;:field_names;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"$def field_names parent_name=nil;T;)T;*I"Idef field_names parent_name=nil child_names parent_name, :left end;T;+To; ; F; ;,;;;I"%Card::Set::All::Name#child_names;F;[[I"parent_name;TI"nil;T[I" side;TI"nil;T;[[@i;F;:child_names;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I".def child_names parent_name=nil, side=nil;T;)T;*I" def child_names parent_name=nil, side=nil # eg, A+B is a child of A and B parent_name ||= name side ||= parent_name.to_name.simple? ? :part : :left Card.search({ side => parent_name, return: :name }, "(#{side}) children of #{parent_name}") end;T;+To; ; F; ;,;;;I"*Card::Set::All::Name#descendant_names;F;[[I"parent_name;TI"nil;T;[[@i;F;:descendant_names;;;[;{;IC;" ;T;@*;.0;F;[;[; I";T;!0;'@;(I")def descendant_names parent_name=nil;T;)T;*I"def descendant_names parent_name=nil return [] if new_card? parent_name ||= name Auth.as_bot do deps = child_names parent_name deps.inject(deps) do |array, childname| array + descendant_names(childname) end end end;T;+To; ; F; ;,;;;I"%Card::Set::All::Name#descendants;F;[;[[@i;F;:descendants;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@;(I"def descendants;T;)T;*I"def descendants # children and children's children # NOTE - set modules are not loaded # -- should only be used for name manipulations @descendants ||= descendant_names.map { |name| Card.quick_fetch name } end;T;+To; ; F; ;,;;;I"4Card::Set::All::Name#execute_referencers_update;F;[[I"descendants;T0;[[@i>;F;:execute_referencers_update;;;[;{;IC;" ;T;@G;.0;F;[;[; I";T;!0;'@;(I"/def execute_referencers_update descendants;T;)T;*I"def execute_referencers_update descendants Auth.as_bot do [name_referencers(name_was) + descendants.map(&:referencers)] .flatten.uniq.each do |card| # FIXME: using 'name_referencers' instead of plain 'referencers' for self # because there are cases where trunk and tag # have already been saved via association by this point and therefore # referencers misses things # eg. X includes Y, and Y is renamed to X+Z. When X+Z is saved, X is # first updated as a trunk before X+Z gets to this point. # so at this time X is still including Y, which does not exist. # therefore #referencers doesn't find it, but name_referencers(old_name) # does. # some even more complicated scenario probably breaks on the descendants, # so this probably needs a more thoughtful refactor # aligning the dependent saving with the name cascading Rails.logger.debug "------------------ UPDATE REFERER #{card.name} " \ '------------------------' unless card == self || card.structure card = card.refresh card.db_content = card.replace_references name_was, name card.save! end end end end;T;+T;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;: Name;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Name;F;+To;7;IC;[;I@h;JIC;[o;S ;T0;UI"Card::Set;T;V@h;;;'@;W@;X;Y;I@h;KIC;[;I@h;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"+tmpsets/set/mod001-01_core/all/haml.rb;Ti;F;: Haml;;;;;[;{;IC;" ;T;@h;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Haml;F;+To;7;IC;[o;7;IC;[o; ; F; ;,;;;I"7Card::Set::All::Type::ClassMethods#default_type_id;F;[;[[I"+tmpsets/set/mod001-01_core/all/type.rb;Ti [I"+tmpsets/set/mod001-01_core/all/type.rb;Ti ;F;:default_type_id;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def default_type_id;T;)T;*I"adef default_type_id @@default_type_id ||= Card[:all].fetch( :trait=>:default ).type_id end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i [@i ;T;;;;;;;[;{;IC;"~~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/type.rb ~~~~~~~~~~~ ;T;@;F;[;[; I"~~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/type.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@};I"'Card::Set::All::Type::ClassMethods;F;+To; ; F; ;,;;;I"#Card::Set::All::Type#type_card;F;[;[[@i[@i;F;:type_card;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@};(I"def type_card;T;)T;*I"^def type_card return if type_id.nil? Card.fetch type_id.to_i, :skip_modules=>true end;T;+To; ; F; ;,;;;I"#Card::Set::All::Type#type_code;F;[;[[@i[@i;F;:type_code;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@};(I"def type_code;T;)T;*I"7def type_code Card::Codename[ type_id.to_i ] end;T;+To; ; F; ;,;;;I"#Card::Set::All::Type#type_name;F;[;[[@i[@i;F;:type_name;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@};(I"def type_name;T;)T;*I",def type_name type_card.try :name end;T;+To; ; F; ;,;;;I"'Card::Set::All::Type#type_cardname;F;[;[[@i[@i!;F;:type_cardname;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@};(I"def type_cardname;T;)T;*I"4def type_cardname type_card.try :cardname end;T;+To; ; F; ;,;;;I"Card::Set::All::Type#type=;F;[[I"type_name;T0;[[@i [@i%;F;: type=;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@};(I"def type=(type_name);T;)T;*I"Edef type= type_name self.type_id = Card.fetch_id type_name end;T;+To; ; F; ;,;;;I"%Card::Set::All::Type#get_type_id;F;[[I" args;TI"{};T;[[@i$;F;:get_type_id;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@};(I"def get_type_id args={};T;)T;*I"Vdef get_type_id args={} return if args[:type_id] # type_id was set explicitly. no need to set again. type_id = case when args[:type_code] if code=args[:type_code] Card::Codename[code] || ( c=Card[code] and c.id) end when args[:type] Card.fetch_id args[:type] else :noop end case type_id when :noop when false, nil errors.add :type, "#{args[:type] || args[:type_code]} is not a known type." else return type_id end if name && t=template reset_patterns #still necessary even with new template handling? t.type_id end end;T;+To; ; F; ;,;;;I".Card::Set::All::Type#type_name_or_default;F;[;[[@i;F;:type_name_or_default;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@};(I"def type_name_or_default;T;)T;*I"gdef type_name_or_default type_card.try(:name) || Card.quick_fetch(Card.default_type_id).name end;T;+To; ; F; ;,;;;I"4Card::Set::All::Type#get_type_id_from_structure;F;[;[[@i);F;:get_type_id_from_structure;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@};(I"#def get_type_id_from_structure;T;)T;*I"def get_type_id_from_structure return unless name && (t = template) reset_patterns # still necessary even with new template handling? t.type_id end;T;+T;I@};JIC;[o;S ;T0;UI"Card::Set;T;V@};;;'@;W@;X;Y;I@};KIC;[;I@};LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;: Type;;;;;[;{;IC;" ;T;@};.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Type;F;+To;7;IC;[ o;7;IC;[o; ; F; ;,;;;I"4Card::Set::All::Utils::ClassMethods#empty_trash;F;[;[[I",tmpsets/set/mod001-01_core/all/utils.rb;Ti ;F;:empty_trash;;;[;{;IC;" ;T;@+;.0;F;[;[; I";T;!0;'@);(I"def empty_trash;T;)T;*I"def empty_trash Card.delete_trashed_files Card.where(:trash=>true).delete_all Card::Action.delete_cardless Card::Reference.repair_missing_referees Card::Reference.delete_missing_referers end;T;+To; ; F; ;,;;;I"=Card::Set::All::Utils::ClassMethods#delete_trashed_files;F;[;[[@0i[I",tmpsets/set/mod001-01_core/all/utils.rb;Ti;T;:delete_trashed_files;;;[;{;IC;"6deletes any file not associated with a real card. ;T;@9;F;[;[; I"6deletes any file not associated with a real card.;T;!0;"o;#;$F;%i;&i;'@);(I"def delete_trashed_files;T;)T;*I"Rdef delete_trashed_files #deletes any file not associated with a real card. dir = Card.paths['files'].existent.first trashed_card_sql = %{ select id from cards where trash is true } trashed_card_ids = Card.connection.select_all( trashed_card_sql ).map( &:values ).flatten.map &:to_i file_ids = Dir.entries( dir )[2..-1].map( &:to_i ) file_ids.each do |file_id| if trashed_card_ids.member?(file_id) raise Card::Error, "Narrowly averted deleting current file" if Card.exists?(file_id) #double check! FileUtils.rm_rf "#{dir}/#{file_id}", :secure => true end end end;T;+To; ; F; ;,;;;I"3Card::Set::All::Utils::ClassMethods#merge_list;F;[[I" attribs;T0[I" opts;TI"{};T;[[@0i [@?i:;F;:merge_list;;;[;{;IC;" ;T;@I;.0;F;[;[; I";T;!0;'@);(I"%def merge_list(attribs, opts={});T;)T;*I"zdef merge_list attribs, opts={} unmerged = [] attribs.each do |row| result = begin merge row['name'], row, opts # rescue => e # Rails.logger.info "merge_list problem: #{ e.message }" # false end unmerged.push row unless result == true end if unmerged.empty? Rails.logger.info "successfully merged all!" else unmerged_json = JSON.pretty_generate unmerged if output_file = opts[:output_file] ::File.open output_file, 'w' do |f| f.write unmerged_json end else Rails.logger.info "failed to merge:\n\n#{ unmerged_json }" end end unmerged end;T;+To; ; F; ;,;;;I".Card::Set::All::Utils::ClassMethods#merge;F;[[I" name;T0[I" attribs;TI"{};T[I" opts;TI"{};T;[[@0i<[@?iV;F;: merge;;;[;{;IC;" ;T;@\;.0;F;[;[; I";T;!0;'@);(I")def merge(name, attribs={}, opts={});T;)T;*I"def merge name, attribs={}, opts={} puts "merging #{ name }" card = fetch name, :new=>{} if opts[:pristine] && !card.pristine? false else card.attributes = attribs card.save! end end;T;+To; ; F; ;,;;;I"5Card::Set::All::Utils::ClassMethods#all_file_ids;F;[;[[@?i";F;:all_file_ids;;;[;{;IC;" ;T;@r;.0;F;[;[; I";T;!0;'@);(I"def all_file_ids;T;)T;*I"jdef all_file_ids dir = Card.paths['files'].existent.first Dir.entries(dir)[2..-1].map(&:to_i) end;T;+To; ; F; ;,;;;I"=Card::Set::All::Utils::ClassMethods#all_trashed_card_ids;F;[;[[@?i';F;:all_trashed_card_ids;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@);(I"def all_trashed_card_ids;T;)T;*I"def all_trashed_card_ids trashed_card_sql = %{ select id from cards where trash is true } sql_results = Card.connection.select_all(trashed_card_sql) sql_results.map(&:values).flatten.map(&:to_i) end;T;+To; ; F; ;,;;;I"KCard::Set::All::Utils::ClassMethods#delete_tmp_files_of_cached_uploads;F;[;[[@?i-;F;:'delete_tmp_files_of_cached_uploads;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@);(I"+def delete_tmp_files_of_cached_uploads;T;)T;*I"def delete_tmp_files_of_cached_uploads actions = Card::Action.find_by_sql "SELECT * FROM card_actions INNER JOIN cards ON card_actions.card_id = cards.id WHERE cards.type_id IN (#{Card::FileID}, #{Card::ImageID}) AND card_actions.draft = true" actions.each do |action| if older_than_five_days?(action.created_at) && (card = action.card) # we don't want to delete uploads in progress card.delete_files_for_action action end end end;T;+To; ; F; ;,;;;I"=Card::Set::All::Utils::ClassMethods#report_unmerged_json;F;[[I"unmerged_json;T0[I"output_file;T0;[[@?iL;F;:report_unmerged_json;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@);(I"8def report_unmerged_json unmerged_json, output_file;T;)T;*I"def report_unmerged_json unmerged_json, output_file if output_file ::File.open output_file, 'w' do |f| f.write unmerged_json end else Rails.logger.info "failed to merge:\n\n#{unmerged_json}" end end;T;+To; ; F; ;,;;;I">Card::Set::All::Utils::ClassMethods#older_than_five_days?;F;[[I" time;T0;[[@?ib;F;:older_than_five_days?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@);(I"#def older_than_five_days? time;T;)T;*I"Bdef older_than_five_days? time Time.now - time > 432000 end;T;+T;I@);JIC;[;I@);KIC;[;I@);LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@?i [@0i ;T;;;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/utils.rb ~~~~~~~~~~~ ;T;@);F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/utils.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@';I"(Card::Set::All::Utils::ClassMethods;F;+To; ; F; ;,;;;I"%Card::Set::All::Utils#debug_type;F;[;[[@0iJ[@?ig;F;:debug_type;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@';(I"def debug_type;T;)T;*I">def debug_type "#{type_code||'no code'}:#{type_id}" end;T;+To; ; F; ;,;;;I"Card::Set::All::Utils#to_s;F;[;[[@0iN[@?ik;F;: to_s;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@';(I" def to_s;T;)T;*I"Tdef to_s "#<#{self.class.name}[#{debug_type}]#{self.attributes['name']}>" end;T;+To; ; F; ;,;;;I""Card::Set::All::Utils#inspect;F;[;[[@0iR[@?io;F;: inspect;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@';(I"def inspect;T;)T;*I"def inspect "#<#{self.class.name}" + "##{id}" + "###{object_id}" + #"l#{left_id}r#{right_id}" + "[#{debug_type}]" + "(#{self.name})" + #"#{object_id}" + #(errors.any? ? '*Errors*' : 'noE') + (errors.any? ? "" : '') + #"{#{references_expired==1 ? 'Exp' : "noEx"}:" + "{#{trash&&'trash:'||''}#{new_card? &&'new:'||''}#{frozen? ? 'Fz' : readonly? ? 'RdO' : ''}" + "#{@virtual &&'virtual:'||''}#{@set_mods_loaded&&'I'||'!loaded' }:#{references_expired.inspect}}" + '>' end;T;+T;I@';JIC;[o;S ;T0;UI"Card::Set;T;V@';;;'@;W@;X;Y;I@';KIC;[;I@';LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@0i;F;: Utils;;;;;[;{;IC;" ;T;@';.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Utils;F;+To;7;IC;[o;4;[[I",tmpsets/set/mod001-01_core/all/rules.rb;Ti [I",tmpsets/set/mod001-01_core/all/rules.rb;Ti ;T;: RuleSQL;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/rules.rb ~~~~~~~~~~~ ;T;@;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/rules.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@ ;I"#Card::Set::All::Rules::RuleSQL;F;(I"RuleSQL = %{;T;*I"1RuleSQL = %{ select rules.id as rule_id, settings.id as setting_id, sets.id as set_id, sets.left_id as anchor_id, sets.right_id as set_tag_id from cards rules join cards sets on rules.left_id = sets.id join cards settings on rules.right_id = settings.id where sets.type_id = #{Card::SetID } and sets.trash is false and settings.type_id = #{Card::SettingID} and settings.trash is false and rules.trash is false and (settings.codename != 'follow' or rules.db_content != ''); };T;6I"'%{ select rules.id as rule_id, settings.id as setting_id, sets.id as set_id, sets.left_id as anchor_id, sets.right_id as set_tag_id from cards rules join cards sets on rules.left_id = sets.id join cards settings on rules.right_id = settings.id where sets.type_id = #{Card::SetID } and sets.trash is false and settings.type_id = #{Card::SettingID} and settings.trash is false and rules.trash is false and (settings.codename != 'follow' or rules.db_content != ''); };T;+To;4;[[@i[@i;F;:ReadRuleSQL;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@ ;I"'Card::Set::All::Rules::ReadRuleSQL;F;(I"ReadRuleSQL = %{;T;*I"[ReadRuleSQL = %{ select refs.referee_id as party_id, read_rules.id as read_rule_id from cards read_rules join card_references refs on refs.referer_id = read_rules.id join cards sets on read_rules.left_id = sets.id where read_rules.right_id = #{Card::ReadID} and read_rules.trash is false and sets.type_id = #{Card::SetID}; };T;6I"M%{ select refs.referee_id as party_id, read_rules.id as read_rule_id from cards read_rules join card_references refs on refs.referer_id = read_rules.id join cards sets on read_rules.left_id = sets.id where read_rules.right_id = #{Card::ReadID} and read_rules.trash is false and sets.type_id = #{Card::SetID}; };T;+To; ; F; ;,;;;I"#Card::Set::All::Rules#is_rule?;F;[;[[@i[@i;F;: is_rule?;;;[;{;IC;" ;T;@-;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@-; I";T;!0;'@ ;(I"def is_rule?;T;)T;*I":def is_rule? is_standard_rule? || is_user_rule? end;T;+To; ; F; ;,;;;I",Card::Set::All::Rules#is_standard_rule?;F;[;[[@i#[@i!;F;:is_standard_rule?;;;[;{;IC;" ;T;@@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@@; I";T;!0;'@ ;(I"def is_standard_rule?;T;)T;*I"def is_standard_rule? (r = right( :skip_modules=>true )) && r.type_id == Card::SettingID && (l = left( :skip_modules=>true )) && l.type_id == Card::SetID end;T;+To; ; F; ;,;;;I"(Card::Set::All::Rules#is_user_rule?;F;[;[[@i*[@i(;F;:is_user_rule?;;;[;{;IC;" ;T;@S;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@S; I";T;!0;'@ ;(I"def is_user_rule?;T;)T;*I"def is_user_rule? cardname.parts.length > 2 && (r = right( :skip_modules=>true )) && r.type_id == Card::SettingID && (set = self[0..-3, :skip_modules=>true]) && set.type_id == Card::SetID && (user = self[-2, :skip_modules=>true] ) && (user.type_id == Card::UserID || user.codename == 'all' ) end;T;+To; ; F; ;,;;;I"Card::Set::All::Rules#rule;F;[[I"setting_code;T0[I" options;TI"{};T;[[@i5[@i3;F;: rule;;;[;{;IC;" ;T;@f;.0;F;[;[; I";T;!0;'@ ;(I"'def rule(setting_code, options={});T;)T;*I"def rule setting_code, options={} options[:skip_modules] = true card = rule_card setting_code, options card && card.db_content end;T;+To; ; F; ;,;;;I"$Card::Set::All::Rules#rule_card;F;[[I"setting_code;T0[I" options;TI"{};T;[[@i;[@i9;F;:rule_card;;;[;{;IC;" ;T;@y;.0;F;[;[; I";T;!0;'@ ;(I",def rule_card(setting_code, options={});T;)T;*I"kdef rule_card setting_code, options={} Card.fetch rule_card_id( setting_code, options ), options end;T;+To; ; F; ;,;;;I"'Card::Set::All::Rules#rule_card_id;F;[[I"setting_code;T0[I" options;TI"{};T;[[@i?[@i=;F;:rule_card_id;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@ ;(I"/def rule_card_id(setting_code, options={});T;)T;*I"Hdef rule_card_id setting_code, options={} fallback = options.delete( :fallback ) if Card::Setting.user_specific? setting_code user_id = options[:user_id] || (options[:user] and options[:user].id) || Auth.current_id if user_id fallback = "#{setting_code}+#{AllID}" setting_code = "#{setting_code}+#{user_id}" end end rule_set_keys.each do |rule_set_key| rule_id = self.class.rule_cache["#{rule_set_key}+#{setting_code}"] rule_id ||= fallback && self.class.rule_cache["#{rule_set_key}+#{fallback}"] return rule_id if rule_id end nil end;T;+To; ; F; ;,;;;I"'Card::Set::All::Rules#related_sets;F;[[I"with_self;TI" false;T;[[@iR[@iP;F;:related_sets;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@ ;(I"(def related_sets(with_self = false);T;)T;*I"Fdef related_sets with_self = false # refers to sets that users may configure from the current card - NOT to sets to which the current card belongs sets = [] sets << ["#{name}+*type", Card::TypeSet.label( name) ] if known? && type_id==Card::CardtypeID sets << ["#{name}+*self", Card::SelfSet.label( name) ] if with_self sets << ["#{name}+*right", Card::RightSet.label(name) ] if known? && cardname.simple? # Card.search(:type=>'Set',:left=>{:right=>name},:right=>'*type plus right',:return=>'name').each do |set_name| # sets<< set_name # end sets end;T;+To;7;IC;[o; ; F; ;,;;;I"6Card::Set::All::Rules::ClassMethods#user_rule_sql;F;[[I" user_id;TI"nil;T;[[@if[@ig;T;:user_rule_sql;;;[;{;IC;"8User-specific rule use the pattern user+set+setting ;T;@;F;[;[; I"8User-specific rule use the pattern user+set+setting;T;!0;"o;#;$F;%ie;&if;'@;(I"#def user_rule_sql(user_id=nil);T;)T;*I"Jdef user_rule_sql user_id=nil user_restriction = if user_id "users.id = #{user_id}" else "users.type_id = #{Card::UserID}" end %{ select user_rules.id as rule_id, settings.id as setting_id, sets.id as set_id, sets.left_id as anchor_id, sets.right_id as set_tag_id, users.id as user_id from cards user_rules join cards user_sets on user_rules.left_id = user_sets.id join cards settings on user_rules.right_id = settings.id join cards users on user_sets.right_id = users.id join cards sets on user_sets.left_id = sets.id where sets.type_id = #{Card::SetID } and sets.trash is false and settings.type_id = #{Card::SettingID} and settings.trash is false and ( #{user_restriction} or users.codename = 'all' ) and users.trash is false and user_sets.trash is false and user_rules.trash is false; } end;T;+To; ; F; ;,;;;I"0Card::Set::All::Rules::ClassMethods#setting;F;[[I" name;T0;[[@i~;F;: setting;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def setting name;T;)T;*I"zdef setting name Auth.as_bot do card=Card[name] and !card.db_content.strip.empty? and card.db_content end end;T;+To; ; F; ;,;;;I"5Card::Set::All::Rules::ClassMethods#path_setting;F;[[I" name;T0;[[@i[@i;T;:path_setting;;;[;{;IC;"*shouldn't this be in location helper? ;T;@;F;[;[; I"*shouldn't this be in location helper?;T;!0;"o;#;$F;%i;&i;'@;(I"def path_setting(name);T;)T;*I"def path_setting name #shouldn't this be in location helper? name ||= '/' return name if name =~ /^(http|mailto)/ "#{Card.config.relative_url_root}#{name}" end;T;+To; ; F; ;,;;;I"/Card::Set::All::Rules::ClassMethods#toggle;F;[[I"val;T0;[[@i[@i;F;: toggle;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def toggle(val);T;)T;*I"/def toggle val val.to_s.strip == '1' end;T;+To; ; F; ;,;;;I"2Card::Set::All::Rules::ClassMethods#cache_key;F;[[I"row;T0;[[@i[@i;F;:cache_key;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def cache_key(row);T;)T;*I"Sdef cache_key row setting_code = Codename[ row['setting_id'].to_i ] or return false anchor_id = row['anchor_id'] set_class_id = anchor_id.nil? ? row['set_id'] : row['set_tag_id'] set_class_code = Codename[ set_class_id.to_i ] or return false key_base = [ anchor_id, set_class_code, setting_code].compact.map( &:to_s ) * '+' end;T;+To; ; F; ;,;;;I">Card::Set::All::Rules::ClassMethods#all_rule_keys_with_id;F;[;[[@i[@i;F;:all_rule_keys_with_id;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"def all_rule_keys_with_id;T;)T;*I"def all_rule_keys_with_id ActiveRecord::Base.connection.select_all(RuleSQL).each do |row| if key = cache_key(row) yield(key, row['rule_id'].to_i) end end end;T;+To; ; F; ;,;;;I"OCard::Set::All::Rules::ClassMethods#all_user_rule_keys_with_id_and_user_id;F;[;[[@i[@i;F;:+all_user_rule_keys_with_id_and_user_id;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"/def all_user_rule_keys_with_id_and_user_id;T;)T;*I"def all_user_rule_keys_with_id_and_user_id ActiveRecord::Base.connection.select_all(user_rule_sql).each do |row| if key = cache_key(row) and user_id = row['user_id'] yield(key, row['rule_id'].to_i, user_id.to_i) end end end;T;+To; ; F; ;,;;;I"BCard::Set::All::Rules::ClassMethods#all_rule_keys_with_id_for;F;[[I" user_id;T0;[[@i[@i;F;:all_rule_keys_with_id_for;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"+def all_rule_keys_with_id_for(user_id);T;)T;*I"def all_rule_keys_with_id_for user_id ActiveRecord::Base.connection.select_all(user_rule_sql(user_id)).each do |row| if key = cache_key(row) yield(key, row['rule_id'].to_i) end end end;T;+To; ; F; ;,;;;I"=Card::Set::All::Rules::ClassMethods#cached_rule_keys_for;F;[[I" user_id;T0;[[@i[@i;F;:cached_rule_keys_for;;;[;{;IC;" ;T;@0 ;.0;F;[;[; I";T;!0;'@;(I"&def cached_rule_keys_for(user_id);T;)T;*I"Jdef cached_rule_keys_for user_id rule_keys_cache[user_id] || [] end;T;+To; ; F; ;,;;;I"CCard::Set::All::Rules::ClassMethods#all_user_ids_with_rule_for;F;[[I" set_card;T0[I"setting_code;T0;[[@i[@i;F;:all_user_ids_with_rule_for;;;[;{;IC;" ;T;@@ ;.0;F;[;[; I";T;!0;'@;(I";def all_user_ids_with_rule_for(set_card, setting_code);T;)T;*I"def all_user_ids_with_rule_for set_card, setting_code key = if (l=set_card.left) and (r=set_card.right) set_class_code = Codename[ r.id ] "#{l.id}+#{set_class_code}+#{setting_code}" else set_class_code = Codename[ set_card.id ] "#{set_class_code}+#{setting_code}" end user_ids = user_ids_cache[key] || [] if user_ids.include? AllID # rule for all -> return all user ids Card.where(:type_id=>UserID).pluck(:id) else user_ids end end;T;+To; ; F; ;,;;;I"8Card::Set::All::Rules::ClassMethods#user_rule_cards;F;[[I"user_name;T0[I"setting_code;T0;[[@i[@i;F;:user_rule_cards;;;[;{;IC;" ;T;@R ;.0;F;[;[; I";T;!0;'@;(I"1def user_rule_cards(user_name, setting_code);T;)T;*I"def user_rule_cards user_name, setting_code Card.search :right=>{:codename=>setting_code}, :left=>{:left=>{:type_id=>SetID}, :right=>user_name} end;T;+To; ; F; ;,;;;I"3Card::Set::All::Rules::ClassMethods#rule_cache;F;[;[[@i[@i;F;:rule_cache;;;[;{;IC;" ;T;@d ;.0;F;[;[; I";T;!0;'@;(I"def rule_cache;T;)T;*I"Tdef rule_cache Card.cache.read('RULES') || begin rule_hash = {} all_rule_keys_with_id do |key,rule_id| rule_hash[key] = rule_id end user_ids_hash = {} rule_keys_hash = {} all_user_rule_keys_with_id_and_user_id do |key, rule_id, user_id| rule_hash[ user_rule_key(key,user_id) ] = rule_id user_ids_hash[key] ||= [] user_ids_hash[key] << user_id rule_keys_hash[user_id] ||= [] rule_keys_hash[user_id] << key end write_user_ids_cache user_ids_hash write_rule_keys_cache rule_keys_hash write_rule_cache rule_hash end end;T;+To; ; F; ;,;;;I"6Card::Set::All::Rules::ClassMethods#user_rule_key;F;[[I"key;T0[I" user_id;T0;[[@i[@i;F;:user_rule_key;;;[;{;IC;" ;T;@r ;.0;F;[;[; I";T;!0;'@;(I"$def user_rule_key(key, user_id);T;)T;*I"=def user_rule_key key, user_id "#{key}+#{user_id}" end;T;+To; ; F; ;,;;;I"7Card::Set::All::Rules::ClassMethods#user_ids_cache;F;[;[[@i[@i;T;:user_ids_cache;;;[;{;IC;"Ball users that have a user-specific rule for a given rule key ;T;@ ;F;[;[; I"Ball users that have a user-specific rule for a given rule key;T;!0;"o;#;$F;%i;&i;'@;(I"def user_ids_cache;T;)T;*I"wdef user_ids_cache Card.cache.read('USER_IDS') || begin rule_cache Card.cache.read('USER_IDS') end end;T;+To; ; F; ;,;;;I"8Card::Set::All::Rules::ClassMethods#rule_keys_cache;F;[;[[@i[@i;T;:rule_keys_cache;;;[;{;IC;"5all keys of user-specific rules for a given user ;T;@ ;F;[;[; I"5all keys of user-specific rules for a given user;T;!0;"o;#;$F;%i;&i;'@;(I"def rule_keys_cache;T;)T;*I"zdef rule_keys_cache Card.cache.read('RULE_KEYS') || begin rule_cache Card.cache.read('RULE_KEYS') end end;T;+To; ; F; ;,;;;I"9Card::Set::All::Rules::ClassMethods#clear_rule_cache;F;[;[[@i[@i;F;:clear_rule_cache;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"def clear_rule_cache;T;)T;*I"kdef clear_rule_cache write_rule_cache nil write_user_ids_cache nil write_rule_keys_cache nil end;T;+To; ; F; ;,;;;I">Card::Set::All::Rules::ClassMethods#clear_user_rule_cache;F;[;[[@i[@i;F;:clear_user_rule_cache;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"def clear_user_rule_cache;T;)T;*I"5def clear_user_rule_cache clear_rule_cache end;T;+To; ; F; ;,;;;I"DCard::Set::All::Rules::ClassMethods#refresh_rule_cache_for_user;F;[[I" user_id;T0;[[@i[@i;F;: refresh_rule_cache_for_user;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"-def refresh_rule_cache_for_user(user_id);T;)T;*I"def refresh_rule_cache_for_user user_id rule_hash = rule_cache user_ids_hash = user_ids_cache rule_keys_hash = rule_keys_cache cached_rule_keys_for(user_id).each do |key| rule_hash[ user_rule_key(key, user_id) ] = nil user_ids_hash[ key ].delete(user_id) end rule_keys_hash[ user_id ] = nil all_rule_keys_with_id_for(user_id) do |key, rule_id| rule_hash[ user_rule_key(key,user_id) ] = rule_id user_ids_hash[ key ] ||= [] user_ids_hash[ key ] << user_id rule_keys_hash[ user_id ] ||= [] rule_keys_hash[ user_id ] << key end write_user_ids_cache user_ids_hash write_rule_keys_cache rule_keys_hash write_rule_cache rule_hash end;T;+To; ; F; ;,;;;I"9Card::Set::All::Rules::ClassMethods#write_rule_cache;F;[[I" hash;T0;[[@i[@i;F;:write_rule_cache;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"def write_rule_cache(hash);T;)T;*I"Cdef write_rule_cache hash Card.cache.write 'RULES', hash end;T;+To; ; F; ;,;;;I"=Card::Set::All::Rules::ClassMethods#write_user_ids_cache;F;[[I" hash;T0;[[@i[@i ;F;:write_user_ids_cache;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"#def write_user_ids_cache(hash);T;)T;*I"Jdef write_user_ids_cache hash Card.cache.write 'USER_IDS', hash end;T;+To; ; F; ;,;;;I">Card::Set::All::Rules::ClassMethods#write_rule_keys_cache;F;[[I" hash;T0;[[@i[@i$;F;:write_rule_keys_cache;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"$def write_rule_keys_cache(hash);T;)T;*I"Ldef write_rule_keys_cache hash Card.cache.write 'RULE_KEYS', hash end;T;+To; ; F; ;,;;;I"8Card::Set::All::Rules::ClassMethods#read_rule_cache;F;[;[[@i#[@i(;F;:read_rule_cache;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"def read_rule_cache;T;)T;*I"rdef read_rule_cache Card.cache.read('READRULES') || begin hash = {} ActiveRecord::Base.connection.select_all( Card::Set::All::Rules::ReadRuleSQL ).each do |row| party_id, read_rule_id = row['party_id'].to_i, row['read_rule_id'].to_i hash[party_id] ||= [] hash[party_id] << read_rule_id end Card.cache.write 'READRULES', hash end end;T;+To; ; F; ;,;;;I">Card::Set::All::Rules::ClassMethods#clear_read_rule_cache;F;[;[[@i/[@i6;F;:clear_read_rule_cache;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"def clear_read_rule_cache;T;)T;*I"Fdef clear_read_rule_cache Card.cache.write 'READRULES', nil end;T;+To; ; F; ;,;;;I"7Card::Set::All::Rules::ClassMethods#global_setting;F;[[I" name;T0;[[@i;F;:global_setting;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"def global_setting name;T;)T;*I"~def global_setting name Auth.as_bot do (card = Card[name]) && !card.db_content.strip.empty? && card.db_content end end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@ib[@ic;F;;;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@ ;I"(Card::Set::All::Rules::ClassMethods;F;+T;I@ ;JIC;[o;S ;T0;UI"Card::Set;T;V@ ;;;'@;W@;X;Y;I@ ;KIC;[;I@ ;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;: Rules;;;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Rules;F;+To;7;IC;[o;7;IC;[%o; ; F; ;,;;;I".Card::Set::All::Fetch::ClassMethods#fetch;F;[[I" mark;T0[I" opts;TI"{};T;[[I",tmpsets/set/mod001-01_core/all/fetch.rb;Ti [I",tmpsets/set/mod001-01_core/all/fetch.rb;Ti!;T;: fetch;;;[;{;IC;"=== fetch looks for cards in - cache - database - virtual cards "mark" here means one of three unique identifiers 1. a numeric id (Integer) 2. a name/key (String or Card::Name) 3. a codename (Symbol) Options: :skip_virtual Real cards only :skip_modules Don't load Set modules :look_in_trash Return trashed card objects :local_only Use only local cache for lookup and storing new: { card opts } Return a new card when not found ;T;@P ;F;[;[; I"=== fetch looks for cards in - cache - database - virtual cards "mark" here means one of three unique identifiers 1. a numeric id (Integer) 2. a name/key (String or Card::Name) 3. a codename (Symbol) Options: :skip_virtual Real cards only :skip_modules Don't load Set modules :look_in_trash Return trashed card objects :local_only Use only local cache for lookup and storing new: { card opts } Return a new card when not found ;T;!0;"o;#;$F;%i;&i ;'@N ;(I"def fetch(mark, opts={});T;)T;*I"def fetch mark, opts={} if String === mark case mark when /^\~(\d+)$/ # get by id mark = $1.to_i when /^\:(\w+)$/ # get by codename mark = $1.to_sym end end mark = Card::Codename[mark] if Symbol === mark # id from codename if mark.present? card, mark, needs_caching = fetch_from_cache_or_db mark, opts # have existing else return unless opts[:new] end if Integer===mark return if card.nil? || mark.nil? else return card.renew(opts) if card and card.eager_renew?(opts) if !card or card.type_id==-1 && clean_cache_opts?(opts) # new (or improved) card for cache needs_caching = true card = new_for_cache mark, opts end end write_to_cache card if Card.cache && needs_caching if card.new_card? if opts[:new] return card.renew(opts) if !clean_cache_opts? opts elsif opts[:skip_virtual] return else card.include_set_modules unless opts[:skip_modules] # need to load modules here to call the right virtual? method return unless card.virtual? end card.name = mark.to_s if mark && mark.to_s != card.name end card.include_set_modules unless opts[:skip_modules] card end;T;+To; ; F; ;,;;;I"1Card::Set::All::Fetch::ClassMethods#fetch_id;F;[[I" mark;T0[I" opts;TI"{};T;[[@Z iM[@\ iC;T;: fetch_id;;;[;{;IC;">should optimize this. what if mark is int? or codename? ;T;@f ;F;[;[; I">should optimize this. what if mark is int? or codename?;T;!0;"o;#;$F;%iM;&iM;'@N ;(I" def fetch_id(mark, opts={});T;)T;*I"def fetch_id mark #should optimize this. what if mark is int? or codename? card = fetch mark, :skip_virtual=>true, :skip_modules=>true card and card.id end;T;+To; ; F; ;,;;;I"+Card::Set::All::Fetch::ClassMethods#[];F;[[I" mark;T0;[[@Z iR[@\ iZ;F;;9;;;[;{;IC;" ;T;@z ;.0;F;[;[; I";T;!0;'@N ;(I"def [](mark);T;)T;*I"7def [](mark) fetch mark, :skip_virtual=>true end;T;+To; ; F; ;,;;;I"0Card::Set::All::Fetch::ClassMethods#exists?;F;[[I" mark;T0;[[@Z iV[@\ i^;F;: exists?;;;[;{;IC;" ;T;@ ;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@ ; I";T;!0;'@N ;(I"def exists?(mark);T;)T;*I"gdef exists? mark card = fetch mark, :skip_virtual=>true, :skip_modules=>true card.present? end;T;+To; ; F; ;,;;;I"/Card::Set::All::Fetch::ClassMethods#known?;F;[[I" mark;T0;[[@Z i[[@\ ic;F;: known?;;;[;{;IC;" ;T;@ ;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@ ; I";T;!0;'@N ;(I"def known?(mark);T;)T;*I"Qdef known? mark card = fetch mark, :skip_modules=>true card.present? end;T;+To; ; F; ;,;;;I"/Card::Set::All::Fetch::ClassMethods#expire;F;[[I" name;T0[I" subcards;TI" false;T;[[@Z i`[@\ io;F;: expire;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I"%def expire(name, subcards=false);T;)T;*I"def expire name #note: calling instance method breaks on dirty names key = name.to_name.key if card = Card.cache.read( key ) Card.cache.delete key Card.cache.delete "~#{card.id}" if card.id end #Rails.logger.warn "expiring #{name}, #{card.inspect}" end;T;+To; ; F; ;,;;;I"0Card::Set::All::Fetch::ClassMethods#members;F;[[I"key;T0;[[@Z ik;T;: members;;;[;{;IC;"#set_names reverse map (cached) ;T;@ ;F;[;[; I"#set_names reverse map (cached);T;!0;"o;#;$F;%ij;&ij;'@N ;(I"def members key;T;)T;*I"Kdef members key (v=Card.cache.read "$#{key}").nil? ? [] : v.keys end;T;+To; ; F; ;,;;;I"4Card::Set::All::Fetch::ClassMethods#set_members;F;[[I"set_names;T0[I"key;T0;[[@Z io[@\ i~;F;:set_members;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I"$def set_members(set_names, key);T;)T;*I"Sdef set_members set_names, key set_names.compact.map(&:to_name).map(&:key).map do |set_key| skey = "$#{set_key}" # dollar sign avoids conflict with card keys h = Card.cache.read skey if h.nil? h = {} elsif h[key] next end h = h.dup if h.frozen? h[key] = true Card.cache.write skey, h end end;T;+To; ; F; ;,;;;I".Card::Set::All::Fetch::ClassMethods#cache;F;[;[[@Z i~[@\ i;F;: cache;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I"def cache;T;)T;*I"&def cache Card::Cache[Card] end;T;+To; ; F; ;,;;;I"9Card::Set::All::Fetch::ClassMethods#fetch_from_cache;F;[[I"cache_key;T0[I"local_only;TI" false;T;[[@Z i}[@\ i;F;:fetch_from_cache;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I"6def fetch_from_cache(cache_key, local_only=false);T;)T;*I"Qdef fetch_from_cache cache_key Card.cache.read cache_key if Card.cache end;T;+To; ; F; ;,;;;I";Card::Set::All::Fetch::ClassMethods#fullname_from_name;F;[[I" name;T0[I" new_opts;TI"{};T;[[@Z i;F;:fullname_from_name;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I"-def fullname_from_name name, new_opts={};T;)T;*I"def fullname_from_name name, new_opts={} if new_opts and supercard = new_opts[:supercard] name.to_name.to_absolute_name supercard.name else name.to_name end end;T;+To; ; F; ;,;;;I"?Card::Set::All::Fetch::ClassMethods#fetch_from_cache_or_db;F;[[I" mark;T0[I" opts;T0;[[@Z i;F;:fetch_from_cache_or_db;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I"*def fetch_from_cache_or_db mark, opts;T;)T;*I"[def fetch_from_cache_or_db mark, opts needs_caching = false mark_type = Integer===mark ? :id : :key if mark_type == :key mark = fullname_from_name mark, opts[:new] val = mark.key else val = mark end card = send( "fetch_from_cache_by_#{mark_type}", val ) if opts[:look_in_trash] if card.nil? || (card.new_card? && !card.trash) card = Card.where( mark_type => val ).take needs_caching = card && !card.trash end elsif card.nil? needs_caching = true card = Card.where( mark_type => val, trash: false).take end [ card, mark, needs_caching ] end;T;+To; ; F; ;,;;;I"?Card::Set::All::Fetch::ClassMethods#fetch_from_cache_by_id;F;[[I"id;T0[I"local_only;TI" false;T;[[@Z i[@\ i;F;:fetch_from_cache_by_id;;;[;{;IC;" ;T;@- ;.0;F;[;[; I";T;!0;'@N ;(I"5def fetch_from_cache_by_id(id, local_only=false);T;)T;*I"mdef fetch_from_cache_by_id id if name = fetch_from_cache("~#{id}") fetch_from_cache name end end;T;+To; ; F; ;,;;;I"@Card::Set::All::Fetch::ClassMethods#fetch_from_cache_by_key;F;[[I"key;T0[I"local_only;TI" false;T;[[@Z i[@\ i;F;:fetch_from_cache_by_key;;;[;{;IC;" ;T;@@ ;.0;F;[;[; I";T;!0;'@N ;(I"7def fetch_from_cache_by_key(key, local_only=false);T;)T;*I"?def fetch_from_cache_by_key key fetch_from_cache key end;T;+To; ; F; ;,;;;I"6Card::Set::All::Fetch::ClassMethods#new_for_cache;F;[[I" card;T0[I" name;T0[I" opts;T0;[[@Z i[@\ i;F;:new_for_cache;;;[;{;IC;" ;T;@S ;.0;F;[;[; I";T;!0;'@N ;(I"(def new_for_cache(card, name, opts);T;)T;*I"/def new_for_cache name, opts new_args = { :name=>name, :skip_modules=>true } new_args[:type_id] = -1 unless clean_cache_opts? opts # The -1 type_id allows us to skip all the type lookup and flag the need for # reinitialization later. *** It should NEVER be seen elsewhere *** new new_args end;T;+To; ; F; ;,;;;I":Card::Set::All::Fetch::ClassMethods#clean_cache_opts?;F;[[I" opts;T0;[[@Z i;F;:clean_cache_opts?;;;[;{;IC;" ;T;@g ;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@g ; I";T;!0;'@N ;(I"def clean_cache_opts? opts;T;)T;*I"Rdef clean_cache_opts? opts !opts[:skip_virtual] && !opts[:new].present? end;T;+To; ; F; ;,;;;I"7Card::Set::All::Fetch::ClassMethods#write_to_cache;F;[[I" card;T0[I" opts;T0;[[@Z i[@\ i;F;:write_to_cache;;;[;{;IC;" ;T;@{ ;.0;F;[;[; I";T;!0;'@N ;(I"#def write_to_cache(card, opts);T;)T;*I"def write_to_cache card Card.cache.write card.key, card Card.cache.write "~#{card.id}", card.key if card.id and card.id != 0 end;T;+To; ; F; ;,;;;I"?Card::Set::All::Fetch::ClassMethods#standard_fetch_results;F;[[I" card;T0[I" mark;T0[I" opts;T0;[[@\ i1;F;:standard_fetch_results;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I"0def standard_fetch_results card, mark, opts;T;)T;*I"def standard_fetch_results card, mark, opts if card.new_card? case when opts[:new].present? then return card.renew(opts) when opts[:new] # noop for empty hash when opts[:skip_virtual] then return nil end card.name_from_mark! mark, opts end # need to load modules here to call the right virtual? method card.include_set_modules unless opts[:skip_modules] card if opts[:new] || card.known? end;T;+To; ; F; ;,;;;I"3Card::Set::All::Fetch::ClassMethods#fetch_soft;F;[[I" mark;T0[I" opts;TI"{};T;[[@\ i?;F;:fetch_soft;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I"!def fetch_soft mark, opts={};T;)T;*I"Pdef fetch_soft mark, opts={} fetch mark, opts.merge(local_only: true) end;T;+To; ; F; ;,;;;I"4Card::Set::All::Fetch::ClassMethods#quick_fetch;F;[[I" mark;T0;[[@\ iM;F;:quick_fetch;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I"def quick_fetch mark;T;)T;*I"Rdef quick_fetch mark fetch mark, skip_virtual: true, skip_modules: true end;T;+To; ; F; ;,;;;I"@Card::Set::All::Fetch::ClassMethods#assign_or_initialize_by;F;[[I" name;T0[I"attributes;T0[I"fetch_opts;TI"{};T;[[@\ iQ;F;:assign_or_initialize_by;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I"@def assign_or_initialize_by name, attributes, fetch_opts={};T;)T;*I"def assign_or_initialize_by name, attributes, fetch_opts={} if (known_card = Card.fetch(name, fetch_opts)) known_card.refresh.assign_attributes attributes known_card else Card.new attributes.merge(name: name) end end;T;+To; ; F; ;,;;;I"4Card::Set::All::Fetch::ClassMethods#expire_hard;F;[[I" name;T0;[[@\ ih;F;:expire_hard;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I"def expire_hard name;T;)T;*I"def expire_hard name return unless Card.cache.hard key = name.to_name.key Card.cache.hard.delete key Card.cache.hard.delete "~#{card.id}" if card.id end;T;+To; ; F; ;,;;;I";Card::Set::All::Fetch::ClassMethods#cached_set_members;F;[[I"key;T0;[[@\ i~;T;:cached_set_members;;;[;{;IC;"?set_names reverse map (cached) FIXME: move to set handling ;T;@ ;F;[;[; I"?set_names reverse map (cached) FIXME: move to set handling;T;!0;"o;#;$F;%i|;&i};'@N ;(I"def cached_set_members key;T;)T;*I"|def cached_set_members key set_cache_list = Card.cache.read "$#{key}" set_cache_list.nil? ? [] : set_cache_list.keys end;T;+To; ; F; ;,;;;I"=Card::Set::All::Fetch::ClassMethods#validate_fetch_opts!;F;[[I" opts;T0;[[@\ i;F;:validate_fetch_opts!;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I""def validate_fetch_opts! opts;T;)T;*I"def validate_fetch_opts! opts return unless opts[:new] && opts[:skip_virtual] fail Card::Error, 'fetch called with new args and skip_virtual' end;T;+To; ; F; ;,;;;I"4Card::Set::All::Fetch::ClassMethods#parse_mark!;F;[[I" mark;T0;[[@\ i;F;:parse_mark!;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I"def parse_mark! mark;T;)T;*I"def parse_mark! mark # return mark_type, mark_value, and absolutized mark if mark.is_a? Integer [:id, mark] else [:key, mark.key] end end;T;+To; ; F; ;,;;;I"7Card::Set::All::Fetch::ClassMethods#fetch_existing;F;[[I" mark;T0[I" opts;T0;[[@\ i;F;:fetch_existing;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@N ;(I""def fetch_existing mark, opts;T;)T;*I"def fetch_existing mark, opts return [nil, false] unless mark.present? mark_type, mark_key = parse_mark! mark needs_caching = false # until proven true :) # look in cache card = send "fetch_from_cache_by_#{mark_type}", mark_key, opts[:local_only] if retrieve_from_db?(card, opts) # look in db if needed card = fetch_from_db mark_type, mark_key, opts needs_caching = !card.nil? && !card.trash end [card, needs_caching] end;T;+To; ; F; ;,;;;I":Card::Set::All::Fetch::ClassMethods#retrieve_from_db?;F;[[I" card;T0[I" opts;T0;[[@\ i;F;:retrieve_from_db?;;;[;{;IC;" ;T;@# ;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@# ; I";T;!0;'@N ;(I"%def retrieve_from_db? card, opts;T;)T;*I"pdef retrieve_from_db? card, opts card.nil? || (opts[:look_in_trash] && card.new_card? && !card.trash) end;T;+To; ; F; ;,;;;I"6Card::Set::All::Fetch::ClassMethods#fetch_from_db;F;[[I"mark_type;T0[I" mark_key;T0[I" opts;T0;[[@\ i;F;:fetch_from_db;;;[;{;IC;" ;T;@9 ;.0;F;[;[; I";T;!0;'@N ;(I"0def fetch_from_db mark_type, mark_key, opts;T;)T;*I"def fetch_from_db mark_type, mark_key, opts query = { mark_type => mark_key } query[:trash] = false unless opts[:look_in_trash] card = Card.where(query).take card.restore_subcards if card card end;T;+To; ; F; ;,;;;I":Card::Set::All::Fetch::ClassMethods#skip_type_lookup?;F;[[I" opts;T0;[[@\ i;F;:skip_type_lookup?;;;[;{;IC;" ;T;@L ;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@L ; I";T;!0;'@N ;(I"def skip_type_lookup? opts;T;)T;*I"Fdef skip_type_lookup? opts # if opts[:new] is not empty then we are initializing a variant that is # different from the cached variant # and can postpone type lookup for the cached variant # if skipping virtual no need to look for actual type opts[:skip_virtual] || opts[:new].present? || opts[:skip_type_lookup] end;T;+To; ; F; ;,;;;I" true unless new_card? end;T;+To; ; F; ;,;;;I""Card::Set::All::Trash#delete!;F;[;[[@v i [@t i ;F;: delete!;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@m ;(I"def delete!;T;)T;*I"Idef delete! update_attributes! :trash => true unless new_card? end;T;+T;I@m ;JIC;[o;S ;T0;UI"Card::Set;T;V@m ;;;'@;W@;X;Y;I@m ;KIC;[;I@m ;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@v i;F;: Trash;;;;;[;{;IC;" ;T;@m ;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Trash;F;+To;7;IC;[o; ; F; ;,;;;I"!Card::Set::All::Phases#abort;F;[[I" status;T0[I"msg;TI"'action canceled';T;[[I"-tmpsets/set/mod001-01_core/all/phases.rb;Ti[I"-tmpsets/set/mod001-01_core/all/phases.rb;Ti;T;: abort;;;[;{;IC;"cThe Card#abort method is for cleanly exiting an action without continuing to process any further events. Three statuses are supported: failure: adds an error, returns false on save success: no error, returns true on save triumph: similar to success, but if called on a subcard it causes the entire action to abort (not just the subcard) ;T;@ ;F;[;[o;0 ;1I" raise;F;2I";T;0;3[I"Card::Abort;T;@ ; I"cThe Card#abort method is for cleanly exiting an action without continuing to process any further events. Three statuses are supported: failure: adds an error, returns false on save success: no error, returns true on save triumph: similar to success, but if called on a subcard it causes the entire action to abort (not just the subcard);T;!0;"o;#;$F;%i ;&i;'@ ;(I"/def abort(status, msg = 'action canceled');T;)T;*I"def abort status, msg='action canceled' if status == :failure && errors.empty? errors.add :abort, msg elsif Hash === status and status[:success] success << status[:success] status = :success end raise Card::Abort.new( status, msg) end;T;+To; ; F; ;,;;;I"%Card::Set::All::Phases#abortable;F;[;[[@ i[@ i;F;:abortable;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@ ;(I"def abortable;T;)T;*I"def abortable yield rescue Card::Abort => e if e.status == :triumph @supercard ? raise( e ) : true elsif e.status == :success if @supercard @supercard.subcards.delete_if { |k,v| v==self } end true end end;T;+To; ; F; ;,;;;I"*Card::Set::All::Phases#valid_subcard?;F;[;[[@ i)[@ i+;F;:valid_subcard?;;;[;{;IC;" ;T;@ ;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@ ; I";T;!0;'@ ;(I"def valid_subcard?;T;)T;*I"2def valid_subcard? abortable { valid? } end;T;+To; ; F; ;,;;;I"=Card::Set::All::Phases#with_transaction_returning_status;F;[;[[@ i.[@ i1;T;:&with_transaction_returning_status;;;[;{;IC;"zthis is an override of standard rails behavior that rescues abort makes it so that :success abortions do not rollback ;T;@ ;F;[;[; I"zthis is an override of standard rails behavior that rescues abort makes it so that :success abortions do not rollback;T;!0;"o;#;$F;%i/;&i0;'@ ;(I"*def with_transaction_returning_status;T;)T;*I"def with_transaction_returning_status status = nil self.class.transaction do add_to_transaction status = abortable { yield } raise ActiveRecord::Rollback unless status end status end;T;+To; ; F; ;,;;;I"#Card::Set::All::Phases#prepare;F;[;[[@ i;[@ i[;T;: prepare;;;[;{;IC;"7perhaps above should be in separate module? ~~~~~~ ;T;@ ;F;[;[; I"7perhaps above should be in separate module? ~~~~~~;T;!0;"o;#;$F;%i8;&i9;'@ ;(I"def prepare;T;)T;*I"def prepare @action = identify_action # the following should really happen when type, name etc are changed reset_patterns include_set_modules run_callbacks :prepare rescue =>e rescue_event e end;T;+To; ; F; ;,;;;I"#Card::Set::All::Phases#approve;F;[;[[@ iE[@ ie;F;: approve;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@ ;(I"def approve;T;)T;*I"def approve @action ||= identify_action run_callbacks :approve expire_pieces if errors.any? errors.empty? rescue =>e rescue_event e end;T;+To; ; F; ;,;;;I"+Card::Set::All::Phases#identify_action;F;[;[[@ iN[@ in;F;:identify_action;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@ ;(I"def identify_action;T;)T;*I"zdef identify_action case when trash ; :delete when new_card? ; :create else :update end end;T;+To; ; F; ;,;;;I"!Card::Set::All::Phases#store;F;[;[[@ iW[@ iv;F;: store;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@ ;(I"def store;T;)T;*I"def store run_callbacks :store do yield #unless @draft @virtual = false end run_callbacks :stored rescue =>e rescue_event e ensure @from_trash = @last_action_id = @last_content_action_id = nil end;T;+To; ; F; ;,;;;I""Card::Set::All::Phases#extend;F;[;[[@ id[@ i;F;: extend;;;[;{;IC;" ;T;@&;.0;F;[;[; I";T;!0;'@ ;(I"def extend;T;)T;*I"zdef extend run_callbacks :extend run_callbacks :subsequent rescue =>e rescue_event e ensure @action = nil end;T;+To; ; F; ;,;;;I"(Card::Set::All::Phases#rescue_event;F;[[I"e;T0;[[@ ip[@ i;F;:rescue_event;;;[;{;IC;" ;T;@4;.0;F;[;[; I";T;!0;'@ ;(I"def rescue_event(e);T;)T;*I"def rescue_event e @action = nil expire_pieces subcards.each do |key, card| next unless Card===card card.expire_pieces end raise e #rescue Card::Cancel # false end;T;+To; ; F; ;,;;;I"*Card::Set::All::Phases#event_applies?;F;[[I" opts;T0;[[@ i|[@ i;F;:event_applies?;;;[;{;IC;" ;T;@D;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@D; I";T;!0;'@ ;(I"def event_applies?(opts);T;)T;*I"udef event_applies? opts if opts[:on] return false unless Array.wrap( opts[:on] ).member? @action end if changed_field = opts[:changed] changed_field = 'db_content' if changed_field.to_sym == :content return false if @action == :delete or !changes[ changed_field.to_s ] end if opts[:when] return false unless opts[:when].call self end true end;T;+To; ; F; ;,;;;I"$Card::Set::All::Phases#subcards;F;[;[[@ i;F;: subcards;;;[;{;IC;" ;T;@Y;.0;F;[;[; I";T;!0;'@ ;(I"def subcards;T;)T;*I"(def subcards @subcards ||= {} end;T;+To; ; F; ;,;;;I"#Card::Set::All::Phases#success;F;[;[[@ i[@ i;F;;=;;;[;{;IC;" ;T;@f;.0;F;[;[; I";T;!0;'@ ;(I"def success;T;)T;*I"Ddef success Env[:success] ||= Card::Success.new(cardname) end;T;+To;4;[[@ i>;T;: PHASES;;;;;[;{;IC;"7perhaps above should be in separate module? ~~~~~~ ;T;@t;F;[;[; I"7perhaps above should be in separate module? ~~~~~~;T;!0;"o;#;$F;%i;;&i<;'@ ;I"#Card::Set::All::Phases::PHASES;F;(I"PHASES = {};T;*I"PHASES = {};T;6I"{};T;+To; ; F; ;,;;;I"%Card::Set::All::Phases#run_phase;F;[[I" phase;T0[I" &block;T0;[[@ iD;F;:run_phase;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@ ;(I" def run_phase phase, &block;T;)T;*I"def run_phase phase, &block @phase = phase @subphase = :before if block_given? block.call else run_callbacks phase end @subphase = :after end;T;+To; ; F; ;,;;;I"*Card::Set::All::Phases#simulate_phase;F;[[I" opts;T0[I" &block;T0;[[@ iO;F;:simulate_phase;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@ ;(I"$def simulate_phase opts, &block;T;)T;*I"1def simulate_phase opts, &block @phase end;T;+To; ; F; ;,;;;I"!Card::Set::All::Phases#phase;F;[;[[@ iS;F;: phase;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@ ;(I"def phase;T;)T;*I"?def phase @phase || (@supercard && @supercard.phase) end;T;+To; ; F; ;,;;;I"$Card::Set::All::Phases#subphase;F;[;[[@ iW;F;: subphase;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@ ;(I"def subphase;T;)T;*I"Hdef subphase @subphase || (@supercard && @supercard.subphase) end;T;+To; ; F; ;,;;;I"%Card::Set::All::Phases#phase_ok?;F;[[I" opts;T0;[[@ i;F;:phase_ok?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@ ;(I"def phase_ok? opts;T;)T;*I"def phase_ok? opts phase && ( (opts[:during] && in?(opts[:during])) || (opts[:before] && before?(opts[:before])) || (opts[:after] && after?(opts[:after])) || true # no phase restriction in opts ) end;T;+To; ; F; ;,;;;I"#Card::Set::All::Phases#before?;F;[[I"allowed_phase;T0;[[@ i;F;: before?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@ ;(I"def before? allowed_phase;T;)T;*I"def before? allowed_phase PHASES[allowed_phase] > PHASES[phase] || (PHASES[allowed_phase] == PHASES[phase] && subphase == :before) end;T;+To; ; F; ;,;;;I""Card::Set::All::Phases#after?;F;[[I"allowed_phase;T0;[[@ i;F;: after?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@ ;(I"def after? allowed_phase;T;)T;*I"def after? allowed_phase PHASES[allowed_phase] < PHASES[phase] || (PHASES[allowed_phase] == PHASES[phase] && subphase == :after) end;T;+To; ; F; ;,;;;I"Card::Set::All::Phases#in?;F;[[I"allowed_phase;T0;[[@ i;F;:in?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@ ;(I"def in? allowed_phase;T;)T;*I"|def in? allowed_phase (allowed_phase.is_a?(Array) && allowed_phase.include?(phase)) || allowed_phase == phase end;T;+To; ; F; ;,;;;I"1Card::Set::All::Phases#on_condition_applies?;F;[[I" action;T0;[[@ i;F;:on_condition_applies?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@ ;(I"%def on_condition_applies? action;T;)T;*I"rdef on_condition_applies? action if action Array.wrap(action).member? @action else true end end;T;+To; ; F; ;,;;;I"6Card::Set::All::Phases#changed_condition_applies?;F;[[I"db_column;T0;[[@ i;F;:changed_condition_applies?;;;[;{;IC;" ;T;@";.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@"; I";T;!0;'@ ;(I"-def changed_condition_applies? db_column;T;)T;*I"def changed_condition_applies? db_column if db_column db_column = case db_column.to_sym when :content then 'db_content' when :type then 'type_id' else db_column.to_s end @action != :delete && changes[db_column] else true end end;T;+To; ; F; ;,;;;I"3Card::Set::All::Phases#when_condition_applies?;F;[[I" block;T0;[[@ i;F;:when_condition_applies?;;;[;{;IC;" ;T;@6;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@6; I";T;!0;'@ ;(I"&def when_condition_applies? block;T;)T;*I"_def when_condition_applies? block if block block.call self else true end end;T;+T;I@ ;JIC;[o;S ;T0;UI"Card::Set;T;V@ ;;;'@;W@;X;Y;I@ ;KIC;[;I@ ;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@ i;F;: Phases;;;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Phases;F;+To;7;IC;[ o; ; F; ;,;;;I"%Card::Set::All::States#new_card?;F;[;[[I"-tmpsets/set/mod001-01_core/all/states.rb;Ti [I"-tmpsets/set/mod001-01_core/all/states.rb;Ti;T;:new_card?;;;[;{;IC;"{~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/states.rb ~~~~~~~~~~~ ;T;@^;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@^; I"{~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/states.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@\;(I"def new_card?;T;)T;*I"def new_card? new_record? || # not yet in db (from ActiveRecord) !!@from_trash # in process of restoration from trash, not yet "re-created" end;T;+To; ; F; ;,;;;I" Card::Set::All::States#new?;F;[;[[@ei [@ci ;F;: new?;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/states.rb ~~~~~~~~~~~ in process of restoration from trash, not yet "re-created";T;@t;.0;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/states.rb ~~~~~~~~~~~ in process of restoration from trash, not yet "re-created";T;!0;"o;#;$F;%i ;&i ;'@\;(@r;*I"def new_card? new_record? || # not yet in db (from ActiveRecord) !!@from_trash # in process of restoration from trash, not yet "re-created" end;T;+To; ; F; ;,;;;I""Card::Set::All::States#known?;F;[;[[@ei[@ci;F;;;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@\;(I"def known?;T;)T;*I"'def known? real? || virtual? end;T;+To; ; F; ;,;;;I"!Card::Set::All::States#real?;F;[;[[@ei[@ci;F;: real?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@\;(I"def real?;T;)T;*I"def real? !new_card? end;T;+To; ; F; ;,;;;I"$Card::Set::All::States#unknown?;F;[;[[@ei[@ci;F;: unknown?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@\;(I"def unknown?;T;)T;*I"def unknown? !known? end;T;+To; ; F; ;,;;;I"%Card::Set::All::States#pristine?;F;[;[[@ei[@ci;F;:pristine?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@\;(I"def pristine?;T;)T;*I"def pristine? # has not been edited directly by human users. bleep blorp. new_card? or !actions.joins(:act).where('card_acts.actor_id != ?', Card::WagnBotID).exists? end;T;+T;I@\;JIC;[o;S ;T0;UI"Card::Set;T;V@\;;;'@;W@;X;Y;I@\;KIC;[;I@\;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{@t;;P[;[[@ei;F;: States;;;;;[;{;IC;" ;T;@\;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::States;F;+To;7;IC;[o;4;[[I".tmpsets/set/mod006-05_email/all/follow.rb;Ti [I".tmpsets/set/mod006-05_email/all/follow.rb;Ti ;F;:FOLLOWER_IDS_CACHE_KEY;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"3Card::Set::All::Follow::FOLLOWER_IDS_CACHE_KEY;F;(I",FOLLOWER_IDS_CACHE_KEY = 'FOLLOWER_IDS';T;*I",FOLLOWER_IDS_CACHE_KEY = 'FOLLOWER_IDS';T;6I"'FOLLOWER_IDS';T;+To; ; F; ;,;;;I"(Card::Set::All::Follow#follow_label;F;[;[[@iO[@i[;F;:follow_label;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def follow_label;T;)T;*I" def follow_label name end;T;+To; ; F; ;,;;;I"%Card::Set::All::Follow#followers;F;[;[[@iS[@i_;F;:followers;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def followers;T;)T;*I"Jdef followers follower_ids.map do |id| Card.fetch(id) end end;T;+To; ; F; ;,;;;I"*Card::Set::All::Follow#follower_names;F;[;[[@iY[@ie;F;:follower_names;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def follower_names;T;)T;*I"3def follower_names followers.map(&:name) end;T;+To; ; F; ;,;;;I"-Card::Set::All::Follow#follow_rule_card?;F;[;[[@i^[@ii;F;:follow_rule_card?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def follow_rule_card?;T;)T;*I"Pdef follow_rule_card? is_user_rule? && rule_setting_name == '*follow' end;T;+To; ; F; ;,;;;I"*Card::Set::All::Follow#follow_option?;F;[;[[@ib[@im;F;:follow_option?;;;[;{;IC;" ;T;@/;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@/; I";T;!0;'@;(I"def follow_option?;T;)T;*I"Zdef follow_option? codename && FollowOption.codenames.include?(codename.to_sym) end;T;+To; ; F; ;,;;;I"(Card::Set::All::Follow#followed_by?;F;[[I" user_id;T0;[[@ij[@it;T;:followed_by?;;;[;{;IC;"used for the follow menu overwritten in type/set.rb and type/cardtype.rb for sets and cardtypes it doesn't check whether the users is following the card itself instead it checks whether he is following the complete set ;T;@B;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@B; I"used for the follow menu overwritten in type/set.rb and type/cardtype.rb for sets and cardtypes it doesn't check whether the users is following the card itself instead it checks whether he is following the complete set;T;!0;"o;#;$F;%iq;&is;'@;(I"def followed_by?(user_id);T;)T;*I" def followed_by? user_id with_follower_candidate_ids do if follow_rule_applies? user_id return true end if left_card = left and left_card.followed_field?(self) && left_card.followed_by?(user_id) return true end return false end end;T;+To; ; F; ;,;;;I"%Card::Set::All::Follow#followed?;F;[;[[@iv[@i~;F;:followed?;;;[;{;IC;" ;T;@X;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@X; I";T;!0;'@;(I"def followed?;T;)T;*I"5def followed? followed_by? Auth.current_id end;T;+To; ; F; ;,;;;I"0Card::Set::All::Follow#follow_rule_applies?;F;[[I"follower_id;T0;[[@i{[@i};F;:follow_rule_applies?;;;[;{;IC;" ;T;@k;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@k; I";T;!0;'@;(I"*def follow_rule_applies?(follower_id);T;)T;*I"def follow_rule_applies? follower_id follow_rule = rule :follow, :user_id=>follower_id if follow_rule.present? follow_rule.split("\n").each do |value| value_code = value.to_name.code accounted_ids = ( @follower_candidate_ids[ value_code ] ||= if block = FollowOption.follower_candidate_ids[ value_code ] block.call self else [] end ) applicable = if test = FollowOption.test[ value_code ] test.call follower_id, accounted_ids else accounted_ids.include? follower_id end return value.gsub( /[\[\]]/, '' ) if applicable end end return false end;T;+To; ; F; ;,;;;I"7Card::Set::All::Follow#with_follower_candidate_ids;F;[;[[@i[@i;F;: with_follower_candidate_ids;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"$def with_follower_candidate_ids;T;)T;*I"odef with_follower_candidate_ids @follower_candidate_ids = {} yield @follower_candidate_ids = nil end;T;+To; ; F; ;,;;;I"3Card::Set::All::Follow#default_follow_set_card;F;[;[[@i[@i;T;:default_follow_set_card;;;[;{;IC;"Fthe set card to be followed if you want to follow changes of card ;T;@;F;[;[; I"Fthe set card to be followed if you want to follow changes of card;T;!0;"o;#;$F;%i;&i;'@;(I" def default_follow_set_card;T;)T;*I"Bdef default_follow_set_card Card.fetch("#{name}+*self") end;T;+To; ; F; ;,;;;I"+Card::Set::All::Follow#followed_field?;F;[[I"field_card;T0;[[@i[@i;T;:followed_field?;;;[;{;IC;"kreturns true if according to the follow_field_rule followers of self also follow changes of field_card ;T;@;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I"kreturns true if according to the follow_field_rule followers of self also follow changes of field_card;T;!0;"o;#;$F;%i;&i;'@;(I"$def followed_field?(field_card);T;)T;*I" def followed_field? field_card (follow_field_rule = rule_card(:follow_fields)) || follow_field_rule.item_names.find do |item| item.to_name.key == field_card.key || (item.to_name.key == Card[:includes].key && included_card_ids.include?(field_card.id) ) end end;T;+To; ; F; ;,;;;I"(Card::Set::All::Follow#follower_ids;F;[;[[@i[@i;F;:follower_ids;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def follower_ids;T;)T;*I"Qdef follower_ids @follower_ids = read_follower_ids_cache || begin result = direct_follower_ids left_card = left while left_card if left_card.followed_field? self result += left_card.direct_follower_ids end left_card = left_card.left end write_follower_ids_cache result result end end;T;+To; ; F; ;,;;;I",Card::Set::All::Follow#direct_followers;F;[;[[@i[@i;F;:direct_followers;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def direct_followers;T;)T;*I"Xdef direct_followers direct_follower_ids.map do |id| Card.fetch(id) end end;T;+To; ; F; ;,;;;I"/Card::Set::All::Follow#direct_follower_ids;F;[[I" _args;TI"{};T;[[@i[@i;T;:direct_follower_ids;;;[;{;IC;"all ids of users that follow this card because of a follow rule that applies to this card doesn't include users that follow this card because they are following parent cards or other cards that include this card ;T;@;F;[;[; I"all ids of users that follow this card because of a follow rule that applies to this card doesn't include users that follow this card because they are following parent cards or other cards that include this card;T;!0;"o;#;$F;%i;&i;'@;(I"&def direct_follower_ids(_args={});T;)T;*I"{def direct_follower_ids args={} result = ::Set.new with_follower_candidate_ids do set_names.each do |set_name| set_card = Card.fetch(set_name) set_card.all_user_ids_with_rule_for(:follow).each do |user_id| if (!result.include? user_id) and self.follow_rule_applies?(user_id) result << user_id end end end end result end;T;+To; ; F; ;,;;;I"?Card::Set::All::Follow#all_direct_follower_ids_with_reason;F;[;[[@i[@i;F;:(all_direct_follower_ids_with_reason;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I",def all_direct_follower_ids_with_reason;T;)T;*I"def all_direct_follower_ids_with_reason with_follower_candidate_ids do visited = ::Set.new set_names.each do |set_name| set_card = Card.fetch(set_name) set_card.all_user_ids_with_rule_for(:follow).each do |user_id| if (!visited.include?(user_id)) && (follow_option = self.follow_rule_applies?(user_id)) visited << user_id yield(user_id, :set_card=>set_card, :option=>follow_option) end end end end end;T;+To; ; F; ;,;;;I"4Card::Set::All::Follow#write_follower_ids_cache;F;[[I" user_ids;T0;[[@i[@i;T;:write_follower_ids_cache;;;[;{;IC;"~~~~~ cache methods ;T;@;F;[;[; I"~~~~~ cache methods;T;!0;"o;#;$F;%i;&i;'@;(I"+def write_follower_ids_cache(user_ids);T;)T;*I"def write_follower_ids_cache user_ids hash = Card.follower_ids_cache hash[id] = user_ids Card.write_follower_ids_cache hash end;T;+To; ; F; ;,;;;I"3Card::Set::All::Follow#read_follower_ids_cache;F;[;[[@i[@i;F;:read_follower_ids_cache;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I" def read_follower_ids_cache;T;)T;*I"Bdef read_follower_ids_cache Card.follower_ids_cache[id] end;T;+To;7;IC;[ o; ; F; ;,;;;I"?Card::Set::All::Follow::ClassMethods#follow_caches_expired;F;[;[[@i[@i;F;:follow_caches_expired;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def follow_caches_expired;T;)T;*I"_def follow_caches_expired Card.clear_follower_ids_cache Card.clear_user_rule_cache end;T;+To; ; F; ;,;;;I"0 ) if right.id == Card::ReadID end end end;T;+To; ; F; ;,;;;I"*Card::Set::All::Pattern#safe_set_keys;F;[;[[@vi$[@ti%;F;:safe_set_keys;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@m;(I"def safe_set_keys;T;)T;*I"Edef safe_set_keys patterns.map( &:safe_key ).reverse * " " end;T;+To; ; F; ;,;;;I"(Card::Set::All::Pattern#set_modules;F;[;[[@vi([@ti);F;:set_modules;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@m;(I"def set_modules;T;)T;*I"rdef set_modules @set_modules ||= patterns_without_new[0..-2].reverse.map(&:module_list).flatten.compact end;T;+To; ; F; ;,;;;I"/Card::Set::All::Pattern#set_format_modules;F;[[I" klass;T0;[[@vi,[@ti.;F;:set_format_modules;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@m;(I""def set_format_modules(klass);T;)T;*I"def set_format_modules klass @set_format_modules ||= {} @set_format_modules[klass] = patterns_without_new[0..-2].reverse.map do |pattern| pattern.format_module_list klass end.flatten.compact end;T;+To; ; F; ;,;;;I"&Card::Set::All::Pattern#set_names;F;[;[[@vi3[@ti6;F;:set_names;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@m;(I"def set_names;T;)T;*I"def set_names if @set_names.nil? @set_names = patterns.map &:to_s Card.set_members @set_names, key end @set_names end;T;+To; ; F; ;,;;;I"*Card::Set::All::Pattern#rule_set_keys;F;[;[[@vi;[@ti>;F;:rule_set_keys;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@m;(I"def rule_set_keys;T;)T;*I"def rule_set_keys set_names #this triggers set_members cache. need better solution! @rule_set_keys ||= patterns.map( &:rule_set_key ).compact end;T;+T;I@m;JIC;[o;S ;T0;UI"Card::Set;T;V@m;;;'@;W@;X;Y;I@m;KIC;[;I@m;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@vi;F;: Pattern;;;;;[;{;IC;" ;T;@m;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Pattern;F;+To;7;IC;[ o; ;IC;[ o; ; F; ;,;;;I"5Card::Set::All::Notify::FollowerStash#initialize;F;[[I" card;TI"nil;T;[[I".tmpsets/set/mod006-05_email/all/notify.rb;Ti [I".tmpsets/set/mod006-05_email/all/notify.rb;Ti ;F;:initialize;;;[;{;IC;" ;T;@ ;.0;F;[;[o;0 ;1I" return;F;2I"$a new instance of FollowerStash;T;0;3[I"FollowerStash;F;@ ; I";T;!0;'@ ;(I"def initialize(card=nil);T;)T;*I"def initialize card=nil @followed_affected_cards = Hash.new { |h,v| h[v]=[] } @visited = ::Set.new add_affected_card(card) if card end;T;+To; ; F; ;,;;;I"reason end if card.left and !@visited.include?(card.left.name) and follow_field_rule = card.left.rule_card(:follow_fields) follow_field_rule.item_names(:context=>card.left.cardname).each do |item| if @visited.include? item.to_name.key add_affected_card card.left break elsif item.to_name.key == Card[:includes].key includee_set = Card.search(:included_by=>card.left.name).map(&:key) if !@visited.intersection(includee_set).empty? add_affected_card card.left break end end end end end end end;T;+To; ; F; ;,;;;I"4Card::Set::All::Notify::FollowerStash#followers;F;[;[[@i-[@i*;F;;%;;;[;{;IC;" ;T;@3;.0;F;[;[; I";T;!0;'@ ;(I"def followers;T;)T;*I"6def followers @followed_affected_cards.keys end;T;+To; ; F; ;,;;;I"DCard::Set::All::Notify::FollowerStash#each_follower_with_reason;F;[;[[@i1[@i.;T;:each_follower_with_reason;;;[;{;IC;"8"follower" is a card object, "followed" a card name ;T;@A;F;[;[; I"8"follower" is a card object, "followed" a card name;T;!0;"o;#;$F;%i1;&i1;'@ ;(I""def each_follower_with_reason;T;)T;*I"def each_follower_with_reason # "follower" is a card object, "followed" a card name @followed_affected_cards.each do |user, reasons| yield(user,reasons.first) end end;T;+To; ; F; ;,;;;I"1Card::Set::All::Notify::FollowerStash#notify;F;[[I" follower;T0[I" because;T0;[[@i9[@i=;F;: notify;;;[;{;IC;" ;T;@P;.0;F;[;[; I";T;!0;'@ ;(I""def notify(follower, because);T;)T;*I"Zdef notify follower, because @followed_affected_cards[follower] << because[:of] end;T;+To; ; F; ;,;;;I"BCard::Set::All::Notify::FollowerStash#notify_direct_followers;F;[[I" card;T0;[[@i7;F;:notify_direct_followers;;;[;{;IC;" ;T;@b;.0;F;[;[; I";T;!0;'@ ;(I"%def notify_direct_followers card;T;)T;*I"def notify_direct_followers card card.all_direct_follower_ids_with_reason do |user_id, reason| notify Card.fetch(user_id), of: reason end end;T;+T;I@ ;JIC;[;I@ ;KIC;[;I@ ;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i [@i ;T;:FollowerStash;;;;;[;{;IC;"|~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_email/set/all/notify.rb ~~~~~~~~~~~ ;T;@ ;F;[;[; I"|~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_email/set/all/notify.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@;I"*Card::Set::All::Notify::FollowerStash;F:@superclasso;S ;T0;U0;V0;: Object;'@;Wo; ;IC;[ o; ; F; ;,;;;I"Object#deep_clone;F;[;[[I"lib/card/core_ext.rb;Ti;T;:deep_clone;;;[;{;IC;"1FIXME: move this, mixin, don't extend Object ;T;@;F;[;[; I"1FIXME: move this, mixin, don't extend Object;T;!0;"o;#;$F;%i;&i;'@;(I"def deep_clone;T;)T;*I"def deep_clone case self when Fixnum,Bignum,Float,NilClass,FalseClass,TrueClass,Symbol klone = self when Hash klone = self.clone self.each{|k,v| klone[k] = v.deep_clone} when Array klone = self.clone klone.clear self.each{|v| klone << v.deep_clone} else klone = self.clone end klone.instance_variables.each {|v| klone.instance_variable_set(v, klone.instance_variable_get(v).deep_clone) } klone end;T;+To; ; F; ;,;;;I"Object#send_unless;F;[[I" method;T0[I" *args;T0[I" &_block;T0;[[@i;F;:send_unless;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I",def send_unless(method, *args, &_block);T;)T;*I"gdef send_unless method, *args, &block ( block_given? ? yield : self ) or send method, *args end;T;+To; ; F; ;,;;;I"Object#send_if;F;[[I" method;T0[I" *args;T0[I" &_block;T0;[[@i!;F;: send_if;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"(def send_if(method, *args, &_block);T;)T;*I"gdef send_if method, *args, &block ( block_given? ? yield : self ) and send method, *args end;T;+To; ; F; ;,;;;I"Object#to_name;F;[;[[@i%;F;: to_name;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def to_name;T;)T;*I"*def to_name Card::Name.new self end;T;+To; ; F; ;,;;;I"Object#to_viewname;F;[;[[@i);F;:to_viewname;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def to_viewname;T;)T;*I"2def to_viewname Card::ViewName.new self end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;;J;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I" Object;F;Io;S ;T0;U0;V0;:BasicObject;'@;W0;X; ;X0;+To; ; F; ;,;;;I"$Card::Set::All::Notify#act_card;F;[;[[@i?[@iB;F;: act_card;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def act_card;T;)T;*I"*def act_card @supercard || self end;T;+To; ; F; ;,;;;I"'Card::Set::All::Notify#followable?;F;[;[[@iD[@iF;F;:followable?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def followable?;T;)T;*I"def followable? true end;T;+To; ; F; ;,;;;I"+Card::Set::All::Notify#notable_change?;F;[;[[@iH[@iN;F;:notable_change?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def notable_change?;T;)T;*I"def notable_change? !silent_change && !supercard && current_act && Card::Auth.current_id != WagnBotID && followable? end;T;+To; ; F; ;,;;;I",Card::Set::All::Notify#notify_followers;F;[;[[@i\[@ie;F;:notify_followers;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def notify_followers;T;)T;*I"def notify_followers begin @current_act.reload @follower_stash ||= FollowerStash.new @current_act.actions.each do |a| @follower_stash.add_affected_card a.card if a.card end @follower_stash.each_follower_with_reason do |follower, reason| if follower.account and follower != @current_act.actor follower.account.send_change_notice @current_act, reason[:set_card].name, reason[:option] end end rescue =>e #this error handling should apply to all extend callback exceptions Rails.logger.info "\nController exception: #{e.message}" Card::Error.current = e notable_exception_raised end end;T;+To; ; F; ;,;;;I"*Card::Set::All::Notify#silent_change?;F;[;[[@iJ;F;:silent_change?;;;[;{;IC;" ;T;@(;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@(; I";T;!0;'@;(I"def silent_change?;T;)T;*I"Zdef silent_change? silent_change.nil? ? !Card::Env[:controller] : silent_change end;T;+T;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;: Notify;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Notify;F;+To;7;IC;[o; ; F; ;,;;;I"$Card::Set::All::Content#content;F;[;[[I".tmpsets/set/mod001-01_core/all/content.rb;Ti [I".tmpsets/set/mod001-01_core/all/content.rb;Ti ;F;: content;;;[;{;IC;" ;T;@N;.0;F;[;[; I";T;!0;'@L;(I"def content;T;)T;*I"Gdef content db_content or (new_card? && template.db_content) end;T;+To; ; F; ;,;;;I"%Card::Set::All::Content#content=;F;[[I" value;T0;[[@Si[@Ui;F;: content=;;;[;{;IC;" ;T;@^;.0;F;[;[; I";T;!0;'@L;(I"def content=(value);T;)T;*I"6def content=(value) self.db_content = value end;T;+To; ; F; ;,;;;I"(Card::Set::All::Content#raw_content;F;[;[[@Si[@Ui;F;:raw_content;;;[;{;IC;" ;T;@n;.0;F;[;[; I";T;!0;'@L;(I"def raw_content;T;)T;*I"Ddef raw_content structure ? template.db_content : content end;T;+To; ; F; ;,;;;I""Card::Set::All::Content#label;F;[;[[@Si[@Ui;F;: label;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@L;(I"def label;T;)T;*I"def label name end;T;+To; ; F; ;,;;;I"$Card::Set::All::Content#creator;F;[;[[@Si [@Ui!;F;: creator;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@L;(I"def creator;T;)T;*I")def creator Card[ creator_id ] end;T;+To; ; F; ;,;;;I"$Card::Set::All::Content#updater;F;[;[[@Si$[@Ui%;F;: updater;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@L;(I"def updater;T;)T;*I")def updater Card[ updater_id ] end;T;+To; ; F; ;,;;;I"(Card::Set::All::Content#clean_html?;F;[;[[@Si([@Ui);F;:clean_html?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@L;(I"def clean_html?;T;)T;*I"def clean_html? true end;T;+To; ; F; ;,;;;I"%Card::Set::All::Content#history?;F;[;[[@Si,;F;: history?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@L;(I"def history?;T;)T;*I"def history? false end;T;+To; ; F; ;,;;;I"/Card::Set::All::Content#save_content_draft;F;[[I" _content;T0;[[@Si0[@Ui-;F;:save_content_draft;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@L;(I"%def save_content_draft(_content);T;)T;*I"6def save_content_draft content clear_drafts end;T;+To; ; F; ;,;;;I")Card::Set::All::Content#clear_drafts;F;[;[[@Si4[@Ui1;F;:clear_drafts;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@L;(I"def clear_drafts;T;)T;*I"kdef clear_drafts drafts.created_by(Card::Auth.current_id).each do |draft| draft.delete end end;T;+To; ; F; ;,;;;I"/Card::Set::All::Content#last_draft_content;F;[;[[@Ui5;F;:last_draft_content;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@L;(I"def last_draft_content;T;)T;*I"Edef last_draft_content drafts.last.card_changes.last.value end;T;+T;I@L;JIC;[o;S ;T0;UI"Card::Set;T;V@L;;;'@;W@;X;Y;I@L;KIC;[;I@L;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Si;F;: Content;;;;;[;{;IC;" ;T;@L;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Content;F;+To;7;IC;[o; ; F; ;,;;;I"/Card::Set::All::Observer#send_action_mails;F;[[I" args;T0;[[I"0tmpsets/set/mod006-05_email/all/observer.rb;Ti [I"0tmpsets/set/mod006-05_email/all/observer.rb;Ti;T;:send_action_mails;;;[;{;IC;"~~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_email/set/all/observer.rb ~~~~~~~~~~~ ;T;@ ;F;[;[; I"~~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_email/set/all/observer.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@;(I" def send_action_mails(args);T;)T;*I"def send_action_mails args setting = "on_#{args[:on]}".to_sym email_templates_for( setting ) do |mailcard| mailcard.deliver( context: self ) end end;T;+To; ; F; ;,;;;I"1Card::Set::All::Observer#email_templates_for;F;[[I" setting;T0;[[@i[@i;F;:email_templates_for;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"%def email_templates_for(setting);T;)T;*I"def email_templates_for setting if email_templates = @email_template_cache || ( event_card = self.rule_card(setting) and event_card.extended_item_cards ) email_templates.each do |mailcard| yield(mailcard) end end end;T;+T;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;: Observer;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Observer;F;+To;7;IC;[;I@?;JIC;[o;S ;T0;UI"Card::Set;T;V@?;;;'@;W@;X;Y;I@?;KIC;[;I@?;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"0tmpsets/set/mod007-05_standard/all/links.rb;Ti;F;: Links;;;;;[;{;IC;" ;T;@?;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Links;F;+To;7;IC;[o; ; F; ;,;;;I"&Card::Set::All::Error#copy_errors;F;[[I" card;T0;[[I"0tmpsets/set/mod007-05_standard/all/error.rb;Ti ;T;:copy_errors;;;[;{;IC;"~~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/error.rb ~~~~~~~~~~~ ;T;@V;F;[;[; I"~~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/error.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@T;(I"def copy_errors card;T;)T;*I"\def copy_errors card card.errors.each do |att, msg| errors.add att, msg end end;T;+T;I@T;JIC;[o;S ;T0;UI"Card::Set;T;V@T;;;'@;W@;X;Y;I@T;KIC;[;I@T;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"0tmpsets/set/mod007-05_standard/all/error.rb;Ti;F;: Error;;;;;[;{;IC;" ;T;@T;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Error;F;+To;7;IC;[o;4;[[I"1tmpsets/set/mod002-01_history/all/history.rb;Ti [I"1tmpsets/set/mod002-01_history/all/history.rb;Ti;T;:REVISIONS_PER_PAGE;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_history/set/all/history.rb ~~~~~~~~~~~ ;T;@|;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_history/set/all/history.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@z;I"0Card::Set::All::History::REVISIONS_PER_PAGE;F;(I"8REVISIONS_PER_PAGE = Card.config.revisions_per_page;T;*I"8REVISIONS_PER_PAGE = Card.config.revisions_per_page;T;6I"#Card.config.revisions_per_page;T;+To; ; F; ;,;;;I"%Card::Set::All::History#history?;F;[;[[@i [@i ;F;;^;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@z;(I"def history?;T;)T;*I"def history? true end;T;+To; ; F; ;,;;;I".Card::Set::All::History#rollback_request?;F;[;[[@iG[@i[;F;:rollback_request?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@z;(I"def rollback_request?;T;)T;*I"wdef rollback_request? history? && Env && Env.params['action_ids'] && Env.params['action_ids'].class == Array end;T;+To; ; F; ;,;;;I"2Card::Set::All::History#intrusive_family_acts;F;[[I" args;TI"{};T;[[@i\[@is;T;:intrusive_family_acts;;;[;{;IC;"aall acts with actions on self and on cards that are descendants of self and included in self ;T;@;F;[;[; I"aall acts with actions on self and on cards that are descendants of self and included in self;T;!0;"o;#;$F;%iq;&ir;'@z;(I"'def intrusive_family_acts(args={});T;)T;*I"def intrusive_family_acts args={} # all acts with actions on self and on cards that are descendants of self and included in self @intrusive_family_acts ||= begin Act.find_all_with_actions_on( (included_descendant_card_ids << id), args) end end;T;+To; ; F; ;,;;;I"+Card::Set::All::History#intrusive_acts;F;[[I" args;TI"{ with_drafts: true };T;[[@ib[@iz;T;:intrusive_acts;;;[;{;IC;"@all acts with actions on self and on cards included in self ;T;@;F;[;[; I"@all acts with actions on self and on cards included in self;T;!0;"o;#;$F;%iy;&iy;'@z;(I"3def intrusive_acts(args={ with_drafts: true });T;)T;*I"def intrusive_acts args={:with_drafts=>true} # all acts with actions on self and on cards included in self @intrusive_acts ||= begin Act.find_all_with_actions_on( (included_card_ids << id), args) end end;T;+To; ; F; ;,;;;I"+Card::Set::All::History#current_rev_nr;F;[;[[@ih[@i{;F;:current_rev_nr;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@z;(I"def current_rev_nr;T;)T;*I"def current_rev_nr @current_rev_nr ||= begin intrusive_acts.first.actions.last.draft ? @intrusive_acts.size - 1 : @intrusive_acts.size end end;T;+To; ; F; ;,;;;I".Card::Set::All::History#included_card_ids;F;[;[[@in[@i;F;:included_card_ids;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@z;(I"def included_card_ids;T;)T;*I"def included_card_ids Card::Reference.select(:referee_id).where( :ref_type => 'I', :referer_id=>id ).pluck('referee_id').compact.uniq end;T;+To; ; F; ;,;;;I"0Card::Set::All::History#descendant_card_ids;F;[[I"parent_ids;TI" [id];T;[[@ir[@i;F;:descendant_card_ids;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@z;(I"-def descendant_card_ids(parent_ids=[id]);T;)T;*I"def descendant_card_ids parent_ids=[id] more_ids = Card.where('left_id IN (?)', parent_ids).pluck('id') if !more_ids.empty? more_ids += descendant_card_ids more_ids end more_ids end;T;+To; ; F; ;,;;;I"9Card::Set::All::History#included_descendant_card_ids;F;[;[[@i{[@i;F;:!included_descendant_card_ids;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@z;(I"%def included_descendant_card_ids;T;)T;*I"Sdef included_descendant_card_ids included_card_ids & descendant_card_ids end;T;+To; ; F; ;,;;;I"&Card::Set::All::History#diff_args;F;[;[[@iM[@it;F;:diff_args;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@z;(I"def diff_args;T;)T;*I")def diff_args {:format=>:text} end;T;+To; ; F; ;,;;;I"-Card::Set::All::History#finalize_action?;F;[;[[@i";F;:finalize_action?;;;[;{;IC;" ;T;@ ;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@ ; I";T;!0;'@z;(I"def finalize_action?;T;)T;*I"Xdef finalize_action? (history? || respond_to?(:attachment)) && current_action end;T;+To; ; F; ;,;;;I"'Card::Set::All::History#has_edits?;F;[;[[@ix;F;:has_edits?;;;[;{;IC;" ;T;@2;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@2; I";T;!0;'@z;(I"def has_edits?;T;)T;*I"]def has_edits? Card::Act.where(actor_id: id).where('card_id IS NOT NULL').present? end;T;+T;I@z;JIC;[o;S ;T0;UI"Card::Set;T;V@z;;;'@;W@;X;Y;I@z;KIC;[;I@z;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;: History;;;;;[;{;IC;" ;T;@z;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::History;F;+To;7;IC;[;I@V;JIC;[o;S ;T0;UI"Card::Set;T;V@V;;;'@;W@;X;Y;I@V;KIC;[;I@V;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"1tmpsets/set/mod003-02_basic_types/all/rss.rb;Ti;F;:Rss;;;;;[;{;IC;" ;T;@V;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Rss;F;+To;7;IC;[ o; ; F; ;,;;;I"4Card::Set::All::Actions#select_action_by_params;F;[[I" params;T0;[[I"1tmpsets/set/mod002-01_history/all/actions.rb;Ti [I"1tmpsets/set/mod002-01_history/all/actions.rb;Ti ;T;:select_action_by_params;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_history/set/all/actions.rb ~~~~~~~~~~~ -*- encoding : utf-8 -*- ;T;@m;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_history/set/all/actions.rb ~~~~~~~~~~~ -*- encoding : utf-8 -*-;T;!0;"o;#;$F;%i;&i ;'@k;(I"(def select_action_by_params(params);T;)T;*I"def select_action_by_params params if (action = find_action_by_params(params)) run_callbacks :select_action do self.selected_action_id = action.id end end end;T;+To; ; F; ;,;;;I"2Card::Set::All::Actions#find_action_by_params;F;[[I" args;T0;[[@ti;F;:find_action_by_params;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@k;(I"$def find_action_by_params(args);T;)T;*I"cdef find_action_by_params args if args[:rev] nth_action args[:rev] elsif Integer === args[:rev_id] || args[:rev_id] =~ /^\d+$/ if action = Action.fetch(args[:rev_id]) and action.card_id == id action end elsif args[:rev_id] # revision id is probalby a mod (e.g. if you request files/:logo/05_standard.png) last_action end end;T;+To; ; F; ;,;;;I"'Card::Set::All::Actions#nth_action;F;[[I" index;T0;[[@ti[@vi ;F;:nth_action;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@k;(I"def nth_action(index);T;)T;*I"def nth_action index index = index.to_i if id and index > 0 Action.where("draft is not true AND card_id = #{id}").order(:id).limit(1).offset(index-1).first end end;T;+To; ; F; ;,;;;I"%Card::Set::All::Actions#revision;F;[[I" action;T0;[[@ti%[@vi';F;: revision;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@k;(I"def revision(action);T;)T;*I"def revision action # a "revision" refers to the state of all tracked fields at the time of a given action if action.is_a? Integer action = Card::Action.fetch(action) end action and Card::TRACKED_FIELDS.inject({}) do |attr_changes, field| last_change = action.card_changes.find_by_field_name(field) || last_change_on(field, :not_after=>action) attr_changes[field.to_sym] = (last_change ? last_change.value : self[field]) attr_changes end end;T;+To; ; F; ;,;;;I"/Card::Set::All::Actions#delete_old_actions;F;[;[[@ti1[@vi5;F;:delete_old_actions;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@k;(I"def delete_old_actions;T;)T;*I"def delete_old_actions Card::TRACKED_FIELDS.each do |field| # assign previous changes on each tracked field to the last action if (la = last_action) && !la.change_for(field).present? and (last_change = last_change_on(field)) last_change = Card::Change.find(last_change.id) # last_change comes as readonly record last_change.update_attributes!(:card_action_id=>last_action_id) end end actions.where('id != ?', last_action_id ).delete_all end;T;+T;I@k;JIC;[o;S ;T0;UI"Card::Set;T;V@k;;;'@;W@;X;Y;I@k;KIC;[;I@k;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@ti;F;: Actions;;;;;[;{;IC;" ;T;@k;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Actions;F;+To;7;IC;[;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"1tmpsets/set/mod001-01_core/all/view_cache.rb;Ti;F;:ViewCache;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::ViewCache;F;+To;7;IC;[o; ; F; ;,;;;I",Card::Set::All::Templating#is_template?;F;[;[[I"1tmpsets/set/mod001-01_core/all/templating.rb;Ti [I"1tmpsets/set/mod001-01_core/all/templating.rb;Ti ;T;:is_template?;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/templating.rb ~~~~~~~~~~~ ;T;@;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/templating.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@;(I"def is_template?;T;)T;*I"Edef is_template? cardname.trait_name? :structure, :default end;T;+To; ; F; ;,;;;I"-Card::Set::All::Templating#is_structure?;F;[;[[@i [@i;F;:is_structure?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def is_structure?;T;)T;*I"true dup_card = dup dup_card.type_id = default ? default.type_id : Card.default_type_id if structure = dup_card.structure_rule_card @virtual = true if junction? self.type_id = structure.type_id if assign_type_to?(structure) structure else default end # EXISTING CARDS elsif structure = structure_rule_card repair_type structure.type_id if assign_type_to?(structure) structure end end end;T;+To; ; F; ;,;;;I"/Card::Set::All::Templating#assign_type_to?;F;[[I"structure;T0;[[@i.[@i/;F;:assign_type_to?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"#def assign_type_to?(structure);T;)T;*I"adef assign_type_to? structure type_id != structure.type_id and structure.assigns_type? end;T;+To; ; F; ;,;;;I")Card::Set::All::Templating#structure;F;[;[[@i2[@i?;F;:structure;;;[;{;IC;" ;T;@2;.0;F;[;[; I";T;!0;'@;(I"def structure;T;)T;*I"Qdef structure if template && template.is_structure? template end end;T;+To; ; F; ;,;;;I"(Card::Set::All::Templating#virtual?;F;[;[[@i8[@iD;F;: virtual?;;;[;{;IC;" ;T;@@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@@; I";T;!0;'@;(I"def virtual?;T;)T;*I"def virtual? return false unless new_card? if @virtual.nil? cardname.simple? ? @virtual=false : template end @virtual end;T;+To; ; F; ;,;;;I"3Card::Set::All::Templating#structure_rule_card;F;[;[[@i@[@iL;F;:structure_rule_card;;;[;{;IC;" ;T;@S;.0;F;[;[; I";T;!0;'@;(I"def structure_rule_card;T;)T;*I"def structure_rule_card card = rule_card :structure, :skip_modules=>true card && card.db_content.strip == '_self' ? nil : card end;T;+To; ; F; ;,;;;I"0Card::Set::All::Templating#structuree_names;F;[;[[@iE;F;:structuree_names;;;[;{;IC;" ;T;@a;.0;F;[;[; I";T;!0;'@;(I"def structuree_names;T;)T;*I"def structuree_names if wql = structuree_spec Auth.as_bot do Card::Query.new(wql.merge :return=>:name).run end else [] end end;T;+To; ; F; ;,;;;I" 1 end;T;+To; ; F; ;,;;;I"2Card::Set::All::Templating#update_structurees;F;[[I" args;T0;[[@iX;F;:update_structurees;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@;(I" def update_structurees args;T;)T;*I"def update_structurees args # note that this is not smart about overriding templating rules # for example, if someone were to change the type of a +*right+*structure rule that was overridden # by a +*type plus right+*structure rule, the override would not be respected. if query = structuree_spec Auth.as_bot do Card::Query.new( query.merge(:return => :id) ).run.each_slice(100) do |id_batch| Card.where( :id => id_batch ).update_all args end end end end;T;+To; ; F; ;,;;;I"-Card::Set::All::Templating#assigns_type?;F;[;[[@ie[@i4;F;:assigns_type?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def assigns_type?;T;)T;*I"def assigns_type? # needed because not all *structure templates govern the type of set members # for example, X+*type+*structure governs all cards of type X, # but the content rule does not (in fact cannot) have the type X. if is_structure? if set_pattern = Card.fetch( cardname.trunk_name.tag_name, :skip_modules=>true ) pattern_code = set_pattern.codename and set_class = Card::SetPattern.find( pattern_code ) and set_class.assigns_type end end end;T;+To; ; F; ;,;;;I"+Card::Set::All::Templating#repair_type;F;[[I"template_type_id;T0;[[@it;F;:repair_type;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"%def repair_type template_type_id;T;)T;*I"def repair_type template_type_id # this is a mechanism for repairing bad data. like #repair_key, it should be obviated and removed. self.type_id = template_type_id update_column :type_id, type_id reset_patterns end;T;+To; ; F; ;,;;;I"/Card::Set::All::Templating#structuree_spec;F;[;[[@i{;F;:structuree_spec;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def structuree_spec;T;)T;*I"def structuree_spec if is_structure? and c=trunk and c.type_id = Card::SetID #could use is_rule?... c.get_query end end;T;+To; ; F; ;,;;;I"1Card::Set::All::Templating#new_card_template;F;[;[[@i ;F;:new_card_template;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def new_card_template;T;)T;*I"`def new_card_template default = rule_card :default, skip_modules: true dup_card = dup dup_card.type_id = default ? default.type_id : Card.default_type_id if (structure = dup_card.structure_rule_card) @virtual = true if junction? self.type_id = structure.type_id if assign_type_to?(structure) structure else default end end;T;+T;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;:Templating;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Templating;F;+To;7;IC;[o; ; F; ;,;;;I"0Card::Set::All::References#name_referencers;F;[[I"link_name;TI"nil;T;[[I"1tmpsets/set/mod001-01_core/all/references.rb;Ti [I"1tmpsets/set/mod001-01_core/all/references.rb;Ti ;F;:name_referencers;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"(def name_referencers(link_name=nil);T;)T;*I"def name_referencers link_name=nil link_name = link_name.nil? ? key : link_name.to_name.key Card.joins( :references_to ).where card_references: { referee_key: link_name } end;T;+To; ; F; ;,;;;I"4Card::Set::All::References#extended_referencers;F;[;[[@i[@i;F;:extended_referencers;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def extended_referencers;T;)T;*I"def extended_referencers # FIXME .. we really just need a number here. (dependents + [self]).map(&:referencers).flatten.uniq end;T;+To; ; F; ;,;;;I"2Card::Set::All::References#replace_references;F;[[I" old_name;T0[I" new_name;T0;[[@i[@i;T;:replace_references;;;[;{;IC;"'replace references in card content ;T;@;F;[;[; I"'replace references in card content;T;!0;"o;#;$F;%i;&i;'@;(I"/def replace_references(old_name, new_name);T;)T;*I"def replace_references old_name, new_name obj_content = Card::Content.new raw_content, card=self obj_content.find_chunks( Card::Chunk::Reference ).select do |chunk| if old_ref_name = chunk.referee_name and new_ref_name = old_ref_name.replace_part(old_name, new_name) chunk.referee_name = chunk.replace_reference old_name, new_name Card::Reference.where( :referee_key => old_ref_name.key ).update_all :referee_key => new_ref_name.key end end obj_content.to_s end;T;+To; ; F; ;,;;;I"1Card::Set::All::References#update_references;F;[[I"rendered_content;TI"nil;T;[[@i"[@i%;T;:update_references;;;[;{;IC;"&update entries in reference table ;T;@;F;[;[; I"&update entries in reference table;T;!0;"o;#;$F;%i$;&i$;'@;(I"0def update_references(rendered_content=nil);T;)T;*I"def update_references rendered_content = nil, refresh = false raise "update references should not be called on new cards" if id.nil? Card::Reference.delete_all_from self # FIXME: why not like this: references_expired = nil # do we have to make sure this is saved? #Card.update( id, :references_expired=>nil ) # or just this and save it elsewhere? #references_expired=nil Card.connection.execute("update cards set references_expired=NULL where id=#{id}") # references_expired = nil expire if refresh rendered_content ||= Card::Content.new(raw_content, card=self) rendered_content.find_chunks(Card::Chunk::Reference).each do |chunk| if referee_name = chunk.referee_name # name is referenced (not true of commented inclusions) referee_id = chunk.referee_id if id != referee_id # not self reference #update_references chunk.referee_name if Card::Content === chunk.referee_name # for the above to work we will need to get past delete_all! referee_name.piece_names.each do |name| if name.key != key # don't create self reference # reference types: # L = link # I = inclusion # P = partial (i.e. the name is part of a compound name that is referenced by a link or inclusion) # The partial type is needed to keep track of references of virtual cards. # For example a link [[A+*self]] won't make it to the reference table because A+*self is virtual and # doesn't have an id but when A's name is changed we have to find and update that link. ref_type = if name == referee_name case chunk when Card::Chunk::Link then 'L' when Card::Chunk::QueryReference then 'Q' else 'I' end else 'P' end Card::Reference.create!( :referer_id => id, :referee_id => Card.where(:key=>name.key).pluck(:id).first, :referee_key => name.key, :ref_type => ref_type, :present => 1 ) end end end end end end;T;+To; ; F; ;,;;;I"+Card::Set::All::References#referencers;F;[;[[@i][@iL;F;:referencers;;;[;{;IC;" ;T;@!;.0;F;[;[; I";T;!0;'@;(I"def referencers;T;)T;*I"def referencers return [] unless refs = references_from refs.map(&:referer_id).map( &Card.method(:fetch) ).compact end;T;+To; ; F; ;,;;;I")Card::Set::All::References#includers;F;[;[[@ib[@iP;F;:includers;;;[;{;IC;" ;T;@/;.0;F;[;[; I";T;!0;'@;(I"def includers;T;)T;*I"def includers return [] unless refs = references_from.where( :ref_type => 'I' ) refs.map(&:referer_id).map( &Card.method(:fetch) ).compact end;T;+To; ; F; ;,;;;I"(Card::Set::All::References#referees;F;[;[[@ig[@iU;F;: referees;;;[;{;IC;" ;T;@=;.0;F;[;[; I";T;!0;'@;(I"def referees;T;)T;*I"def referees return [] unless refs = references_to refs.map { |ref| Card.fetch ref.referee_key, :new=>{} }.compact end;T;+To; ; F; ;,;;;I")Card::Set::All::References#includees;F;[;[[@il[@iY;F;:includees;;;[;{;IC;" ;T;@K;.0;F;[;[; I";T;!0;'@;(I"def includees;T;)T;*I"def includees return [] unless refs = references_to.where( :ref_type => 'I' ) refs.map { |ref| Card.fetch ref.referee_key, :new=>{} }.compact end;T;+To;4;[[@i ;T;:PARTIAL_REF_CODE;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/references.rb ~~~~~~~~~~~ ;T;@Y;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/references.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@;I"1Card::Set::All::References::PARTIAL_REF_CODE;F;(I"PARTIAL_REF_CODE = 'P';T;*I"PARTIAL_REF_CODE = 'P';T;6I"'P';T;+To; ; F; ;,;;;I"3Card::Set::All::References#create_reference_to;F;[[I" chunk;T0;[[@i0;F;:create_reference_to;;;[;{;IC;" ;T;@g;.0;F;[;[; I";T;!0;'@;(I""def create_reference_to chunk;T;)T;*I"def create_reference_to chunk referee_name = chunk.referee_name return false unless referee_name # eg no commented nest referee_name.piece_names.each do |name| next if name.key == key # don't create self reference # reference types: # L = link # I = inclusion # P = partial (i.e. the name is part of a compound name that is # referenced by a link or inclusion) # The partial type is needed to keep track of references of virtual cards. # For example a link [[A+*self]] won't make it to the reference table # because A+*self is virtual and doesn't have an id but when A's name is # changed we have to find and update that link. ref_type = name != referee_name ? PARTIAL_REF_CODE : chunk.reference_code Card::Reference.create!( referer_id: id, referee_id: Card.fetch_id(name), referee_key: name.key, ref_type: ref_type, present: 1 ) end end;T;+T;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;:References;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::References;F;+To;7;IC;[ o;4;[[I"1tmpsets/set/mod001-01_core/all/initialize.rb;Ti [I"1tmpsets/set/mod001-01_core/all/initialize.rb;Ti;T;:JUNK_INIT_ARGS;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/initialize.rb ~~~~~~~~~~~ ;T;@;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/initialize.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@;I"/Card::Set::All::Initialize::JUNK_INIT_ARGS;F;(I"3JUNK_INIT_ARGS = %w{ missing skip_virtual id };T;*I"3JUNK_INIT_ARGS = %w{ missing skip_virtual id };T;6I""%w{ missing skip_virtual id };T;+To;7;IC;[o; ; F; ;,;;;I"1Card::Set::All::Initialize::ClassMethods#new;F;[[I" args;TI"{};T[I" _options;TI"{};T;[[@i [@i ;F;:new;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"&def new(args = {}, _options = {});T;)T;*I"def new args={}, options={} args = (args || {}).stringify_keys JUNK_INIT_ARGS.each { |a| args.delete(a) } %w{ type type_code }.each { |k| args.delete(k) if args[k].blank? } args.delete('content') if args['attach'] # should not be handled here! super args end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i [@i ;F;;;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"-Card::Set::All::Initialize::ClassMethods;F;+To; ; F; ;,;;;I"*Card::Set::All::Initialize#initialize;F;[[I" args;TI"{};T;[[@i[@i;F;;C;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def initialize(args = {});T;)T;*I"def initialize args={} args['name'] = args['name' ].to_s args['type_id'] = args['type_id'].to_i args.delete('type_id') if args['type_id'] == 0 # can come in as 0, '', or nil @type_args = { :type => args.delete('type' ), :type_code => args.delete('type_code'), :type_id => args[ 'type_id' ] } args['db_content'] = args.delete('content') if args['content'] #FIXME -- too much of the above is duplicated by assign_attributes (tracked_attributes.rb) @supercard = args.delete 'supercard' # must come before name = skip_modules = args.delete 'skip_modules' super args # ActiveRecord #initialize if tid = get_type_id( @type_args ) self.type_id = tid end include_set_modules unless skip_modules self end;T;+To; ; F; ;,;;;I"3Card::Set::All::Initialize#include_set_modules;F;[;[[@i0[@i$;F;:include_set_modules;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def include_set_modules;T;)T;*I"def include_set_modules unless @set_mods_loaded set_modules.each do |m| singleton_class.send :include, m end assign_set_specific_attributes @set_mods_loaded=true end self end;T;+T;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;:Initialize;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Initialize;F;+To;7;IC;[o;7;IC;[ o; ; F; ;,;;;I"4Card::Set::All::Collection::ClassMethods#search;F;[[I" spec;T0[I" comment;TI"nil;T;[[I"1tmpsets/set/mod001-01_core/all/collection.rb;Ti [I"1tmpsets/set/mod001-01_core/all/collection.rb;Ti ;F;: search;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I""def search(spec, comment=nil);T;)T;*I"def search spec query = ::Card::Query.new(spec) Card.with_logging :search, :message=>spec, :details=>query.sql.strip do results = query.run if block_given? and Array===results results.each { |result| yield result } end results end end;T;+To; ; F; ;,;;;I":Card::Set::All::Collection::ClassMethods#count_by_wql;F;[[I" spec;T0;[[@i[@i;F;:count_by_wql;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"def count_by_wql(spec);T;)T;*I"pdef count_by_wql(spec) spec = spec.clone spec.delete(:offset) search spec.merge(:return=>'count') end;T;+To; ; F; ;,;;;I"7Card::Set::All::Collection::ClassMethods#find_each;F;[[I" options;TI"{};T;[[@i[@i;F;:find_each;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def find_each(options={});T;)T;*I"def find_each(options = {}) #this is a copy from rails (3.2.16) and is needed because this is performed by a relation (ActiveRecord::Relation) find_in_batches(options) do |records| records.each { |record| yield record } end end;T;+To; ; F; ;,;;;I"=Card::Set::All::Collection::ClassMethods#find_in_batches;F;[[I" options;TI"{};T;[[@i"[@i!;F;:find_in_batches;;;[;{;IC;" ;T;@-;.0;F;[;[; I";T;!0;'@;(I"$def find_in_batches(options={});T;)T;*I"def find_in_batches(options = {}) if block_given? super(options) do |records| yield(records) Card::Cache.reset_global end else super(options) end end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i [@i ;T;;;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/collection.rb ~~~~~~~~~~~ ;T;@;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/collection.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@;I"-Card::Set::All::Collection::ClassMethods;F;+To; ; F; ;,;;;I"*Card::Set::All::Collection#item_names;F;[[I" _args;TI"{};T;[[@i.[@i-;F;:item_names;;;[;{;IC;" ;T;@P;.0;F;[;[; I";T;!0;'@;(I"def item_names(_args={});T;)T;*I"Cdef item_names(args={}) format._render_raw.split /[,\n]/ end;T;+To; ; F; ;,;;;I"*Card::Set::All::Collection#item_cards;F;[[I" _args;TI"{};T;[[@i2[@i1;T;:item_cards;;;[;{;IC;"0FIXME: this is inconsistent with item_names ;T;@a;F;[;[; I"0FIXME: this is inconsistent with item_names;T;!0;"o;#;$F;%i1;&i1;'@;(I"def item_cards(_args={});T;)T;*I"Xdef item_cards(args={}) ## FIXME this is inconsistent with item_names [self] end;T;+To; ; F; ;,;;;I")Card::Set::All::Collection#item_type;F;[;[[@i6[@i5;F;:item_type;;;[;{;IC;" ;T;@s;.0;F;[;[; I";T;!0;'@;(I"def item_type;T;)T;*I"def item_type nil end;T;+To; ; F; ;,;;;I")Card::Set::All::Collection#item_keys;F;[[I" args;TI"{};T;[[@i:[@i9;F;:item_keys;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def item_keys(args={});T;)T;*I"Zdef item_keys args={} item_names(args).map do |item| item.to_name.key end end;T;+To; ; F; ;,;;;I"-Card::Set::All::Collection#include_item?;F;[[I" item;T0;[[@i@[@i?;F;:include_item?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def include_item?(item);T;)T;*I"def include_item? item key = if Card === item item.cardname.key else item.to_name.key end item_names.map{|name| name.to_name.key}.member? key end;T;+To; ; F; ;,;;;I"(Card::Set::All::Collection#add_item;F;[[I" item;T0;[[@iI[@iD;F;: add_item;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def add_item(item);T;)T;*I"hdef add_item item unless include_item? item self.content="#{self.content}\n#{name}" end end;T;+To; ; F; ;,;;;I")Card::Set::All::Collection#drop_item;F;[[I" item;T0;[[@iO[@iI;F;:drop_item;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def drop_item(item);T;)T;*I"def drop_item item if include_item? item new_names = item_names.reject{ |i| i == item } self.content = new_names.empty? ? '' : new_names.join("\n") end end;T;+To; ; F; ;,;;;I"+Card::Set::All::Collection#insert_item;F;[[I" index;T0[I" name;T0;[[@iV[@iO;F;:insert_item;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"!def insert_item(index, name);T;)T;*I"def insert_item index, name new_names = item_names new_names.delete(name) new_names.insert(index,name) self.content = new_names.join "\n" end;T;+To; ; F; ;,;;;I"3Card::Set::All::Collection#extended_item_cards;F;[[I" context;TI"nil;T;[[@i^[@iV;F;:extended_item_cards;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"+def extended_item_cards(context = nil);T;)T;*I"Qdef extended_item_cards context = nil context = (context ? context.cardname : self.cardname) args={ :limit=>'' } items = self.item_cards(args.merge(:context=>context)) extended_list = [] already_extended = ::Set.new # avoid loops while items.size > 0 item = items.shift if already_extended.include? item next elsif item.item_cards == [item] # no further level of items extended_list << item already_extended << item else items.unshift(*item.item_cards) # keep items in order already_extended << item end end extended_list end;T;+To; ; F; ;,;;;I"6Card::Set::All::Collection#extended_item_contents;F;[[I" context;TI"nil;T;[[@it[@il;F;:extended_item_contents;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I",def extended_item_contents(context=nil);T;)T;*I"jdef extended_item_contents context = nil extended_item_cards(context).map(&:item_names).flatten end;T;+To; ; F; ;,;;;I"-Card::Set::All::Collection#extended_list;F;[[I" context;TI"nil;T;[[@ix[@ip;F;:extended_list;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"#def extended_list(context=nil);T;)T;*I"def extended_list context = nil context = (context ? context.cardname : self.cardname) args={ :limit=>'' } self.item_cards(args.merge(:context=>context)).map do |x| x.item_cards(args) end.flatten.map do |x| x.item_cards(args) end.flatten.map do |y| y.item_names(args) end.flatten # this could go on and on. more elegant to recurse until you don't have a collection end;T;+To; ; F; ;,;;;I"2Card::Set::All::Collection#contextual_content;F;[[I"context_card;T0[I"format_args;TI"{};T[I"view_args;TI"{};T;[[@i[@i~;F;:contextual_content;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"Gdef contextual_content(context_card, format_args={}, view_args={});T;)T;*I"def contextual_content context_card, format_args={}, view_args={} context_card.format(format_args).process_content( self.format(format_args)._render_raw(view_args), view_args ) end;T;+T;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;:Collection;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Collection;F;+To;7;IC;[o; ; F; ;,;;;I")Card::Set::All::ActiveCard#trait_var;F;[[I" var_name;T0[I" &block;T0;[[I"2tmpsets/set/mod001-01_core/all/active_card.rb;Ti[I"2tmpsets/set/mod001-01_core/all/active_card.rb;Ti;T;:trait_var;;;[;{;IC;"3# following may be useful, but is neither tested nor in use def card_attributes if Card::Set.traits set_modules.each do |mod| if mod_traits = Card::Set.traits[mod] return mod_traits end end end nil end def trait_var? var_name !instance_variable_get( var_name ).nil? end ;T;@6;F;[;[; I"6 # following may be useful, but is neither tested nor in use def card_attributes if Card::Set.traits set_modules.each do |mod| if mod_traits = Card::Set.traits[mod] return mod_traits end end end nil end def trait_var? var_name !instance_variable_get( var_name ).nil? end ;T;!0;"o;#;$F;%i ;&i;'@4;(I"$def trait_var(var_name, &block);T;)T;*I"def trait_var var_name, &block # FIXME - following optimization attempt needs to handle cache clearing! # instance_variable_get var_name or begin # instance_variable_set var_name, block_given? ? yield : raise("no block?") # end yield end;T;+To; ; F; ;,;;;I"&Card::Set::All::ActiveCard#format;F;[[I" opts;TI"{};T;[[@?i&[@Ai';T;;`;;;[;{;IC;"%fixme -this needs a better home! ;T;@K;F;[;[; I"%fixme -this needs a better home!;T;!0;"o;#;$F;%i&;&i&;'@4;(I"def format(opts={});T;)T;*I"def format opts={} opts = { :format=>opts.to_sym } if [Symbol, String].member? opts.class Card::Format.new self, opts end;T;+T;I@4;JIC;[o;S ;T0;UI"Card::Set;T;V@4;;;'@;W@;X;Y;I@4;KIC;[;I@4;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@?i;F;:ActiveCard;;;;;[;{;IC;" ;T;@4;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::ActiveCard;F;+To;7;IC;[;I@o;JIC;[o;S ;T0;UI"Card::Set;T;V@o;;;'@;W@;X;Y;I@o;KIC;[;I@o;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod007-05_standard/all/comment.rb;Ti;F;: Comment;;;;;[;{;IC;" ;T;@o;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Comment;F;+To;7;IC;[o; ; F; ;,;;;I"$Card::Set::All::Permissions#ok?;F;[[I" action;T0;[[I"2tmpsets/set/mod001-01_core/all/permissions.rb;Ti[I"2tmpsets/set/mod001-01_core/all/permissions.rb;Ti;T;:ok?;;;[;{;IC;"vok? and ok! are public facing methods to approve one action at a time fetching: if the optional :trait parameter is supplied, it is passed to fetch and the test is perfomed on the fetched card, therefore: trait: :account would fetch this card plus a tag codenamed :account trait: :roles, new: {} would initialize a new card with default ({}) options. ;T;@;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I"vok? and ok! are public facing methods to approve one action at a time fetching: if the optional :trait parameter is supplied, it is passed to fetch and the test is perfomed on the fetched card, therefore: trait: :account would fetch this card plus a tag codenamed :account trait: :roles, new: {} would initialize a new card with default ({}) options.;T;!0;"o;#;$F;%i ;&i;'@;(I"def ok?(action);T;)T;*I"Qdef ok? action @action_ok = true send "ok_to_#{action}" @action_ok end;T;+To; ; F; ;,;;;I"/Card::Set::All::Permissions#ok_with_fetch?;F;[[I" action;T0[I" opts;TI"{};T;[[@i[@i;F;:ok_with_fetch?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"(def ok_with_fetch?(action, opts={});T;)T;*I"def ok_with_fetch? action, opts={} card = opts[:trait].nil? ? self : fetch(opts) card && card.ok_without_fetch?(action) end;T;+To; ; F; ;,;;;I"$Card::Set::All::Permissions#ok!;F;[[I" action;T0[I" opts;TI"{};T;[[@i"[@i$;F;:ok!;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def ok!(action, opts={});T;)T;*I"`def ok! action, opts={} raise Card::PermissionDenied.new self unless ok? action, opts end;T;+To; ; F; ;,;;;I"(Card::Set::All::Permissions#who_can;F;[[I" action;T0;[[@i&[@i(;F;: who_can;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def who_can(action);T;)T;*I"def who_can action #warn "who_can[#{name}] #{(prc=permission_rule_card(action)).inspect}, #{prc.first.item_cards.map(&:id)}" if action == :update permission_rule_card(action).first.item_cards.map &:id end;T;+To; ; F; ;,;;;I"5Card::Set::All::Permissions#permission_rule_card;F;[[I" action;T0;[[@i,[@iB;F;:permission_rule_card;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"%def permission_rule_card(action);T;)T;*I"def permission_rule_card action opcard = rule_card action unless opcard # RULE missing. should not be possible. generalize this to handling of all required rules errors.add :permission_denied, "No #{action} rule for #{name}" raise Card::PermissionDenied.new(self) end rcard = Auth.as_bot do if ['_left','[[_left]]'].member?(opcard.db_content) && self.junction? # compound cards can inherit permissions from left parent lcard = left_or_new( :skip_virtual=>true, :skip_modules=>true ) if action==:create && lcard.real? && !lcard.action==:create action = :update end lcard.permission_rule_card(action).first else opcard end end return rcard, opcard.rule_class_name end;T;+To; ; F; ;,;;;I"0Card::Set::All::Permissions#rule_class_name;F;[;[[@iB[@iN;F;:rule_class_name;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def rule_class_name;T;)T;*I"[def rule_class_name trunk.type_id == Card::SetID ? cardname.trunk_name.tag : nil end;T;+To; ; F; ;,;;;I")Card::Set::All::Permissions#you_cant;F;[[I" what;T0;[[@iF[@iR;F;: you_cant;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def you_cant(what);T;)T;*I"Cdef you_cant what "You don't have permission to #{what}" end;T;+To; ; F; ;,;;;I"-Card::Set::All::Permissions#deny_because;F;[[I"why;T0;[[@iK[@iV;F;:deny_because;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def deny_because(why);T;)T;*I"ddef deny_because why @permission_errors << why if @permission_errors @action_ok = false end;T;+To; ; F; ;,;;;I"+Card::Set::All::Permissions#permitted?;F;[[I" action;T0;[[@iP[@i[;F;:permitted?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def permitted?(action);T;)T;*I"<def permitted? action if !Card.config.read_only return true if action != :comment and Auth.always_ok? permitted_ids = who_can action if action == :comment && Auth.always_ok? # admin can comment if anyone can !permitted_ids.empty? else Auth.among? permitted_ids end end end;T;+To; ; F; ;,;;;I"'Card::Set::All::Permissions#permit;F;[[I" action;T0[I" verb;TI"nil;T;[[@i_[@ih;F;: permit;;;[;{;IC;" ;T;@,;.0;F;[;[; I";T;!0;'@;(I"!def permit(action, verb=nil);T;)T;*I" def permit action, verb=nil if Card.config.read_only # not called by ok_to_read deny_because "Currently in read-only mode" end verb ||= action.to_s unless permitted? action deny_because you_cant("#{verb} #{name.present? ? name : 'this'}") end end;T;+To; ; F; ;,;;;I"-Card::Set::All::Permissions#ok_to_create;F;[;[[@ik[@ir;F;:ok_to_create;;;[;{;IC;" ;T;@?;.0;F;[;[; I";T;!0;'@;(I"def ok_to_create;T;)T;*I"def ok_to_create permit :create if @action_ok and junction? [:left, :right].each do |side| next if side==:left && @superleft # left is supercard; create permissions will get checked there. part_card = send side, :new=>{} if part_card && part_card.new_card? # if no card, there must be other errors unless part_card.ok? :create deny_because you_cant("create #{part_card.name}") end end end end end;T;+To; ; F; ;,;;;I"+Card::Set::All::Permissions#ok_to_read;F;[;[[@iz[@i};F;:ok_to_read;;;[;{;IC;" ;T;@M;.0;F;[;[; I";T;!0;'@;(I"def ok_to_read;T;)T;*I"def ok_to_read if !Auth.always_ok? @read_rule_id ||= permission_rule_card(:read).first.id.to_i if !Auth.as_card.read_rules.member? @read_rule_id deny_because you_cant "read this" end end end;T;+To; ; F; ;,;;;I"-Card::Set::All::Permissions#ok_to_update;F;[;[[@i~[@i;F;:ok_to_update;;;[;{;IC;" ;T;@[;.0;F;[;[; I";T;!0;'@;(I"def ok_to_update;T;)T;*I"def ok_to_update permit :update if @action_ok and type_id_changed? and !permitted? :create deny_because you_cant( "change to this type (need create permission)" ) end ok_to_read if @action_ok end;T;+To; ; F; ;,;;;I"-Card::Set::All::Permissions#ok_to_delete;F;[;[[@i[@i;F;:ok_to_delete;;;[;{;IC;" ;T;@i;.0;F;[;[; I";T;!0;'@;(I"def ok_to_delete;T;)T;*I"*def ok_to_delete permit :delete end;T;+To; ; F; ;,;;;I".Card::Set::All::Permissions#ok_to_comment;F;[;[[@i[@i;F;:ok_to_comment;;;[;{;IC;" ;T;@w;.0;F;[;[; I";T;!0;'@;(I"def ok_to_comment;T;)T;*I"def ok_to_comment permit :comment, 'comment on' if @action_ok deny_because "No comments allowed on templates" if is_template? deny_because "No comments allowed on structured content" if structure end end;T;+To; ; F; ;,;;;I"1Card::Set::All::Permissions#update_read_rule;F;[;[[@i[@i;F;:update_read_rule;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def update_read_rule;T;)T;*I"def update_read_rule Card.record_timestamps = false reset_patterns # why is this needed? rcard, rclass = permission_rule_card :read self.read_rule_id = rcard.id #these two are just to make sure vals are correct on current object #warn "updating read rule for #{inspect} to #{rcard.inspect}, #{rclass}" self.read_rule_class = rclass Card.where(:id=>self.id).update_all(:read_rule_id=>rcard.id, :read_rule_class=>rclass) expire # currently doing a brute force search for every card that may be impacted. may want to optimize(?) Auth.as_bot do Card.search(:left=>self.name).each do |plus_card| if plus_card.rule(:read) == '_left' plus_card.update_read_rule end end end ensure Card.record_timestamps = true end;T;+To; ; F; ;,;;;I">Card::Set::All::Permissions#add_to_read_rule_update_queue;F;[[I" updates;T0;[[@i[@i;F;:"add_to_read_rule_update_queue;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"/def add_to_read_rule_update_queue(updates);T;)T;*I"|def add_to_read_rule_update_queue updates @read_rule_update_queue = Array.wrap(@read_rule_update_queue).concat updates end;T;+To; ; F; ;,;;;I"8Card::Set::All::Permissions#track_permission_errors;F;[;[[@i[@i;F;:track_permission_errors;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I" def track_permission_errors;T;)T;*I"def track_permission_errors @permission_errors = [] result = yield @permission_errors.each do |message| errors.add :permission_denied, message end @permission_errors = nil result end;T;+To; ; F; ;,;;;I".Card::Set::All::Permissions#recaptcha_on?;F;[;[[@i[@i;F;:recaptcha_on?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def recaptcha_on?;T;)T;*I"def recaptcha_on? have_recaptcha_keys? && Env[:controller] && !Auth.signed_in? && !Auth.needs_setup? && !Auth.always_ok? && Card.toggle( rule :captcha ) end;T;+To; ; F; ;,;;;I"5Card::Set::All::Permissions#have_recaptcha_keys?;F;[;[[@i[@i;F;:have_recaptcha_keys?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def have_recaptcha_keys?;T;)T;*I"def have_recaptcha_keys? @@have_recaptcha_keys = defined?(@@have_recaptcha_keys) ? @@have_recaptcha_keys : !!( Card.config.recaptcha_public_key && Card.config.recaptcha_private_key ) end;T;+To;7;IC;[o; ; F; ;,;;;I"1Card::Set::All::Permissions::Accounts#permit;F;[[I" action;T0[I" verb;TI"nil;T;[[@i[@i;T;;;;;[;{;IC;":This is a short-term hack that is used in account-related cards to allow a permissions pattern where permissions are restricted to the owner of the account (and, by default, Admin) That pattern should be permitted by our card representation (without creating separate rules for each account holder) but is not yet. ;T;@;F;[;[; I":This is a short-term hack that is used in account-related cards to allow a permissions pattern where permissions are restricted to the owner of the account (and, by default, Admin) That pattern should be permitted by our card representation (without creating separate rules for each account holder) but is not yet.;T;!0;"o;#;$F;%i;&i;'@;(I"!def permit(action, verb=nil);T;)T;*I"Qdef permit action, verb=nil case when action==:comment ; @action_ok = false when action==:create ; @superleft ? true : super( action, verb ) #restricts account creation to subcard handling on permitted card (unless explicitly permitted) when is_own_account? ; true else ; super action, verb end end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i[@i;F;: Accounts;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"*Card::Set::All::Permissions::Accounts;F;+To;7;IC;[ o; ; F; ;,;;;I"5Card::Set::All::Permissions::Follow#ok_to_update;F;[;[[@i[@i;F;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def ok_to_update;T;)T;*I"*def ok_to_update permit :update end;T;+To; ; F; ;,;;;I"5Card::Set::All::Permissions::Follow#ok_to_create;F;[;[[@i [@i;F;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def ok_to_create;T;)T;*I"*def ok_to_create permit :create end;T;+To; ; F; ;,;;;I"5Card::Set::All::Permissions::Follow#ok_to_delete;F;[;[[@i[@i;F;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def ok_to_delete;T;)T;*I"*def ok_to_delete permit :delete end;T;+To; ; F; ;,;;;I"/Card::Set::All::Permissions::Follow#permit;F;[[I" action;T0[I" verb;TI"nil;T;[[@i[@i;F;;;;;[;{;IC;" ;T;@*;.0;F;[;[; I";T;!0;'@;(I"!def permit(action, verb=nil);T;)T;*I"def permit action, verb=nil if [:create, :delete, :update].include?(action) && Auth.signed_in? && (user = rule_user) && Auth.current_id == user.id return true else super action, verb end end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i[@i;F;;8;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"(Card::Set::All::Permissions::Follow;F;+To; ; F; ;,;;;I"=Card::Set::All::Permissions#permission_rule_id_and_class;F;[[I" action;T0;[[@i.;F;:!permission_rule_id_and_class;;;[;{;IC;" ;T;@N;.0;F;[;[; I";T;!0;'@;(I",def permission_rule_id_and_class action;T;)T;*I"def permission_rule_id_and_class action direct_rule_id = rule_card_id action require_permission_rule! direct_rule_id, action direct_rule = Card.fetch direct_rule_id, skip_modules: true [applicable_permission_rule_id(direct_rule, action), direct_rule.rule_class_name] end;T;+To; ; F; ;,;;;I">Card::Set::All::Permissions#applicable_permission_rule_id;F;[[I"direct_rule;T0[I" action;T0;[[@i6;F;:"applicable_permission_rule_id;;;[;{;IC;" ;T;@];.0;F;[;[; I";T;!0;'@;(I":def applicable_permission_rule_id direct_rule, action;T;)T;*I"sdef applicable_permission_rule_id direct_rule, action if junction? && direct_rule.db_content =~ /^\[?\[?_left\]?\]?$/ lcard = left_or_new(skip_virtual: true, skip_modules: true) if action == :create && lcard.real? && !lcard.action == :create action = :update end lcard.permission_rule_id_and_class(action).first else direct_rule.id end end;T;+To; ; F; ;,;;;I"9Card::Set::All::Permissions#require_permission_rule!;F;[[I" rule_id;T0[I" action;T0;[[@iF;F;:require_permission_rule!;;;[;{;IC;" ;T;@n;.0;F;[;[o;0 ;1I" raise;F;2I";T;0;3[I"Card::PermissionDenied;T;@n; I";T;!0;'@;(I"1def require_permission_rule! rule_id, action;T;)T;*I"def require_permission_rule! rule_id, action return if rule_id # RULE missing. should not be possible. # generalize this to handling of all required rules errors.add :permission_denied, "No #{action} rule for #{name}" raise Card::PermissionDenied.new(self) end;T;+T;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;:Permissions;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I" Card::Set::All::Permissions;F;+To;7;IC;[;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod003-02_basic_types/all/base.rb;Ti;F;: Base;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Base;F;+To;7;IC;[;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod003-02_basic_types/all/file.rb;Ti;F;: File;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::File;F;+To;7;IC;[;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod003-02_basic_types/all/json.rb;Ti;F;: Json;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Json;F;+To;7;IC;[;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod003-02_basic_types/all/text.rb;Ti;F;: Text;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Text;F;+To;7;IC;[o;7;IC;[o; ; F; ;,;;;I"DCard::Set::All::Account::ClassMethods#default_accounted_type_id;F;[;[[I"2tmpsets/set/mod007-05_standard/all/account.rb;Ti [I"2tmpsets/set/mod007-05_standard/all/account.rb;Ti ;F;:default_accounted_type_id;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I""def default_accounted_type_id;T;)T;*I"5def default_accounted_type_id Card::UserID end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i [@i;T;;;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/account.rb ~~~~~~~~~~~ ;T;@;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/account.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@;I"*Card::Set::All::Account::ClassMethods;F;+To; ; F; ;,;;;I"$Card::Set::All::Account#account;F;[;[[@i[@i;F;: account;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def account;T;)T;*I"-def account fetch :trait=>:account end;T;+To; ; F; ;,;;;I")Card::Set::All::Account#accountable?;F;[;[[@i[@i;F;:accountable?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def accountable?;T;)T;*I":roles [ Card::AnyoneSignedInID ] + ( role_trait ? role_trait.item_ids : [] ) end end end;T;+To; ; F; ;,;;;I")Card::Set::All::Account#own_account?;F;[;[[@i";F;:own_account?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def own_account?;T;)T;*I"def own_account? # card is +*account card of signed_in user. cardname.part_names[0].key == Auth.as_card.key && cardname.part_names[1].key == Card[:account].key end;T;+To; ; F; ;,;;;I"(Card::Set::All::Account#fetch_roles;F;[;[[@i:;F;:fetch_roles;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def fetch_roles;T;)T;*I"def fetch_roles Auth.as_bot do role_trait = fetch trait: :roles next [Card::AnyoneSignedInID] unless role_trait [Card::AnyoneSignedInID] + (role_trait.item_ids) end end;T;+T;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;: Account;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::Account;F;+To;7;IC;[;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod006-05_email/all/email_text.rb;Ti;F;:EmailText;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::EmailText;F;+To;7;IC;[;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod006-05_email/all/email_html.rb;Ti;F;:EmailHtml;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::EmailHtml;F;+To;7;IC;[o; ; F; ;,;;;I"$Card::Set::All::EventViz#events;F;[[I" action;T0;[[I"4tmpsets/set/mod007-05_standard/all/event_viz.rb;Ti[I"4tmpsets/set/mod007-05_standard/all/event_viz.rb;Ti;T;: events;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/event_viz.rb ~~~~~~~~~~~ the events method is a developer's tool for visualizing the event order for a given card. For example, from a console you might run puts mycard.events :update to see the order of events that will be executed on mycard. The indention and arrows (^v) indicate event dependencies. Note: as of yet, the functionality is a bit rough. It does not display events that are called directly from within other events (like :stored), and certain event requirements (like the presence of a "current_act") may prevent events from showing up in the tree. ;T;@;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/event_viz.rb ~~~~~~~~~~~ the events method is a developer's tool for visualizing the event order for a given card. For example, from a console you might run puts mycard.events :update to see the order of events that will be executed on mycard. The indention and arrows (^v) indicate event dependencies. Note: as of yet, the functionality is a bit rough. It does not display events that are called directly from within other events (like :stored), and certain event requirements (like the presence of a "current_act") may prevent events from showing up in the tree.;T;!0;"o;#;$F;%i;&i;'@;(I"def events(action);T;)T;*I"def events action @action = action events = [ events_tree(:validation), events_tree(:save) ] @action = nil puts_events events end;T;+To; ; F; ;,;;;I")Card::Set::All::EventViz#puts_events;F;[[I" events;T0[I" prefix;TI"'';T[I" depth;TI"0;T;[[@i[@i;T;:puts_events;;;[;{;IC;" private ;T;@;F;[;[; I" private;T;!0;"o;#;$F;%i;&i;'@;(I"0def puts_events(events, prefix='', depth=0);T;)T;*I"kdef puts_events events, prefix='', depth=0 r = '' depth += 1 events.each do |e| space = ' ' * (depth * 2) #FIXME - this is not right. before and around callbacks are processed in declaration order regardless of kind. # not all befores then all arounds if e[:before] r += puts_events( e[:before], space+'v ', depth) end if e[:around] r += puts_events( e[:around], space+'vv ', depth ) end output = "#{prefix}#{e[:name]}" #warn output r+= "#{output}\n" if e[:after] r += puts_events( e[:after ].reverse, space+'^ ', depth ) end end r end;T;+To; ; F; ;,;;;I")Card::Set::All::EventViz#events_tree;F;[[I" filt;T0;[[@i9[@i:;F;:events_tree;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;(I"def events_tree(filt);T;)T;*I"(def events_tree filt hash = {:name => filt } if respond_to? "_#{filt}_callbacks" send( "_#{filt}_callbacks" ).each do |callback| next unless callback.applies? self hash[callback.kind] ||= [] hash[callback.kind] << events_tree( callback.filter ) end end hash end;T;+T;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;: EventViz;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::EventViz;F;+To;7;IC;[;I@+;JIC;[o;S ;T0;UI"Card::Set;T;V@+;;;'@;W@;X;Y;I@+;KIC;[;I@+;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"4tmpsets/set/mod003-02_basic_types/all/all_js.rb;Ti;F;: AllJs;;;;;[;{;IC;" ;T;@+;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::AllJs;F;+To;7;IC;[;I@@;JIC;[o;S ;T0;UI"Card::Set;T;V@@;;;'@;W@;X;Y;I@@;KIC;[;I@@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"5tmpsets/set/mod003-02_basic_types/all/all_csv.rb;Ti;F;: AllCsv;;;;;[;{;IC;" ;T;@@;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::AllCsv;F;+To;7;IC;[;I@U;JIC;[o;S ;T0;UI"Card::Set;T;V@U;;;'@;W@;X;Y;I@U;KIC;[;I@U;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"5tmpsets/set/mod003-02_basic_types/all/all_css.rb;Ti;F;: AllCss;;;;;[;{;IC;" ;T;@U;.0;F;[;[; I";T;!0;'@;I"Card::Set::All::AllCss;F;+To;7;IC;[ o;7;IC;[;I@l;JIC;[o;S ;T0;UI"Card::Set;T;V@l;;;'@;W@;X;Y;I@l;KIC;[;I@l;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"9tmpsets/set/mod007-05_standard/all/rich_html/menu.rb;Ti;F;: Menu;;;;;[;{;IC;" ;T;@l;.0;F;[;[; I";T;!0;'@j;I"#Card::Set::All::RichHtml::Menu;F;+To;7;IC;[;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"9tmpsets/set/mod007-05_standard/all/rich_html/form.rb;Ti;F;: Form;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@j;I"#Card::Set::All::RichHtml::Form;F;+To;7;IC;[;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I":tmpsets/set/mod007-05_standard/all/rich_html/modal.rb;Ti;F;: Modal;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@j;I"$Card::Set::All::RichHtml::Modal;F;+To;7;IC;[;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I";tmpsets/set/mod007-05_standard/all/rich_html/header.rb;Ti;F;: Header;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@j;I"%Card::Set::All::RichHtml::Header;F;+To;7;IC;[;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I" @selected_action_id, :including_drafts=>true ) and change.value) || db_content end else super end end;T;+To; ; F; ;,;;;I",Card::Set::All::ContentHistory#content=;F;[[I" value;T0;[[@Gi[@Ii;F;;X;;;[;{;IC;" ;T;@S;.0;F;[;[; I";T;!0;'@@;(I"def content=(value);T;)T;*I"=def content= value @selected_content = nil super end;T;+To; ; F; ;,;;;I"6Card::Set::All::ContentHistory#save_content_draft;F;[[I" content;T0;[[@Gi[@Ii;F;;_;;;[;{;IC;" ;T;@c;.0;F;[;[; I";T;!0;'@@;(I"$def save_content_draft(content);T;)T;*I"def save_content_draft content super acts.create do |act| act.actions.build(:draft => true, :card_id=>id).card_changes.build(:field=>:db_content, :value=>content) end end;T;+To; ; F; ;,;;;I"2Card::Set::All::ContentHistory#last_change_on;F;[[I" field;T0[I" opts;TI"{};T;[[@Gi![@Ii";F;:last_change_on;;;[;{;IC;" ;T;@s;.0;F;[;[; I";T;!0;'@@;(I"'def last_change_on(field, opts={});T;)T;*I"def last_change_on(field, opts={}) where_sql = 'card_actions.card_id = :card_id AND field = :field ' if !opts[:including_drafts] where_sql += 'AND (draft is not true) ' end where_sql += if opts[:before] 'AND card_action_id < :action_id' elsif opts[:not_after] 'AND card_action_id <= :action_id' else '' end action_arg = opts[:before] || opts[:not_after] action_id = action_arg.kind_of?(Card::Action) ? action_arg.id : action_arg field_index = Card::TRACKED_FIELDS.index(field.to_s) Change.joins(:action).where( where_sql, {:card_id=>id, :field=>field_index, :action_id=>action_id} ).order(:id).last end;T;+To; ; F; ;,;;;I"6Card::Set::All::ContentHistory#selected_action_id;F;[;[[@Gi6[@Ii7;F;:selected_action_id;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@@;(I"def selected_action_id;T;)T;*I"sdef selected_action_id @selected_action_id || (@current_action and @current_action.id) || last_action_id end;T;+To; ; F; ;,;;;I"7Card::Set::All::ContentHistory#selected_action_id=;F;[[I"action_id;T0;[[@Gi:[@Ii;;F;:selected_action_id=;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@@;(I"'def selected_action_id=(action_id);T;)T;*I"fdef selected_action_id= action_id @selected_content = nil @selected_action_id = action_id end;T;+To; ; F; ;,;;;I"3Card::Set::All::ContentHistory#selected_action;F;[;[[@Gi?[@Ii@;F;:selected_action;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@@;(I"def selected_action;T;)T;*I"Vdef selected_action selected_action_id and Action.fetch(selected_action_id) end;T;+To; ; F; ;,;;;I";Card::Set::All::ContentHistory#with_selected_action_id;F;[[I"action_id;T0;[[@GiC[@IiD;F;:with_selected_action_id;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@@;(I"+def with_selected_action_id(action_id);T;)T;*I"def with_selected_action_id action_id current_action_id = @selected_action_id run_callbacks :select_action do self.selected_action_id = action_id end result = yield run_callbacks :select_action do self.selected_action_id = current_action_id end result end;T;+To; ; F; ;,;;;I">Card::Set::All::ContentHistory#selected_content_action_id;F;[;[[@GiO[@IiP;F;:selected_content_action_id;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@@;(I"#def selected_content_action_id;T;)T;*I"def selected_content_action_id @selected_action_id || (@current_action && (new_card? || @current_action.new_content? || db_content_changed?) && @current_action.id) || last_content_action_id end;T;+To; ; F; ;,;;;I"2Card::Set::All::ContentHistory#last_action_id;F;[;[[@GiU[@IiZ;F;:last_action_id;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@@;(I"def last_action_id;T;)T;*I"8def last_action_id la = last_action and la.id end;T;+To; ; F; ;,;;;I"/Card::Set::All::ContentHistory#last_action;F;[;[[@GiY[@Ii^;F;:last_action;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@@;(I"def last_action;T;)T;*I"?def last_action actions.where('id IS NOT NULL').last end;T;+To; ; F; ;,;;;I"7Card::Set::All::ContentHistory#last_content_action;F;[;[[@Gi][@Iib;F;:last_content_action;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@@;(I"def last_content_action;T;)T;*I"Sdef last_content_action l_c = last_change_on(:db_content) and l_c.action end;T;+To; ; F; ;,;;;I":Card::Set::All::ContentHistory#last_content_action_id;F;[;[[@Gia[@Iig;F;:last_content_action_id;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@@;(I"def last_content_action_id;T;)T;*I"^def last_content_action_id l_c = last_change_on(:db_content) and l_c.card_action_id end;T;+To; ; F; ;,;;;I".Card::Set::All::ContentHistory#last_actor;F;[;[[@Gie[@Iil;F;:last_actor;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@@;(I"def last_actor;T;)T;*I"(def last_actor last_act.actor end;T;+To; ; F; ;,;;;I",Card::Set::All::ContentHistory#last_act;F;[;[[@Gii[@Iip;F;: last_act;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@@;(I"def last_act;T;)T;*I"def last_act if action = last_action last_act_on_self = acts.last if last_act_on_self and ( action.act==last_act_on_self || last_act_on_self.acted_at>action.act.acted_at ) last_act_on_self else action.act end end end;T;+To; ; F; ;,;;;I",Card::Set::All::ContentHistory#acted_at;F;[;[[@Git[@Ii{;F;: acted_at;;;[;{;IC;" ;T;@$;.0;F;[;[; I";T;!0;'@@;(I"def acted_at;T;)T;*I")def acted_at last_act.acted_at end;T;+To; ; F; ;,;;;I"3Card::Set::All::ContentHistory#previous_action;F;[[I"action_id;T0;[[@Giy[@Ii{;F;:previous_action;;;[;{;IC;" ;T;@2;.0;F;[;[; I";T;!0;'@@;(I"#def previous_action(action_id);T;)T;*I"def previous_action action_id if action_id action_index = actions.find_index do |a| a.id == action_id end actions[action_index - 1] if action_index.to_i != 0 end end;T;+To; ; F; ;,;;;I".Card::Set::All::ContentHistory#revised_at;F;[;[[@Gi}[@Ii;F;:revised_at;;;[;{;IC;" ;T;@B;.0;F;[;[; I";T;!0;'@@;(I"def revised_at;T;)T;*I"\def revised_at (last_action and act=last_action.act and act.acted_at) or Time.now end;T;+To; ; F; ;,;;;I"+Card::Set::All::ContentHistory#creator;F;[;[[@Gi[@Ii;F;;[;;;[;{;IC;" ;T;@P;.0;F;[;[; I";T;!0;'@@;(I"def creator;T;)T;*I")def creator Card[ creator_id ] end;T;+To; ; F; ;,;;;I"+Card::Set::All::ContentHistory#updater;F;[;[[@Gi[@Ii;F;;\;;;[;{;IC;" ;T;@^;.0;F;[;[; I";T;!0;'@@;(I"def updater;T;)T;*I")def updater Card[ updater_id ] end;T;+To; ; F; ;,;;;I"/Card::Set::All::ContentHistory#clean_html?;F;[;[[@Gi[@Ii;F;;];;;[;{;IC;" ;T;@l;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@l; I";T;!0;'@@;(I"def clean_html?;T;)T;*I"def clean_html? true end;T;+To; ; F; ;,;;;I".Card::Set::All::ContentHistory#draft_acts;F;[;[[@Gi[@Ii;F;:draft_acts;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@@;(I"def draft_acts;T;)T;*I"Mdef draft_acts drafts.created_by(Card::Auth.current_id).map(&:act) end;T;+To; ; F; ;,;;;I"9Card::Set::All::ContentHistory#new_content_action_id;F;[;[[@IiT;F;:new_content_action_id;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@@;(I"def new_content_action_id;T;)T;*I"def new_content_action_id if @current_action && (new_card? || @current_action.new_content? || db_content_changed?) @current_action.id end end;T;+T;I@@;JIC;[o;S ;T0;UI"Card::Set;T;V@@;;;'@;W@;X;Y;I@@;KIC;[;I@@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Gi;F;:ContentHistory;;;;;[;{;IC;" ;T;@@;.0;F;[;[; I";T;!0;'@;I"#Card::Set::All::ContentHistory;F;+To;7;IC;[ o; ; F; ;,;;;I"8Card::Set::All::TrackedAttributes#assign_attributes;F;[[I" args;TI"{};T;[[I"9tmpsets/set/mod001-01_core/all/tracked_attributes.rb;Ti ;T;:assign_attributes;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/tracked_attributes.rb ~~~~~~~~~~~ ;T;@;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/tracked_attributes.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@;(I"#def assign_attributes(args={});T;)T;*I"def assign_attributes args={} if args args = args.stringify_keys @set_specific = {} Card.set_specific_attributes.each do |key| @set_specific[key] = args.delete(key) if args[key] end if newtype = args.delete('type') args['type_id'] = Card.fetch_id newtype end @subcards = extract_subcard_args! args reset_patterns end params = ActionController::Parameters.new(args) params.permit! super params end;T;+To; ; F; ;,;;;I"ECard::Set::All::TrackedAttributes#assign_set_specific_attributes;F;[;[[@i[I"9tmpsets/set/mod001-01_core/all/tracked_attributes.rb;Ti;F;:#assign_set_specific_attributes;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"'def assign_set_specific_attributes;T;)T;*I"def assign_set_specific_attributes if @set_specific && @set_specific.present? @set_specific.each_pair do |name, value| self.send "#{name}=", value end end end;T;+To; ; F; ;,;:protected;I" val } if String === val extracted_subcards[key] = val end end extracted_subcards end;T;+To; ; F; ;,;;;I"7Card::Set::All::TrackedAttributes#extract_type_id!;F;[[I" args;TI"{};T;[[@i2;F;:extract_type_id!;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"!def extract_type_id! args={};T;)T;*I"def extract_type_id! args={} type_id = case when args['type_id'] id = args.delete('type_id').to_i # type_id can come in as 0,'' or nil id == 0 ? nil : id when args['type_code'] Card.fetch_id args.delete('type_code').to_sym when args['type'] Card.fetch_id args.delete('type') else return nil end if !type_id errors.add :type, "#{args[:type] || args[:type_code]} is not a known type." end type_id end;T;+T;I@;JIC;[o;S ;T0;UI"Card::Set;T;V@;;;'@;W@;X;Y;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;:TrackedAttributes;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"&Card::Set::All::TrackedAttributes;F;+To;7;IC;[o;7;IC;[;I@ ;JIC;[o;S ;T0;UI"Card::Set;T;V@ ;;;'@;W@;X;Y;I@ ;KIC;[;I@ ;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I":tmpsets/set/mod008-06_bootstrap/all/bootstrap/form.rb;Ti;F;;;;;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@ ;I"$Card::Set::All::Bootstrap::Form;F;+To;7;IC;[;I@ ;JIC;[o;S ;T0;UI"Card::Set;T;V@ ;;;'@;W@;X;Y;I@ ;KIC;[;I@ ;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"context_card)) end;T;+T;I@ ;JIC;[o;S ;T0;UI"Card::Set;T;V@ ;;;'@;W@;X;Y;I@ ;KIC;[;I@ ;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@ i;F;;;;;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Bcc;F;+T;X;Y;I@ ;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I",tmpsets/set/mod006-05_email/right/cc.rb;Ti;F;:Cc;;;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Cc;F;+To;7;IC;[;I@ ;JIC;[o;S ;T0;UI"Card::Set;T;V@ ;;;'@;W@;X;Y;I@ ;KIC;[o;S ;T0;U0;V0;;;'@ ;W@ ;X;Y;I@ ;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I",tmpsets/set/mod006-05_email/right/to.rb;Ti;F;:To;;;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::To;F;+T@ o;7;IC;[;I@!;JIC;[o;S ;T0;UI"Card::Set;T;V@!;;;'@;W@;X;Y;I@!;KIC;[o;S ;T0;U0;V0;;;'@ ;W@ ;X;Y;I@!;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I".tmpsets/set/mod006-05_email/right/from.rb;Ti;F;: From;;;;;[;{;IC;" ;T;@!;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::From;F;+To;7;IC;[o; ; F; ;,;;;I"*Card::Set::Right::Follow#option_cards;F;[;[[I"0tmpsets/set/mod006-05_email/right/follow.rb;Ti [I"0tmpsets/set/mod006-05_email/right/follow.rb;Ti ;F;:option_cards;;;[;{;IC;" ;T;@!;.0;F;[;[; I";T;!0;'@!;(I"def option_cards;T;)T;*I"'follow_options_card', :type_code=>:pointer, :content=>option_cards.map {|oc| "[[#{oc.title}]]" }.join("\n") end;T;+T;I@!;JIC;[o;S ;T0;UI"Card::Set;T;V@!;;;'@;W@;X;Y;I@!;KIC;[o;S ;T0;UI"All::Permissions::Follow;T;V@!;;8;'@;W@;X;Y;I@!;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@#!i;F;;8;;;;;[;{;IC;" ;T;@!;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Follow;F;+To;7;IC;[;I@P!;JIC;[o;S ;T0;UI"Card::Set;T;V@P!;;;'@;W@;X;Y;I@P!;KIC;[o;S ;T0;UI"All::Permissions::Accounts;T;V@P!;;;'@;W@;X;Y;I@P!;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"1tmpsets/set/mod007-05_standard/right/salt.rb;Ti;F;: Salt;;;;;[;{;IC;" ;T;@P!;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Salt;F;+To;7;IC;[;I@g!;JIC;[o;S ;T0;UI"Card::Set;T;V@g!;;;'@;W@;X;Y;I@g!;KIC;[;I@g!;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"1tmpsets/set/mod005-04_settings/right/help.rb;Ti;F;: Help;;;;;[;{;IC;" ;T;@g!;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Help;F;+To;7;IC;[;I@|!;JIC;[o;S ;T0;UI"Card::Set;T;V@|!;;;'@;W@;X;Y;I@|!;KIC;[o;S ;T0;UI"Abstract::Permission;T;V@|!;:Permission;'o;7;IC;[o;7;IC;[$o; ; F; ; ;;;I"-Card::Set::Abstract::Attachment.included;F;[[I"host_class;T0;[[I":tmpsets/set/mod007-05_standard/abstract/attachment.rb;Ti [I":tmpsets/set/mod007-05_standard/abstract/attachment.rb;Ti ;F;: included;;;[;{;IC;" ;T;@!;.0;F;[;[o;0 ;1I" private;F;20;0;30;@!o;0 ;1I" private;F;20;0;30;@!; I";T;!0;'@!;(I"def included(host_class);T;)T;*I"Pdef self.included host_class host_class.extend CarrierWave::CardMount end;T;+To; ; F; ;,;;;I"6Card::Set::Abstract::Attachment#assign_attachment;F;[[I" file;T0[I"original_filename;T0;[[@!i:[@!i>;F;:assign_attachment;;;[;{;IC;" ;T;@!;.0;F;[;[; I";T;!0;'@!;(I"3def assign_attachment(file, original_filename);T;)T;*I"def assign_attachment file, original_filename send "#{attachment_name}=", file write_identifier @current_action.update_attributes! :comment=>original_filename end;T;+To; ; F; ;,;;;I"6Card::Set::Abstract::Attachment#upload_cache_card;F;[;[[@!i[@!iR;T;:upload_cache_card;;;[;{;IC;"Aused for uploads for new cards until the new card is created ;T;@!;F;[;[; I"Aused for uploads for new cards until the new card is created;T;!0;"o;#;$F;%i;&i;'@!;(I"def upload_cache_card;T;)T;*I"^def upload_cache_card @upload_cache_card ||= Card["new_#{attachment_name}".to_sym ] end;T;+To; ; F; ;,;;;I"2Card::Set::Abstract::Attachment#tmp_store_dir;F;[[I"action_id;TI"nil;T;[[@!iV;F;:tmp_store_dir;;;[;{;IC;" ;T;@!;.0;F;[;[; I";T;!0;'@!;(I"$def tmp_store_dir action_id=nil;T;)T;*I"ldef tmp_store_dir action_id=nil "#{ Card.paths['files'].existent.first }/#{upload_cache_card.id}" end;T;+To; ; F; ;,;;;I"/Card::Set::Abstract::Attachment#item_names;F;[[I" _args;TI"{};T;[[@!iZ[@!iw;T;;;;;[;{;IC;"-needed for flexmail attachments. hacky. ;T;@!;F;[;[; I"-needed for flexmail attachments. hacky.;T;!0;"o;#;$F;%iw;&iw;'@!;(I"def item_names(_args={});T;)T;*I"^def item_names(args={}) # needed for flexmail attachments. hacky. [self.cardname] end;T;+To; ; F; ;,;;;I"6Card::Set::Abstract::Attachment#original_filename;F;[;[[@!i^[@!i{;F;:original_filename;;;[;{;IC;" ;T;@!;.0;F;[;[; I";T;!0;'@!;(I"def original_filename;T;)T;*I"=def original_filename attachment.original_filename end;T;+To; ; F; ;,;;;I"8Card::Set::Abstract::Attachment#preliminary_upload?;F;[;[[@!ib[@!i~;F;:preliminary_upload?;;;[;{;IC;" ;T;@!;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@!; I";T;!0;'@!;(I"def preliminary_upload?;T;)T;*I"Tdef preliminary_upload? Card::Env && Card::Env.params[:attachment_upload] end;T;+To; ; F; ;,;;;I"=Card::Set::Abstract::Attachment#save_preliminary_upload?;F;[;[[@!if[@!i;F;:save_preliminary_upload?;;;[;{;IC;" ;T;@";.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@"; I";T;!0;'@!;(I"!def save_preliminary_upload?;T;)T;*I"Qdef save_preliminary_upload? Card::Env.params[:cached_upload].present? end;T;+To; ; F; ;,;;;I"8Card::Set::Abstract::Attachment#attachment_changed?;F;[;[[@!ij[@!i;F;:attachment_changed?;;;[;{;IC;" ;T;@";.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@"; I";T;!0;'@!;(I"def attachment_changed?;T;)T;*I"Edef attachment_changed? send "#{attachment_name}_changed?" end;T;+To; ; F; ;,;;;I"5Card::Set::Abstract::Attachment#create_versions?;F;[;[[@!in[@!i;F;:create_versions?;;;[;{;IC;" ;T;@(";.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@("; I";T;!0;'@!;(I"def create_versions?;T;)T;*I"$def create_versions? true end;T;+To; ; F; ;,;;;I"0Card::Set::Abstract::Attachment#store_place;F;[;[[@!ir;F;:store_place;;;[;{;IC;" ;T;@;";.0;F;[;[; I";T;!0;'@!;(I"def store_place;T;)T;*I">def store_place @store_place ||= mod_file? || :deck end;T;+To; ; F; ;,;;;I"3Card::Set::Abstract::Attachment#load_from_mod=;F;[[I" value;T0;[[@!iv[@!i;F;:load_from_mod=;;;[;{;IC;" ;T;@H";.0;F;[;[; I";T;!0;'@!;(I"def load_from_mod=(value);T;)T;*I"0def load_from_mod= value @mod = value end;T;+To; ; F; ;,;;;I"2Card::Set::Abstract::Attachment#load_from_mod;F;[;[[@!iz[@!i;F;:load_from_mod;;;[;{;IC;" ;T;@X";.0;F;[;[; I";T;!0;'@!;(I"def load_from_mod;T;)T;*I"!def load_from_mod @mod end;T;+To; ; F; ;,;;;I".Card::Set::Abstract::Attachment#store_dir;F;[;[[@!i~[@!i;F;:store_dir;;;[;{;IC;" ;T;@f";.0;F;[;[; I";T;!0;'@!;(I"def store_dir;T;)T;*I"def store_dir if (store_place == :deck) if id "#{ Card.paths['files'].existent.first }/#{id}" else tmp_store_dir end else "#{ Cardio.gem_root}/mod/#{store_place}/file/#{codename}" end end;T;+To; ; F; ;,;;;I".Card::Set::Abstract::Attachment#mod_file?;F;[;[[@!i[@!i;F;:mod_file?;;;[;{;IC;" ;T;@t";.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@t"; I";T;!0;'@!;(I"def mod_file?;T;)T;*I"def mod_file? # when db_content was changed assume that it's no longer a mod file if @store_place != :deck && !db_content_changed? && content.present? case content when /^:[^\/]+\/([^.]+)/ ; $1 # current mod_file format when /^\~/ ; false # current id file format else if lines = content.split("\n") and lines.size == 4 # old format, still used in card_changes. lines.last end end end end;T;+To; ; F; ;,;;;I"CCard::Set::Abstract::Attachment#assign_set_specific_attributes;F;[;[[@!i[@!i;F;;;;;[;{;IC;" ;T;@";.0;F;[;[; I";T;!0;'@!;(I"'def assign_set_specific_attributes;T;)T;*I"}def assign_set_specific_attributes if @set_specific && @set_specific.present? self.content = nil end super end;T;+To; ; F; ;,;;;I"9Card::Set::Abstract::Attachment#clear_upload_tmp_dir;F;[;[[@!i;F;:clear_upload_tmp_dir;;;[;{;IC;" ;T;@";.0;F;[;[; I";T;!0;'@!;(I"def clear_upload_tmp_dir;T;)T;*I"/def clear_upload_tmp_dir Dir.entries(tmp_store_dir).each do |filename| if filename =~/^\d+/ path = File.join(tmp_store_dir, filename ) older_than_five_days = ( DateTime.now - File.ctime(path) > 432000) if older_than_five_days FileUtils.rm path end end end end;T;+To; ; F; ;,;;;I"/Card::Set::Abstract::Attachment#symlink_to;F;[[I"prior_action_id;T0;[[@!i[@!i;T;:symlink_to;;;[;{;IC;"7create filesystem links to files from prior action ;T;@";F;[;[; I"7create filesystem links to files from prior action;T;!0;"o;#;$F;%i;&i;'@!;(I"$def symlink_to(prior_action_id);T;)T;*I"kdef symlink_to(prior_action_id) # create filesystem links to files from prior action if prior_action_id != last_action_id save_action_id = selected_action_id links = {} self.selected_action_id = prior_action_id attachment.versions.each do |name, version| links[name] = version.store_path end original = attachment.store_path self.selected_action_id = last_action_id attachment.versions.each do |name, version| ::File.symlink links[name], version.store_path end ::File.symlink original, attachment.store_path self.selected_action_id = save_action_id end end;T;+To; ; F; ;,;;;I"6Card::Set::Abstract::Attachment#attachment_format;F;[[I"ext;T0;[[@!i[@!i;F;:attachment_format;;;[;{;IC;" ;T;@";.0;F;[;[; I";T;!0;'@!;(I"def attachment_format(ext);T;)T;*I"def attachment_format(ext) if ext.present? && attachment && original_ext=attachment.extension if['file', original_ext].member? ext original_ext elsif exts = MIME::Types[attachment.content_type] if exts.find {|mt| mt.extensions.member? ext } ext else exts[0].extensions[0] end end end rescue => e Rails.logger.info "attachment_format issue: #{e.message}" nil end;T;+To; ; F; ;,;;;I"8Card::Set::Abstract::Attachment#file_ready_to_save?;F;[;[[@!iK;F;:file_ready_to_save?;;;[;{;IC;" ;T;@";.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@"; I";T;!0;'@!;(I"def file_ready_to_save?;T;)T;*I"def file_ready_to_save? attachment.file.present? && !preliminary_upload? && !save_preliminary_upload? && attachment_changed? end;T;+To; ; F; ;,;;;I".Card::Set::Abstract::Attachment#unfilled?;F;[;[[@!i;F;:unfilled?;;;[;{;IC;" ;T;@";.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@"; I";T;!0;'@!;(I"def unfilled?;T;)T;*I"`def unfilled? !attachment.present? && !save_preliminary_upload? && !subcards.present? end;T;+To; ; F; ;,;;;I"@Card::Set::Abstract::Attachment#action_id_of_cached_upload=;F;[[I" value;T0;[[@!i;T;: action_id_of_cached_upload=;;;[;{;IC;"#action id of the cached upload ;T;@";F;[;[; I"#action id of the cached upload;T;!0;"o;#;$F;%i;&i;'@!;(I"*def action_id_of_cached_upload= value;T;)T;*I"Tdef action_id_of_cached_upload= value @action_id_of_cached_upload = value end;T;+To; ; F; ;,;;;I"?Card::Set::Abstract::Attachment#action_id_of_cached_upload;F;[;[[@!i;F;:action_id_of_cached_upload;;;[;{;IC;" ;T;@";.0;F;[;[; I";T;!0;'@!;(I"#def action_id_of_cached_upload;T;)T;*I"Edef action_id_of_cached_upload @action_id_of_cached_upload end;T;+To; ; F; ;,;;;I".Card::Set::Abstract::Attachment#empty_ok=;F;[[I" value;T0;[[@!i;F;:empty_ok=;;;[;{;IC;" ;T;@#;.0;F;[;[; I";T;!0;'@!;(I"def empty_ok= value;T;)T;*I"0def empty_ok= value @empty_ok = value end;T;+To; ; F; ;,;;;I".Card::Set::Abstract::Attachment#empty_ok?;F;[;[[@!i;F;:empty_ok?;;;[;{;IC;" ;T;@#;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@#; I";T;!0;'@!;(I"def empty_ok?;T;)T;*I""def empty_ok? @empty_ok end;T;+To; ; F; ;,;;;I"1Card::Set::Abstract::Attachment#retrieve_dir;F;[;[[@!i;F;:retrieve_dir;;;[;{;IC;" ;T;@%#;.0;F;[;[; I";T;!0;'@!;(I"def retrieve_dir;T;)T;*I"Pdef retrieve_dir if mod_file? mod_dir else upload_dir end end;T;+To; ; F; ;,;;;I"/Card::Set::Abstract::Attachment#upload_dir;F;[;[[@!i;T;:upload_dir;;;[;{;IC;"*place for files of regular file cards ;T;@2#;F;[;[; I"*place for files of regular file cards;T;!0;"o;#;$F;%i;&i;'@!;(I"def upload_dir;T;)T;*I"qdef upload_dir if id "#{Card.paths['files'].existent.first}/#{id}" else tmp_upload_dir end end;T;+To; ; F; ;,;;;I"3Card::Set::Abstract::Attachment#tmp_upload_dir;F;[[I"_action_id;TI"nil;T;[[@!i;T;:tmp_upload_dir;;;[;{;IC;"3place for files if card doesn't have an id yet ;T;@@#;F;[;[; I"3place for files if card doesn't have an id yet;T;!0;"o;#;$F;%i;&i;'@!;(I"&def tmp_upload_dir _action_id=nil;T;)T;*I"ldef tmp_upload_dir _action_id=nil "#{Card.paths['files'].existent.first}/#{upload_cache_card.id}" end;T;+To; ; F; ;,;;;I",Card::Set::Abstract::Attachment#mod_dir;F;[;[[@!i;T;: mod_dir;;;[;{;IC;"&place for files of mod file cards ;T;@Q#;F;[;[; I"&place for files of mod file cards;T;!0;"o;#;$F;%i;&i;'@!;(I"def mod_dir;T;)T;*I"def mod_dir mod = @mod || mod_file? Card.paths['mod'].to_a.each do |mod_path| dir = File.join(mod_path, mod, 'file', codename) if Dir.exist? dir return dir end end end;T;+To; ; F; ;,;;;I"ICard::Set::Abstract::Attachment#clear_upload_cache_dir_for_new_cards;F;[;[[@!i;F;:)clear_upload_cache_dir_for_new_cards;;;[;{;IC;" ;T;@_#;.0;F;[;[; I";T;!0;'@!;(I"-def clear_upload_cache_dir_for_new_cards;T;)T;*I"def clear_upload_cache_dir_for_new_cards Dir.entries(tmp_upload_dir).each do |filename| if filename =~/^\d+/ path = File.join(tmp_upload_dir, filename ) if Card.older_than_five_days? File.ctime(path) FileUtils.rm path end end end end;T;+To; ; F; ;,;;;I"def used! Auth.as_bot { delete! } unless permanent? end;T;+To; ; F; ;,;;;I"!Card::Set::Right::Token#term;F;[;[[@I$i);F;: term;;;[;{;IC;" ;T;@$;.0;F;[;[; I";T;!0;'@D$;(I" def term;T;)T;*I"def term @term ||= if expiration.present? term_from_string expiration else Card.config.token_expiry end end;T;+To; ; F; ;,;;;I"-Card::Set::Right::Token#term_from_string;F;[[I" string;T0;[[@I$i2;F;:term_from_string;;;[;{;IC;" ;T;@$;.0;F;[;[; I";T;!0;'@D$;(I" def term_from_string string;T;)T;*I"3def term_from_string string string.strip! return 'permanent' if string == 'none' re_match = /^(\d+)[\.\s]*(#{DURATIONS})s?$/.match(string) number, unit = re_match.captures if re_match if unit number.to_i.send unit else raise Card::Oops, "illegal expiration value (eg '2 days')" end end;T;+T;I@D$;JIC;[o;S ;T0;UI"Card::Set;T;V@D$;;;'@;W@;X;Y;I@D$;KIC;[o;S ;T0;UI"All::Permissions::Accounts;T;V@D$;;;'@;W@;X;Y;I@D$;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod007-05_standard/right/token.rb;Ti;F;: Token;;;;;[;{;IC;" ;T;@D$;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Token;F;+To;7;IC;[;I@$;JIC;[o;S ;T0;UI"Card::Set;T;V@$;;;'@;W@;X;Y;I@$;KIC;[o;S ;T0;U0;V0;: Machine;'@;Wo;7;IC;[o;7;IC;[ o; ; F; ;,;;;I".Card::Machine::ClassMethods#output_config;F;[;[[I"(mod/03_machines/lib/card/machine.rb;Ti+[I"(mod/03_machines/lib/card/machine.rb;Ti*;F;:output_config;;;[;{;IC;"1Returns the value of attribute output_config ;T;@$;.0;F;[;[; I"1Returns the value of attribute output_config;T;!0;'@$;(I"def output_config;T;*I"+def output_config @output_config end;T;+To; ; F; ;,;;;I"/Card::Machine::ClassMethods#output_config=;F;[[I" value;T0;[[@$i+[@$i*;F;:output_config=;;;[;{;IC;"%Sets the attribute output_config ;T;@$;.0;F;[;[o;0 ;1I" param;F;2I"5the value to set the attribute output_config to.;T;I" value;T;30;@$; I"cSets the attribute output_config @param value the value to set the attribute output_config to.;T;!0;'@$;(I"def output_config=(value);T;*I";def output_config=(value) @output_config = value end;T;+To; ; F; ;,;;;I"4Card::Machine::ClassMethods#collect_input_cards;F;[[I" &block;T0;[[@$i-[@$i,;F;:collect_input_cards;;;[;{;IC;" ;T;@$;.0;F;[;[; I";T;!0;'@$;(I"$def collect_input_cards(&block);T;)T;*I"Mdef collect_input_cards &block define_method :engine_input, &block end;T;+To; ; F; ;,;;;I"6Card::Machine::ClassMethods#prepare_machine_input;F;[[I" &block;T0;[[@$i1[@$i0;F;:prepare_machine_input;;;[;{;IC;" ;T;@%;.0;F;[;[; I";T;!0;'@$;(I"&def prepare_machine_input(&block);T;)T;*I"Pdef prepare_machine_input &block define_method :before_engine, &block end;T;+To; ; F; ;,;;;I"/Card::Machine::ClassMethods#machine_engine;F;[[I" &block;T0;[[@$i5[@$i4;F;:machine_engine;;;[;{;IC;" ;T;@%;.0;F;[;[; I";T;!0;'@$;(I"def machine_engine(&block);T;)T;*I"Bdef machine_engine &block define_method :engine, &block end;T;+To; ; F; ;,;;;I"5Card::Machine::ClassMethods#store_machine_output;F;[[I" args;TI"{};T[I" &block;T0;[[@$i9[@$i8;F;:store_machine_output;;;[;{;IC;" ;T;@$%;.0;F;[;[; I";T;!0;'@$;(I".def store_machine_output(args={}, &block);T;)T;*I"def store_machine_output args={}, &block output_config.merge!(args) if block_given? define_method :after_engine, &block end end;T;+T;I@$;JIC;[;I@$;KIC;[;I@$;LIC;M{; IC;M{;NT;,IC;M{;=IC;M{: read@$: write@$;NT;NT;NT;O{;P[;[[@$i*[@$i);F;;;;;;;[;{;IC;" ;T;@$;.0;F;[;[; I";T;!0;'@$;I" Card::Machine::ClassMethods;F;+To; ; F; ; ;;;I"Card::Machine.included;F;[[I"host_class;T0;[[@$iA[@$i?;F;;;;;[;{;IC;" ;T;@I%;.0;F;[;[o;0 ;1I" private;F;20;0;30;@I%o;0 ;1I" private;F;20;0;30;@I%; I";T;!0;'@$;(I"def included(host_class);T;)T;*I"def self.included(host_class) host_class.extend( ClassMethods ) host_class.output_config = { filetype: 'txt' } if Codename[:machine_output] # for compatibility with old migrations host_class.card_accessor :machine_output, type: :file host_class.card_accessor :machine_input, type: :pointer # define default machine behaviour host_class.collect_input_cards do # traverse through all levels of pointers and # collect all item cards as input items = [self] new_input = [] already_extended = {} # avoid loops loop_limit = 5 while items.size > 0 item = items.shift next if item.trash next if already_extended[item.id].to_i > loop_limit if item.item_cards == [item] # no pointer card new_input << item else items.insert(0, item.item_cards) items.flatten! new_input << item if item != self already_extended[item] = already_extended[item].to_i + 1 end end new_input end host_class.prepare_machine_input {} host_class.machine_engine { |input| input } host_class.store_machine_output do |output| filetype = host_class.output_config[:filetype] file = Tempfile.new [ id.to_s, ".#{filetype}" ] file.write output file.rewind Card::Auth.as_bot do p = machine_output_card p.file = file p.save! end file.close file.unlink end host_class.format do view :machine_output_url do |args| machine_output_url end end event_suffix = host_class.name.gsub ':', '_' host_class.event( "reset_machine_output_#{ event_suffix }".to_sym, after: :store_subcards, on: :save ) do reset_machine_output! end end end;T;+To; ; F; ;,;;;I"Card::Machine#run_machine;F;[[I" joint;TI" "\n";T;[[@$i~[@$i;F;:run_machine;;;[;{;IC;" ;T;@]%;.0;F;[;[; I";T;!0;'@$;(I" def run_machine(joint="\n");T;)T;*I"adef run_machine joint="\n" before_engine output = input_item_cards.map do |input| unless input.kind_of? Card::Set::Type::Pointer if input.respond_to? :machine_input engine( input.machine_input ) else engine( input.format._render_raw ) end end end.select(&:present?).join( joint ) after_engine output end;T;+To; ; F; ;,;;;I"(Card::Machine#reset_machine_output!;F;[;[[@$i[@$i;F;:reset_machine_output!;;;[;{;IC;" ;T;@n%;.0;F;[;[; I";T;!0;'@$;(I"def reset_machine_output!;T;)T;*I"def reset_machine_output! Auth.as_bot do moc = machine_output_card and moc.real? and moc.delete! #mic = machine_input_card and mic.real? and mic.delete! update_input_card end end;T;+To; ; F; ;,;;;I"(Card::Machine#update_machine_output;F;[;[[@$i[@$i;F;:update_machine_output;;;[;{;IC;" ;T;@|%;.0;F;[;[; I";T;!0;'@$;(I"def update_machine_output;T;)T;*I"def update_machine_output if ok? :read and not was_already_locked = locked? Auth.as_bot do lock! update_input_card run_machine end end ensure unlock! unless was_already_locked end;T;+To; ; F; ;,;;;I"!Card::Machine#lock_cache_key;F;[;[[@$i[@$i;F;:lock_cache_key;;;[;{;IC;" ;T;@%;.0;F;[;[; I";T;!0;'@$;(I"def lock_cache_key;T;)T;*I"2def lock_cache_key "UPDATE-LOCK:#{key}" end;T;+To; ; F; ;,;;;I"Card::Machine#locked?;F;[;[[@$i[@$i;F;: locked?;;;[;{;IC;" ;T;@%;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@%; I";T;!0;'@$;(I"def locked?;T;)T;*I"5def locked? Card.cache.read lock_cache_key end;T;+To; ; F; ;,;;;I"Card::Machine#lock!;F;[;[[@$i[@$i;F;: lock!;;;[;{;IC;" ;T;@%;.0;F;[;[; I";T;!0;'@$;(I"def lock!;T;)T;*I":def lock! Card.cache.write lock_cache_key, true end;T;+To; ; F; ;,;;;I"Card::Machine#unlock!;F;[;[[@$i[@$i;F;: unlock!;;;[;{;IC;" ;T;@%;.0;F;[;[; I";T;!0;'@$;(I"def unlock!;T;)T;*I"=def unlock! Card.cache.write lock_cache_key, false end;T;+To; ; F; ;,;;;I"$Card::Machine#update_input_card;F;[;[[@$i[@$i;F;:update_input_card;;;[;{;IC;" ;T;@%;.0;F;[;[; I";T;!0;'@$;(I"def update_input_card;T;)T;*I"Hdef update_input_card machine_input_card.items = engine_input end;T;+To; ; F; ;,;;;I"#Card::Machine#input_item_cards;F;[;[[@$i[@$i;F;:input_item_cards;;;[;{;IC;" ;T;@%;.0;F;[;[; I";T;!0;'@$;(I"def input_item_cards;T;)T;*I"=def input_item_cards machine_input_card.item_cards end;T;+To; ; F; ;,;;;I"%Card::Machine#machine_output_url;F;[;[[@$i[@$i;F;:machine_output_url;;;[;{;IC;" ;T;@%;.0;F;[;[; I";T;!0;'@$;(I"def machine_output_url;T;)T;*I"def machine_output_url ensure_machine_output machine_output_card.file.url #(:default, timestamp: false) # to get rid of additional number in url end;T;+To; ; F; ;,;;;I"&Card::Machine#machine_output_path;F;[;[[@$i[@$i;F;:machine_output_path;;;[;{;IC;" ;T;@%;.0;F;[;[; I";T;!0;'@$;(I"def machine_output_path;T;)T;*I"Xdef machine_output_path ensure_machine_output machine_output_card.file.path end;T;+To; ; F; ;,;;;I"(Card::Machine#ensure_machine_output;F;[;[[@$i[@$i;F;:ensure_machine_output;;;[;{;IC;" ;T;@%;.0;F;[;[; I";T;!0;'@$;(I"def ensure_machine_output;T;)T;*I"def ensure_machine_output output = fetch trait: :machine_output if !output || !output.selected_content_action_id update_machine_output end end;T;+To; ; F; ; ;;;I"(Card::Machine.define_machine_events;F;[[I"host_class;T0;[[@$iN;F;:define_machine_events;;;[;{;IC;" ;T;@ &;.0;F;[;[; I";T;!0;'@$;(I".def self.define_machine_events host_class;T;)T;*I"def self.define_machine_events host_class event_suffix = host_class.name.tr ':', '_' event_name = "reset_machine_output_#{event_suffix}".to_sym host_class.event event_name, after: :expire_related, on: :save do reset_machine_output! end end;T;+To; ; F; ; ;;;I"'Card::Machine.define_machine_views;F;[[I"host_class;T0;[[@$iV;F;:define_machine_views;;;[;{;IC;" ;T;@&;.0;F;[;[; I";T;!0;'@$;(I"-def self.define_machine_views host_class;T;)T;*I"def self.define_machine_views host_class host_class.format do view :machine_output_url do |_args| machine_output_url end end end;T;+To; ; F; ; ;;;I"0Card::Machine.set_default_machine_behaviour;F;[[I"host_class;T0;[[@$i^;F;:"set_default_machine_behaviour;;;[;{;IC;" ;T;@+&;.0;F;[;[; I";T;!0;'@$;(I"6def self.set_default_machine_behaviour host_class;T;)T;*I"def self.set_default_machine_behaviour host_class set_default_input_collection_method host_class set_default_input_preparation_method host_class set_default_output_storage_method host_class host_class.machine_engine { |input| input } end;T;+To; ; F; ; ;;;I"7Card::Machine.set_default_input_preparation_method;F;[[I"host_class;T0;[[@$ie;F;:)set_default_input_preparation_method;;;[;{;IC;" ;T;@:&;.0;F;[;[; I";T;!0;'@$;(I"=def self.set_default_input_preparation_method host_class;T;)T;*I"gdef self.set_default_input_preparation_method host_class host_class.prepare_machine_input {} end;T;+To; ; F; ; ;;;I"4Card::Machine.set_default_output_storage_method;F;[[I"host_class;T0;[[@$ii;F;:&set_default_output_storage_method;;;[;{;IC;" ;T;@I&;.0;F;[;[; I";T;!0;'@$;(I":def self.set_default_output_storage_method host_class;T;)T;*I"xdef self.set_default_output_storage_method host_class host_class.store_machine_output do |output| filetype = host_class.output_config[:filetype] file = Tempfile.new [id.to_s, ".#{filetype}"] file.write output file.rewind Card::Auth.as_bot do p = machine_output_card p.file = file p.save! end file.close file.unlink end end;T;+To; ; F; ; ;;;I"6Card::Machine.set_default_input_collection_method;F;[[I"host_class;T0;[[@$iy;F;:(set_default_input_collection_method;;;[;{;IC;" ;T;@X&;.0;F;[;[; I";T;!0;'@$;(I" 0 item = items.shift next if item.trash || already_extended[item.id].to_i > loop_limit if item.item_cards == [item] # no pointer card new_input << item else # item_cards instantiates non-existing cards # we don't want those items.insert(0, item.item_cards.reject(&:unknown?)) items.flatten! new_input << item if item != self && item.known? already_extended[item] = already_extended[item].to_i + 1 end end new_input end end;T;+T;I@$;JIC;[;I@$;KIC;[;I@$;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@$i)[@$i(;F;;<;;;;;[;{;IC;" ;T;@$;.0;F;[;[; I";T;!0;'@;I"Card::Machine;F;+T;X;Y;I@$;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod005-04_settings/right/style.rb;Ti;F;: Style;;;;;[;{;IC;" ;T;@$;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Style;F;+To;7;IC;[o; ; F; ;,;;;I",Card::Set::Right::Followers#raw_content;F;[;[[I"3tmpsets/set/mod006-05_email/right/followers.rb;Ti [I"3tmpsets/set/mod006-05_email/right/followers.rb;Ti ;F;;Y;;;[;{;IC;" ;T;@&;.0;F;[;[; I";T;!0;'@&;(I"def raw_content;T;)T;*I"def raw_content if left items = if (left.type_id == SetID) || (left.type_id == CardtypeID) left.default_follow_set_card.all_user_ids_with_rule_for(:follow).map do |user_id| if left.followed_by?(user_id) && (user = Card.find(user_id)) user.name else nil end end.compact else left.follower_names end items.map {|item| "[[#{item}]]"}.join "\n" else '' end end;T;+To; ; F; ;,;;;I")Card::Set::Right::Followers#virtual?;F;[;[[@&i[@&i ;F;;;;;[;{;IC;" ;T;@&;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@&; I";T;!0;'@&;(I"def virtual?;T;)T;*I"def virtual?; true end;T;+T;I@&;JIC;[o;S ;T0;UI"Card::Set;T;V@&;;;'@;W@;X;Y;I@&;KIC;[o;S ;T0;UI"Card::Set::Type::Pointer;T;V@&;: Pointer;'o;7;IC;[o;7;IC;[o; ; F; ;,;;;I"&Card::Set::Type::Css#compress_css;F;[[I" input;T0;[[I"/tmpsets/set/mod004-03_machines/type/css.rb;Ti[I"/tmpsets/set/mod004-03_machines/type/css.rb;Ti;F;:compress_css;;;[;{;IC;" ;T;@&;.0;F;[;[; I";T;!0;'@&;(I"def compress_css(input);T;)T;*I"def compress_css input begin Sass.compile input, :style=>:compressed rescue => e raise Card::Oops, "Stylesheet Error:\n#{ e.message }" end end;T;+To; ; F; ;,;;;I"%Card::Set::Type::Css#clean_html?;F;[;[[@&i[@&i;F;;];;;[;{;IC;" ;T;@&;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@&; I";T;!0;'@&;(I"def clean_html?;T;)T;*I" def clean_html? false end;T;+To; ; F; ;,;;;I"#Card::Set::Type::Css#diff_args;F;[;[[@&i6[@&i7;F;;q;;;[;{;IC;" ;T;@&;.0;F;[;[; I";T;!0;'@&;(I"def diff_args;T;)T;*I"*def diff_args {:format=>:text} end;T;+T;I@&;JIC;[o;S ;T0;UI"Card::Set;T;V@&;;;'@;W@;X;Y;I@&;KIC;[o;S ;T0;U0;V0;:MachineInput;'@;Wo;7;IC;[ o;7;IC;[ o; ; F; ;,;;;I"2Card::MachineInput::ClassMethods#machines_wql;F;[;[[I".mod/03_machines/lib/card/machine_input.rb;Ti ;F;:machines_wql;;;[;{;IC;"0Returns the value of attribute machines_wql ;T;@&;.0;F;[;[; I"0Returns the value of attribute machines_wql;T;!0;'@&;(I"def machines_wql;T;*I")def machines_wql @machines_wql end;T;+To; ; F; ;,;;;I"3Card::MachineInput::ClassMethods#machines_wql=;F;[[I" value;T0;[[@&i ;F;:machines_wql=;;;[;{;IC;"$Sets the attribute machines_wql ;T;@';.0;F;[;[o;0 ;1I" param;F;2I"4the value to set the attribute machines_wql to.;T;I" value;T;30;@'; I"aSets the attribute machines_wql @param value the value to set the attribute machines_wql to.;T;!0;'@&;(I"def machines_wql=(value);T;*I"9def machines_wql=(value) @machines_wql = value end;T;+To; ; F; ;,;;;I"7Card::MachineInput::ClassMethods#machine_input_for;F;[[I" args;T0;[[@&i ;F;:machine_input_for;;;[;{;IC;" ;T;@';.0;F;[;[; I";T;!0;'@&;(I" def machine_input_for(args);T;)T;*I":def machine_input_for args @machines_wql = args end;T;+To; ; F; ;,;;;I"3Card::MachineInput::ClassMethods#machine_input;F;[[I" &block;T0;[[@&i;F;:machine_input;;;[;{;IC;" ;T;@"';.0;F;[;[; I";T;!0;'@&;(I"def machine_input(&block);T;)T;*I"Gdef machine_input &block define_method :machine_input, block end;T;+T;I@&;JIC;[;I@&;KIC;[;I@&;LIC;M{; IC;M{;NT;,IC;M{;[IC;M{;C@&;D@';NT;NT;NT;O{;P[;[[@&i;F;;;;;;;[;{;IC;" ;T;@&;.0;F;[;[; I";T;!0;'@&;I"%Card::MachineInput::ClassMethods;F;+To; ; F; ; ;;;I" Card::MachineInput.included;F;[[I"host_class;T0;[[@&i;F;;;;;[;{;IC;" ;T;@B';.0;F;[;[o;0 ;1I" private;F;20;0;30;@B'o;0 ;1I" private;F;20;0;30;@B'; I";T;!0;'@&;(I"def included(host_class);T;)T;*I"mdef self.included host_class host_class.extend( ClassMethods ) host_class.machines_wql = {} host_class.machine_input do format._render_raw end event_suffix = host_class.name.gsub ':', '_' host_class.event( "after_machine_input_updated_#{ event_suffix }".to_sym, after: :extend, on: :save ) do wql_statement = { right_plus: [ { codename: "machine_input" }, { link_to: name} ]}.merge(host_class.machines_wql) machines = Card.search(wql_statement) machines.each do |item| item.reset_machine_output! if item.kind_of? Machine end end host_class.event( "before_machine_input_deleted_#{ event_suffix }".to_sym, after: :approve, on: :delete ) do @involved_machines = Card.search( {right_plus: [ {codename: "machine_input"}, {link_to: name} ]}.merge(host_class.machines_wql) ) end host_class.event( "after_machine_input_deleted_#{ event_suffix }".to_sym, after: :store_subcards, on: :delete ) do @involved_machines.each do |item| item.reset_machine_output! if item.kind_of? Machine end end end;T;+To; ; F; ; ;;;I",Card::MachineInput.define_delete_events;F;[[I"event_suffix;T0[I"host_class;T0;[[I".mod/03_machines/lib/card/machine_input.rb;Ti;F;:define_delete_events;;;[;{;IC;" ;T;@U';.0;F;[;[; I";T;!0;'@&;(I";def self.define_delete_events event_suffix, host_class;T;)T;*I"def self.define_delete_events event_suffix, host_class event_name = "before_machine_input_deleted_#{event_suffix}".to_sym host_class.event event_name, :store, on: :delete do # exclude self because it's on the way to the trash # otherwise it will be created again with the reset_machine_output # call in the event below @involved_machines = Card::MachineInput.search_involved_machines(name, host_class) .reject { |card| card == self } end event_name = "after_machine_input_deleted_#{event_suffix}".to_sym host_class.event event_name, :finalize, on: :delete do @involved_machines.each do |item| item.reset_machine_output! if item.is_a? Machine end end end;T;+To; ; F; ; ;;;I"+Card::MachineInput.define_update_event;F;[[I"event_suffix;T0[I"host_class;T0;[[@^'i1;F;:define_update_event;;;[;{;IC;" ;T;@g';.0;F;[;[; I";T;!0;'@&;(I":def self.define_update_event event_suffix, host_class;T;)T;*I"Udef self.define_update_event event_suffix, host_class host_class.event( "after_machine_input_updated_#{event_suffix}".to_sym, :integrate, on: :save ) do Card::MachineInput.search_involved_machines(name, host_class) .each do |item| item.reset_machine_output! if item.is_a? Machine end end end;T;+To; ; F; ; ;;;I"0Card::MachineInput.search_involved_machines;F;[[I" name;T0[I"host_class;T0;[[@^'i=;F;:search_involved_machines;;;[;{;IC;" ;T;@x';.0;F;[;[; I";T;!0;'@&;(I"7def self.search_involved_machines name, host_class;T;)T;*I"def self.search_involved_machines name, host_class wql_statement = { right_plus: [ { codename: 'machine_input' }, { link_to: name } ] }.merge(host_class.machines_wql) Card.search(wql_statement) end;T;+T;I@&;JIC;[;I@&;KIC;[;I@&;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@&i;F;;Z;;;;;[;{;IC;" ;T;@&;.0;F;[;[; I";T;!0;'@;I"Card::MachineInput;F;+T;X;Yo;S ;T0;U0;V0;;<;'@;W@$;X;Y;I@&;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@&i;F;:Css;;;;;[;{;IC;" ;T;@&;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Css;F;+To;7;IC;[;I@';JIC;[o;S ;T0;UI"Card::Set;T;V@';;;'@;W@;X;Y;I@';KIC;[;I@';LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"/tmpsets/set/mod007-05_standard/type/uri.rb;Ti;F;:Uri;;;;;[;{;IC;" ;T;@';.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Uri;F;+To;7;IC;[o; ; F; ;,;;;I"&Card::Set::Type::Set#followed_by?;F;[[I" user_id;TI"nil;T;[[I"/tmpsets/set/mod007-05_standard/type/set.rb;Ti[I"/tmpsets/set/mod007-05_standard/type/set.rb;Ti;F;;);;;[;{;IC;" ;T;@';.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@'; I";T;!0;'@';(I"$def followed_by?(user_id = nil);T;)T;*I"Jdef followed_by? user_id = nil all_members_followed_by? user_id end;T;+To; ; F; ;,;;;I"1Card::Set::Type::Set#default_follow_set_card;F;[;[[@'i[@'i;F;;-;;;[;{;IC;" ;T;@';.0;F;[;[; I";T;!0;'@';(I" def default_follow_set_card;T;)T;*I"+def default_follow_set_card self end;T;+To; ; F; ;,;;;I"&Card::Set::Type::Set#inheritable?;F;[;[[@'i[@'i;F;:inheritable?;;;[;{;IC;" ;T;@';.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@'; I";T;!0;'@';(I"def inheritable?;T;)T;*I"def inheritable? return true if junction_only? cardname.trunk_name.junction? and cardname.tag_name.key == Card::SelfSet.pattern.key end;T;+To; ; F; ;,;;;I"*Card::Set::Type::Set#subclass_for_set;F;[;[[@'i[@'i;F;:subclass_for_set;;;[;{;IC;" ;T;@';.0;F;[;[; I";T;!0;'@';(I"def subclass_for_set;T;)T;*I"def subclass_for_set set_class_key = tag.codename Card.set_patterns.find do |sub| cardname.tag_name.key == sub.pattern.key end end;T;+To; ; F; ;,;;;I"(Card::Set::Type::Set#junction_only?;F;[;[[@'i[@'i;F;:junction_only?;;;[;{;IC;" ;T;@(;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@(; I";T;!0;'@';(I"def junction_only?;T;)T;*I"def junction_only?() if @junction_only.nil? @junction_only = subclass_for_set.junction_only else @junction_only end end;T;+To; ; F; ;,;;;I",Card::Set::Type::Set#reset_set_patterns;F;[;[[@'i[@'i;F;:reset_set_patterns;;;[;{;IC;" ;T;@(;.0;F;[;[; I";T;!0;'@';(I"def reset_set_patterns;T;)T;*I"]def reset_set_patterns Card.members( key ).each do |mem| Card.expire mem end end;T;+To; ; F; ;,;;;I"Card::Set::Type::Set#label;F;[;[[@'i[@'i;F;;Z;;;[;{;IC;" ;T;@'(;.0;F;[;[; I";T;!0;'@';(I"def label;T;)T;*I"bdef label if klass = subclass_for_set klass.label cardname.left else '' end end;T;+To; ; F; ;,;;;I"&Card::Set::Type::Set#follow_label;F;[;[[@'i[@'i;F;;$;;;[;{;IC;" ;T;@5(;.0;F;[;[; I";T;!0;'@';(I"def follow_label;T;)T;*I"pdef follow_label if klass = subclass_for_set klass.follow_label cardname.left else '' end end;T;+To; ; F; ;,;;;I"*Card::Set::Type::Set#follow_rule_name;F;[[I" user;TI"nil;T;[[@'i[@'i;F;:follow_rule_name;;;[;{;IC;" ;T;@C(;.0;F;[;[; I";T;!0;'@';(I"#def follow_rule_name(user=nil);T;)T;*I"def follow_rule_name user=nil if user if user.kind_of? String "#{name}+#{user}+#{Card[:follow].name}" else "#{name}+#{user.name}+#{Card[:follow].name}" end else "#{name}+#{Card[:all].name}+#{Card[:follow].name}" end end;T;+To; ; F; ;,;;;I"4Card::Set::Type::Set#all_user_ids_with_rule_for;F;[[I"setting_code;T0;[[@'i[@'i;T;;;;;[;{;IC;"def to_following_item_name args left_part = follow_rule_name( args[:user] ) option = args[:option] || if (rule_card = Card.fetch(left_part)) rule_card.content else Card[:nothing].name end "#{left_part}+#{option}" end ;T;@T(;F;[;[; I"def to_following_item_name args left_part = follow_rule_name( args[:user] ) option = args[:option] || if (rule_card = Card.fetch(left_part)) rule_card.content else Card[:nothing].name end "#{left_part}+#{option}" end;T;!0;"o;#;$F;%i;&i;'@';(I"1def all_user_ids_with_rule_for(setting_code);T;)T;*I"idef all_user_ids_with_rule_for setting_code Card.all_user_ids_with_rule_for self, setting_code end;T;+To; ; F; ;,;;;I"4Card::Set::Type::Set#setting_codenames_by_group;F;[;[[@'i[@'i;F;:setting_codenames_by_group;;;[;{;IC;" ;T;@e(;.0;F;[;[; I";T;!0;'@';(I"#def setting_codenames_by_group;T;)T;*I"8def setting_codenames_by_group result = {} Card::Setting.groups.each do |group, settings| visible_settings = settings.reject { |s| !s or !s.applies_to_cardtype(prototype.type_id) } unless visible_settings.empty? result[group] = visible_settings.map { |s| s.codename } end end result end;T;+To; ; F; ;,;;;I"3Card::Set::Type::Set#visible_setting_codenames;F;[;[[@'i$[@'i);F;:visible_setting_codenames;;;[;{;IC;" ;T;@s(;.0;F;[;[; I";T;!0;'@';(I""def visible_setting_codenames;T;)T;*I"def visible_setting_codenames @visible_settings ||= Card::Setting.groups.values.flatten.compact.reject do |setting| !setting.applies_to_cardtype(prototype.type_id) end.map(&:codename) end;T;+To; ; F; ;,;;;I"*Card::Set::Type::Set#visible_settings;F;[[I" group;T0;[[@'i+[@'i0;F;:visible_settings;;;[;{;IC;" ;T;@(;.0;F;[;[; I";T;!0;'@';(I" def visible_settings(group);T;)T;*I"def visible_settings group Card::Setting.groups[group].reject do |setting| !setting or !setting.applies_to_cardtype(prototype.type_id) end end;T;+To; ; F; ;,;;;I"/Card::Set::Type::Set#all_members_followed?;F;[;[[@'i1[@'i6;F;:all_members_followed?;;;[;{;IC;" ;T;@(;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@(; I";T;!0;'@';(I"def all_members_followed?;T;)T;*I"Mdef all_members_followed? all_members_followed_by? Auth.current_id end;T;+To; ; F; ;,;;;I"2Card::Set::Type::Set#all_members_followed_by?;F;[[I" user_id;TI"nil;T;[[@'i5[@'i:;F;:all_members_followed_by?;;;[;{;IC;" ;T;@(;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@(; I";T;!0;'@';(I"0def all_members_followed_by?(user_id = nil);T;)T;*I"Bdef all_members_followed_by? user_id = nil if !prototype.followed_by? user_id return false elsif set_followed_by? user_id return true else broader_sets.each do |b_s| if (set_card = Card.fetch(b_s)) && set_card.set_followed_by?(user_id) return true end end end return false end;T;+To; ; F; ;,;;;I"'Card::Set::Type::Set#set_followed?;F;[;[[@'iD[@'iI;F;:set_followed?;;;[;{;IC;" ;T;@(;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@(; I";T;!0;'@';(I"def set_followed?;T;)T;*I"=def set_followed? set_followed_by? Auth.current_id end;T;+To; ; F; ;,;;;I"*Card::Set::Type::Set#set_followed_by?;F;[[I" user_id;TI"nil;T;[[@'iH[@'iM;F;:set_followed_by?;;;[;{;IC;" ;T;@(;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@(; I";T;!0;'@';(I"(def set_followed_by?(user_id = nil);T;)T;*I"def set_followed_by? user_id = nil return ( user_id && (user = Card.find(user_id)) && Card.fetch(follow_rule_name(user.name)) ) || Card.fetch(follow_rule_name) end;T;+To; ; F; ;,;;;I"&Card::Set::Type::Set#broader_sets;F;[;[[@'iM[@'iR;F;:broader_sets;;;[;{;IC;" ;T;@(;.0;F;[;[; I";T;!0;'@';(I"def broader_sets;T;)T;*I"6def broader_sets prototype.set_names[1..-1] end;T;+To; ; F; ;,;;;I"#Card::Set::Type::Set#prototype;F;[;[[@'iR[@'iW;F;:prototype;;;[;{;IC;" ;T;@(;.0;F;[;[; I";T;!0;'@';(I"def prototype;T;)T;*I"}def prototype opts = subclass_for_set.prototype_args self.cardname.trunk_name Card.fetch opts[:name], :new=>opts end;T;+To; ; F; ;,;;;I"&Card::Set::Type::Set#related_sets;F;[[I"with_self;TI" false;T;[[@'iW[@'i\;F;;;;;[;{;IC;" ;T;@(;.0;F;[;[; I";T;!0;'@';(I"(def related_sets(with_self = false);T;)T;*I"def related_sets with_self = false if subclass_for_set.anchorless? prototype.related_sets with_self else left(:new=>{}).related_sets with_self end end;T;+T;I@';JIC;[o;S ;T0;UI"Card::Set;T;V@';;;'@;W@;X;Y;I@';KIC;[o;S ;T0;UI" Card::Set::Type::SearchType;T;V@';:SearchType;'@&;Wo;7;IC;[ o; ; F; ;,;;;I"+Card::Set::Type::SearchType#item_cards;F;[[I" params;TI"{};T;[[I"7tmpsets/set/mod007-05_standard/type/search_type.rb;Ti ;F;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/type/search_type.rb ~~~~~~~~~~~ ;T;@);F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/type/search_type.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@);(I"def item_cards(params={});T;)T;*I"def item_cards params={} s = query(params) raise("OH NO.. no limit") unless s[:limit] # forces explicit limiting # can be 0 or less to force no limit Card.search( s ) end;T;+To; ; F; ;,;;;I"+Card::Set::Type::SearchType#item_names;F;[[I" params;TI"{};T;[[@ )i;F;;;;;[;{;IC;" ;T;@*);.0;F;[;[; I";T;!0;'@);(I"def item_names(params={});T;)T;*I"Tdef item_names params={} Card.search(query(params.merge(:return=>:name))) end;T;+To; ; F; ;,;;;I"*Card::Set::Type::SearchType#item_type;F;[;[[@ )i[I"7tmpsets/set/mod007-05_standard/type/search_type.rb;Ti;F;;;;;[;{;IC;" ;T;@:);.0;F;[;[; I";T;!0;'@);(I"def item_type;T;)T;*I"%def item_type query[:type] end;T;+To; ; F; ;,;;;I"&Card::Set::Type::SearchType#count;F;[[I" params;TI"{};T;[[@ )i[@@)i;F;: count;;;[;{;IC;" ;T;@I);.0;F;[;[; I";T;!0;'@);(I"def count(params={});T;)T;*I"@def count params={} Card.count_by_wql query( params ) end;T;+To; ; F; ;,;;;I"&Card::Set::Type::SearchType#query;F;[[I" params;TI"{};T;[[@ )i[@@)i ;F;: query;;;[;{;IC;" ;T;@Z);.0;F;[;[; I";T;!0;'@);(I"def query(params={});T;)T;*I"^def query params={} @query ||= {} @query[params.to_s] ||= get_query(params.clone) end;T;+To; ; F; ;,;;;I"*Card::Set::Type::SearchType#get_query;F;[[I" params;TI"{};T;[[@ )i#[@@)i%;F;:get_query;;;[;{;IC;" ;T;@k);.0;F;[;[; I";T;!0;'@);(I"def get_query(params={});T;)T;*I"def get_query params={} query = Auth.as_bot do ## why is this a wagn_bot thing? can't deny search content?? query_content = params.delete(:query) || raw_content #warn "get_query #{name}, #{query_content}, #{params.inspect}" raise("Error in card '#{self.name}':can't run search with empty content") if query_content.empty? String === query_content ? JSON.parse( query_content ) : query_content end query.symbolize_keys!.merge! params.symbolize_keys if default_limit = query.delete(:default_limit) and !query[:limit] query[:limit] = default_limit end query[:context] ||= (cardname.junction? ? cardname.left_name : cardname) query end;T;+T;I@);JIC;[o;S ;T0;UI"Card::Set;T;V@);;;'@;W@;X;Y;I@);KIC;[;I@);LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@ )i;F;;r;;;;;[;{;IC;" ;T;@);.0;F;[;[; I";T;!0;'@&;I" Card::Set::Type::SearchType;F;+T;X;Y;I@';LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@'i;F;;;;;;;[;{;IC;" ;T;@';.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Set;F;+To;7;IC;[;I@);JIC;[o;S ;T0;UI"Card::Set;T;V@);;;'@;W@;X;Y;I@);KIC;[;I@);LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"0tmpsets/set/mod007-05_standard/type/date.rb;Ti;F;: Date;;;;;[;{;IC;" ;T;@);.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Date;F;+To;7;IC;[o;7;IC;[o; ; F; ;,;;;I"BCard::Set::Type::File::SelectedAction#select_action_by_params;F;[[I" params;T0;[[I"0tmpsets/set/mod007-05_standard/type/file.rb;Ti ;F;;v;;;[;{;IC;" ;T;@);.0;F;[;[; I";T;!0;'@);(I"'def select_action_by_params params;T;)T;*I"def select_action_by_params params # skip action table lookups for current revision rev_id = params[:rev_id] super unless rev_id && rev_id == last_content_action_id end;T;+To; ; F; ;,;;;I"ACard::Set::Type::File::SelectedAction#last_content_action_id;F;[;[[@)i;F;;;;;[;{;IC;" ;T;@);.0;F;[;[; I";T;!0;'@);(I"def last_content_action_id;T;)T;*I"xdef last_content_action_id # find action id from content (saves lookups) db_content.to_s.split(/[\/\.]/)[1] end;T;+T;I@);JIC;[;I@);KIC;[;I@);LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@)i ;F;:SelectedAction;;;;;[;{;IC;" ;T;@);.0;F;[;[; I";T;!0;'@);I"*Card::Set::Type::File::SelectedAction;F;+T;I@);JIC;[o;S ;T0;UI"Card::Set;T;V@);;;'@;W@;X;Y;I@);KIC;[o;S ;T0;U0;V0;;w;'@);W@);X;Y;I@);LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"0tmpsets/set/mod007-05_standard/type/file.rb;Ti;F;;;;;;;[;{;IC;" ;T;@);.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::File;F;+To;7;IC;[o; ; F; ;,;;;I"$Card::Set::Type::Scss#diff_args;F;[;[[I"0tmpsets/set/mod004-03_machines/type/scss.rb;Ti [I"0tmpsets/set/mod004-03_machines/type/scss.rb;Ti ;F;;q;;;[;{;IC;" ;T;@);.0;F;[;[; I";T;!0;'@);(I"def diff_args;T;)T;*I")def diff_args {:format=>:text} end;T;+T;I@);JIC;[o;S ;T0;UI"Card::Set;T;V@);;;'@;W@;X;Y;I@);KIC;[o;S ;T0;UI"Type::Css;T;V@);;b;'@&;W@&;X;Y;I@);LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@)i;F;: Scss;;;;;[;{;IC;" ;T;@);.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Scss;F;+To;7;IC;[o; ; F; ;,;;;I" Card::Set::Type::User#email;F;[;[[I"0tmpsets/set/mod007-05_standard/type/user.rb;Ti [I"0tmpsets/set/mod007-05_standard/type/user.rb;Ti ;F;: email;;;[;{;IC;")Returns the value of attribute email ;T;@*;.0;F;[;[; I")Returns the value of attribute email;T;!0;'@*;(I"def email;T;*I"def email @email end;T;+To; ; F; ;,;;;I"!Card::Set::Type::User#email=;F;[[I" value;T0;[[@#*i [@%*i ;F;: email=;;;[;{;IC;"Sets the attribute email ;T;@.*;.0;F;[;[o;0 ;1I" param;F;2I"-the value to set the attribute email to.;T;I" value;T;30;@.*; I"SSets the attribute email @param value the value to set the attribute email to.;T;!0;'@*;(I"def email=(value);T;*I"+def email=(value) @email = value end;T;+To; ; F; ;,;;;I"!Card::Set::Type::User#follow;F;[[I"follow_name;T0[I" option;TI"'*always';T;[[@#*iE[@%*iP;F;: follow;;;[;{;IC;" ;T;@B*;.0;F;[;[; I";T;!0;'@*;(I".def follow(follow_name, option='*always');T;)T;*I";def follow follow_name, option = '*always' if (card = Card.fetch(follow_name)) && (set_card = card.default_follow_set_card) if (follow_rule = Card.fetch(set_card.follow_rule_name(name), :new=>{})) follow_rule.drop_item "*never" follow_rule.add_item option follow_rule.save! end end end;T;+T;I@*;JIC;[o;S ;T0;UI"Card::Set;T;V@*;;;'@;W@;X;Y;I@*;KIC;[o;S ;T0;U0;V0;: Basic;'@&;Wo;7;IC;[;I@Z*;JIC;[o;S ;T0;UI"Card::Set;T;V@Z*;;;'@;W@;X;Y;I@Z*;KIC;[;I@Z*;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"1tmpsets/set/mod007-05_standard/type/basic.rb;Ti;F;;|;;;;;[;{;IC;" ;T;@Z*;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Basic;F;+T;X;Y;I@*;LIC;M{; IC;M{;NT;,IC;M{;yIC;M{;C@*;D@.*;NT;NT;NT;O{;P[;[[@#*i;F;: User;;;;;[;{;IC;" ;T;@*;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::User;F;+To;7;IC;[;I@~*;JIC;[o;S ;T0;UI"Card::Set;T;V@~*;;;'@;W@;X;Y;I@~*;KIC;[o;S ;T0;U0;V0;;X;'@&;Wo;7;IC;[o; ; F; ;,;;;I"'Card::Set::Type::Pointer#diff_args;F;[;[[I"6tmpsets/set/mod003-02_basic_types/type/pointer.rb;Ti[I"6tmpsets/set/mod003-02_basic_types/type/pointer.rb;Ti;F;;q;;;[;{;IC;" ;T;@*;.0;F;[;[; I";T;!0;'@*;(I"def diff_args;T;)T;*I".def diff_args {:format => :pointer} end;T;+To; ; F; ;,;;;I"(Card::Set::Type::Pointer#item_cards;F;[[I" args;TI"{};T;[[@*i[@*i;F;;;;;[;{;IC;" ;T;@*;.0;F;[;[; I";T;!0;'@*;(I"def item_cards(args={});T;)T;*I"def item_cards args={} if args[:complete] #warn "item_card[#{args.inspect}], :complete" Card::Query.new({:referred_to_by=>name}.merge(args)).run else itype = args[:type] || item_type #warn "item_card[#{inspect}], :complete" item_names(args).map do |name| new_args = itype ? { :type=>itype } : {} Card.fetch name, :new=>new_args end.compact # compact? can't be nil, right? end end;T;+To; ; F; ;,;;;I"(Card::Set::Type::Pointer#item_names;F;[[I" args;TI"{};T;[[@*i[@*i;F;;;;;[;{;IC;" ;T;@*;.0;F;[;[; I";T;!0;'@*;(I"def item_names(args={});T;)T;*I";def item_names args={} context = args[:context] || self.cardname content = args[:content] || self.raw_content content.to_s.split(/\n+/).map do |line| item_name = line.gsub( /\[\[|\]\]/, '').strip if context == :raw item_name else item_name.to_name.to_absolute context end end end;T;+To; ; F; ;,;;;I"&Card::Set::Type::Pointer#item_ids;F;[[I" args;TI"{};T;[[@*i[@*i&;F;: item_ids;;;[;{;IC;" ;T;@*;.0;F;[;[; I";T;!0;'@*;(I"def item_ids(args={});T;)T;*I"cdef item_ids args={} item_names(args).map do |name| Card.fetch_id name end.compact end;T;+To; ; F; ;,;;;I"'Card::Set::Type::Pointer#item_type;F;[;[[@*i [@*i,;F;;;;;[;{;IC;" ;T;@*;.0;F;[;[; I";T;!0;'@*;(I"def item_type;T;)T;*I"def item_type opt = options_rule_card if !opt or opt==self #fixme, need better recursion prevention nil else opt.item_type end end;T;+To; ; F; ;,;;;I"$Card::Set::Type::Pointer#items=;F;[[I" array;T0;[[@*i[@*i5;F;: items=;;;[;{;IC;" ;T;@*;.0;F;[;[; I";T;!0;'@*;(I"def items=(array);T;)T;*I"Rdef items= array self.content='' array.each { |i| self << i } save! end;T;+To; ; F; ;,;;;I" Card::Set::Type::Pointer#<<;F;[[I" item;T0;[[@*i[@*i;;F;:<<;;;[;{;IC;" ;T;@*;.0;F;[;[; I";T;!0;'@*;(I"def <<(item);T;)T;*I"def << item newname = case item when Card ; item.name when Integer ; c = Card[item] and c.name else item end add_item newname end;T;+To; ; F; ;,;;;I"&Card::Set::Type::Pointer#add_item;F;[[I" name;T0;[[@*i#[@*iE;F;;;;;[;{;IC;" ;T;@*;.0;F;[;[; I";T;!0;'@*;(I"def add_item(name);T;)T;*I"def add_item name unless include_item? name self.content="[[#{(item_names << name).reject(&:blank?)*"]]\n[["}]]" end end;T;+To; ; F; ;,;;;I"'Card::Set::Type::Pointer#add_item!;F;[[I" name;T0;[[@*i([@*iJ;F;:add_item!;;;[;{;IC;" ;T;@+;.0;F;[;[; I";T;!0;'@*;(I"def add_item!(name);T;)T;*I"3def add_item! name add_item name save! end;T;+To; ; F; ;,;;;I"'Card::Set::Type::Pointer#drop_item;F;[[I" name;T0;[[@*i-[@*iO;F;;;;;[;{;IC;" ;T;@+;.0;F;[;[; I";T;!0;'@*;(I"def drop_item(name);T;)T;*I"def drop_item name if include_item? name key = name.to_name.key new_names = item_names.reject{ |n| n.to_name.key == key } self.content = new_names.empty? ? '' : "[[#{new_names * "]]\n[["}]]" end end;T;+To; ; F; ;,;;;I"(Card::Set::Type::Pointer#drop_item!;F;[[I" name;T0;[[@*i4[@*iV;F;:drop_item!;;;[;{;IC;" ;T;@(+;.0;F;[;[; I";T;!0;'@*;(I"def drop_item!(name);T;)T;*I"5def drop_item! name drop_item name save! end;T;+To; ; F; ;,;;;I")Card::Set::Type::Pointer#insert_item;F;[[I" index;T0[I" name;T0;[[@*i9[@*i[;F;;;;;[;{;IC;" ;T;@8+;.0;F;[;[; I";T;!0;'@*;(I"!def insert_item(index, name);T;)T;*I"def insert_item index, name new_names = item_names new_names.delete(name) new_names.insert(index,name) self.content = new_names.map { |name| "[[#{name}]]" }.join "\n" end;T;+To; ; F; ;,;;;I"*Card::Set::Type::Pointer#insert_item!;F;[[I" index;T0[I" name;T0;[[@*i?[@*ib;F;:insert_item!;;;[;{;IC;" ;T;@J+;.0;F;[;[; I";T;!0;'@*;(I""def insert_item!(index, name);T;)T;*I"Gdef insert_item! index, name insert_item index, name save! end;T;+To; ; F; ;,;;;I"/Card::Set::Type::Pointer#options_rule_card;F;[;[[@*iE[@*ig;F;; ;;;[;{;IC;" ;T;@\+;.0;F;[;[; I";T;!0;'@*;(I"def options_rule_card;T;)T;*I"8def options_rule_card self.rule_card :options end;T;+To; ; F; ;,;;;I"*Card::Set::Type::Pointer#option_names;F;[;[[@*iI[@*ik;F;:option_names;;;[;{;IC;" ;T;@j+;.0;F;[;[; I";T;!0;'@*;(I"def option_names;T;)T;*I"&def option_names result_cards = if oc = options_rule_card oc.item_names :default_limit=>50, :context=>name else Card.search :sort=>'name', :limit=>50, :return=>:name end if selected_options = item_names result_cards = result_cards | selected_options end result_cards end;T;+To; ; F; ;,;;;I"*Card::Set::Type::Pointer#option_cards;F;[;[[@*iU[@*iz;F;; ;;;[;{;IC;" ;T;@x+;.0;F;[;[; I";T;!0;'@*;(I"def option_cards;T;)T;*I"Ydef option_cards result_cards = if oc = options_rule_card oc.item_cards :default_limit=>50, :context=>name else Card.search :sort=>'alpha', :limit=>50 end if selected_options = item_names selected_options.each do |item| result_cards.push Card.fetch(item,:new=>{}) end result_cards.uniq! end result_cards end;T;+T;I@*;JIC;[o;S ;T0;UI"Card::Set;T;V@*;;;'@;W@;X;Y;I@*;KIC;[;I@*;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@*i;F;;X;;;;;[;{;IC;" ;T;@*;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Pointer;F;+T;X;Yo;S ;T0;U0;V0;;Z;'@;W@&;X;Yo;S ;T0;U0;V0;;<;'@;W@$;X;Y;I@~*;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"0tmpsets/set/mod004-03_machines/type/skin.rb;Ti;F;: Skin;;;;;[;{;IC;" ;T;@~*;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Skin;F;+To;7;IC;[;I@+;JIC;[o;S ;T0;UI"Card::Set;T;V@+;;;'@;W@;X;Y;I@+;KIC;[o;S ;T0;UI"File::SelectedAction;T;V@+;;w;'@);W@);X;Y;I@+;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"1tmpsets/set/mod007-05_standard/type/image.rb;Ti;F;: Image;;;;;[;{;IC;" ;T;@+;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Image;F;+T@Z*o;7;IC;[;I@+;JIC;[o;S ;T0;UI"Card::Set;T;V@+;;;'@;W@;X;Y;I@+;KIC;[;I@+;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod007-05_standard/type/toggle.rb;Ti;F;: Toggle;;;;;[;{;IC;" ;T;@+;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Toggle;F;+To;7;IC;[o; ; F; ;,;;;I"'Card::Set::Type::Signup#has_token?;F;[;[[I"2tmpsets/set/mod007-05_standard/type/signup.rb;Tie[I"2tmpsets/set/mod007-05_standard/type/signup.rb;Ti{;F;:has_token?;;;[;{;IC;" ;T;@+;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@+; I";T;!0;'@+;(I"def has_token?;T;)T;*I"9def has_token? @env_token = Env.params[:token] end;T;+To; ; F; ;,;;;I">Card::Set::Type::Signup#signed_in_as_me_without_password?;F;[;[[@+i[@+i;F;:&signed_in_as_me_without_password?;;;[;{;IC;" ;T;@+;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@+; I";T;!0;'@+;(I"*def signed_in_as_me_without_password?;T;)T;*I"rdef signed_in_as_me_without_password? Auth.signed_in? && Auth.current_id==id && account.password.blank? end;T;+T;I@+;JIC;[o;S ;T0;UI"Card::Set;T;V@+;;;'@;W@;X;Y;I@+;KIC;[;I@+;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@+i;F;: Signup;;;;;[;{;IC;" ;T;@+;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Signup;F;+To;7;IC;[;I@,;JIC;[o;S ;T0;UI"Card::Set;T;V@,;;;'@;W@;X;Y;I@,;KIC;[;I@,;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod007-05_standard/type/phrase.rb;Ti;F;: Phrase;;;;;[;{;IC;" ;T;@,;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Phrase;F;+To;7;IC;[o; ; F; ;,;;;I"*Card::Set::Type::Number#valid_number?;F;[[I" string;T0;[[I"2tmpsets/set/mod007-05_standard/type/number.rb;Ti[I"2tmpsets/set/mod007-05_standard/type/number.rb;Ti;F;:valid_number?;;;[;{;IC;" ;T;@(,;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@(,; I";T;!0;'@&,;(I"def valid_number?(string);T;)T;*I"def valid_number?( string ) valid = true begin Kernel.Float( string ) rescue ArgumentError, TypeError valid = false end valid end;T;+T;I@&,;JIC;[o;S ;T0;UI"Card::Set;T;V@&,;;;'@;W@;X;Y;I@&,;KIC;[;I@&,;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@/,i;F;: Number;;;;;[;{;IC;" ;T;@&,;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Number;F;+To;7;IC;[o; ; F; ;,;;;I"&Card::Set::Type::Html#clean_html?;F;[;[[I"3tmpsets/set/mod003-02_basic_types/type/html.rb;Ti [I"3tmpsets/set/mod003-02_basic_types/type/html.rb;Ti;T;;];;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/02_basic_types/set/type/html.rb ~~~~~~~~~~~ ;T;@S,;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@S,; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/02_basic_types/set/type/html.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@Q,;(I"def clean_html?;T;)T;*I" def clean_html? false end;T;+To; ; F; ;,;;;I"$Card::Set::Type::Html#diff_args;F;[;[[@Z,i [@X,i ;F;;q;;;[;{;IC;" ;T;@i,;.0;F;[;[; I";T;!0;'@Q,;(I"def diff_args;T;)T;*I"'def diff_args {:format=>:raw} end;T;+T;I@Q,;JIC;[o;S ;T0;UI"Card::Set;T;V@Q,;;;'@;W@;X;Y;I@Q,;KIC;[;I@Q,;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Z,i;F;: Html;;;;;[;{;IC;" ;T;@Q,;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Html;F;+To;7;IC;[o; ; F; ; ;;;I"*Card::Set::Type::Setting.member_names;F;[;[[I"3tmpsets/set/mod005-04_settings/type/setting.rb;Ti [I"3tmpsets/set/mod005-04_settings/type/setting.rb;Ti ;F;:member_names;;;[;{;IC;" ;T;@,;.0;F;[;[; I";T;!0;'@,;(I"def member_names;T;)T;*I"def self.member_names @@member_names ||= begin Card.search( :type_id=>SettingID, :return=>'key' ).inject({}) do |hash, card_key| hash[card_key] = true hash end end end;T;+T;I@,;JIC;[o;S ;T0;UI"Card::Set;T;V@,;;;'@;W@;X;Y;I@,;KIC;[;I@,;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@,i;F;: Setting;;;;;[;{;IC;" ;T;@,;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Setting;F;+To;7;IC;[o; ; F; ;,;;;I"&Card::Set::Type::Session#history?;F;[;[[I"3tmpsets/set/mod007-05_standard/type/session.rb;Ti [I"3tmpsets/set/mod007-05_standard/type/session.rb;Ti ;F;;^;;;[;{;IC;" ;T;@,;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@,; I";T;!0;'@,;(I"def history?;T;)T;*I"def history? false end;T;+To; ; F; ;,;;;I")Card::Set::Type::Session#followable?;F;[;[[@,i[@,i;F;;R;;;[;{;IC;" ;T;@,;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@,; I";T;!0;'@,;(I"def followable?;T;)T;*I" def followable? false end;T;+To; ; F; ;,;;;I"%Card::Set::Type::Session#content;F;[;[[@,i[@,i;F;;W;;;[;{;IC;" ;T;@,;.0;F;[;[; I";T;!0;'@,;(I"def content;T;)T;*I"'def content Env.session[key] end;T;+T;I@,;JIC;[o;S ;T0;UI"Card::Set;T;V@,;;;'@;W@;X;Y;I@,;KIC;[o;S ;T0;U0;V0;;X;'@&;W@*;X;Y;I@,;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@,i;F;: Session;;;;;[;{;IC;" ;T;@,;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Session;F;+To;7;IC;[ o; ; F; ;,;;;I"+Card::Set::Type::Cardtype#follow_label;F;[;[[I"4tmpsets/set/mod007-05_standard/type/cardtype.rb;Ti:[I"4tmpsets/set/mod007-05_standard/type/cardtype.rb;Ti<;F;;$;;;[;{;IC;" ;T;@,;.0;F;[;[; I";T;!0;'@,;(I"def follow_label;T;)T;*I"@def follow_label default_follow_set_card.follow_label end;T;+To; ; F; ;,;;;I"+Card::Set::Type::Cardtype#followed_by?;F;[[I" user_id;TI"nil;T;[[@,i>[@-i@;F;;);;;[;{;IC;" ;T;@ -;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@ -; I";T;!0;'@,;(I""def followed_by?(user_id=nil);T;)T;*I"bdef followed_by? user_id = nil default_follow_set_card.all_members_followed_by? user_id end;T;+To; ; F; ;,;;;I"6Card::Set::Type::Cardtype#default_follow_set_card;F;[;[[@,iB[@-iD;F;;-;;;[;{;IC;" ;T;@ -;.0;F;[;[; I";T;!0;'@,;(I" def default_follow_set_card;T;)T;*I"Bdef default_follow_set_card Card.fetch("#{name}+*type") end;T;+To; ; F; ;,;;;I"3Card::Set::Type::Cardtype#cards_of_type_exist?;F;[;[[@,iG[@-iI;F;:cards_of_type_exist?;;;[;{;IC;" ;T;@.-;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@.-; I";T;!0;'@,;(I"def cards_of_type_exist?;T;)T;*I"edef cards_of_type_exist? !new_card? and Auth.as_bot { Card.count_by_wql :type_id=>id } > 0 end;T;+T;I@,;JIC;[o;S ;T0;UI"Card::Set;T;V@,;;;'@;W@;X;Y;I@,;KIC;[o;S ;T0;U0;V0;;|;'@&;W@Z*;X;Y;I@,;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@,i;F;: Cardtype;;;;;[;{;IC;" ;T;@,;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::Cardtype;F;+T@*o;7;IC;[ o; ; F; ;,;;;I"/Card::Set::Type::EmailTemplate#clean_html?;F;[;[[I"7tmpsets/set/mod006-05_email/type/email_template.rb;Ti [I"7tmpsets/set/mod006-05_email/type/email_template.rb;Ti ;T;;];;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_email/set/type/email_template.rb ~~~~~~~~~~~ ;T;@V-;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@V-; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_email/set/type/email_template.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@T-;(I"def clean_html?;T;)T;*I" def clean_html? false end;T;+To; ; F; ;,;;;I"+Card::Set::Type::EmailTemplate#deliver;F;[[I" args;TI"{};T;[[@]-i [@[-i;F;: deliver;;;[;{;IC;" ;T;@l-;.0;F;[;[; I";T;!0;'@T-;(I"def deliver(args={});T;)T;*I"def deliver args={} begin mail = format.render_mail(args) mail.deliver rescue Net::SMTPError => exception errors.add :exception, exception.message end end;T;+To; ; F; ;,;;;I"7Card::Set::Type::EmailTemplate#process_email_field;F;[[I" field;T0[I" config;T0[I" args;T0;[[@]-i[@[-i;F;:process_email_field;;;[;{;IC;" ;T;@}-;.0;F;[;[; I";T;!0;'@T-;(I"1def process_email_field(field, config, args);T;)T;*I"|def process_email_field field, config, args config[field] = if args[field] args[field] elsif field_card = fetch(:trait=>field) # configuration can be anything visible to configurer user = ( args[:follower] and Card.fetch(args[:follower]) ) || field_card.updater Auth.as( user ) do yield(field_card) end else '' end end;T;+To; ; F; ;,;;;I"9Card::Set::Type::EmailTemplate#process_message_field;F;[ [I" field;T0[I" config;T0[I" args;T0[I" format;T0[I"special_args;TI"nil;T;[[@]-i%[@[-i&;F;:process_message_field;;;[;{;IC;" ;T;@-;.0;F;[;[; I";T;!0;'@T-;(I"Mdef process_message_field(field, config, args, format, special_args=nil);T;)T;*I"5def process_message_field field, config, args, format, special_args=nil process_email_field( field, config, args ) do |field_card| content_args = args.clone content_args.merge! special_args if special_args field_card.contextual_content args[:context], { :format=>format }, content_args end end;T;+To; ; F; ;,;;;I"0Card::Set::Type::EmailTemplate#email_config;F;[[I" args;TI"{};T;[[@]-i-[@[-i.;F;:email_config;;;[;{;IC;" ;T;@-;.0;F;[;[; I";T;!0;'@T-;(I"def email_config(args={});T;)T;*I"def email_config args={} config = {} args[:context] ||= self [:to, :from, :cc, :bcc].each do |field_name| process_email_field( field_name, config, args ) do |field_card| field_card.process_email_addresses args[:context], {:format=>'email_text'}, args end end process_email_field( :attach, config, args ) do |field_card| field_card.extended_item_contents args[:context] end process_message_field :subject, config, args, 'email_text', :content_opts=>{ :chunk_list=>:inclusion_only } process_message_field :text_message, config, args, 'email_text' process_message_field :html_message, config, args, 'email_html' config[:html_message] = Card::Mailer.layout config[:html_message] if config[:html_message].present? from_name, from_email = (config[:from] =~ /(.*)\<(.*)>/) ? [$1.strip, $2] : [nil, config[:from]] if default_from=Card::Mailer.default[:from] config[:from] = from_email ? %["#{from_name || from_email}" <#{default_from}>] : default_from config[:reply_to] ||= config[:from] elsif config[:from].blank? config[:from] = Card[Card::WagnBotID].account.email end config.select {|k,v| v.present? } end;T;+T;I@T-;JIC;[o;S ;T0;UI"Card::Set;T;V@T-;;;'@;W@;X;Y;I@T-;KIC;[;I@T-;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@]-i;F;:EmailTemplate;;;;;[;{;IC;" ;T;@T-;.0;F;[;[; I";T;!0;'@&;I"#Card::Set::Type::EmailTemplate;F;+To;7;IC;[;I@-;JIC;[o;S ;T0;UI"Card::Set;T;V@-;;;'@;W@;X;Y;I@-;KIC;[o;S ;T0;U0;V0;;;'@&;W@Q,;X;Y;I@-;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"7tmpsets/set/mod007-05_standard/type/layout_type.rb;Ti;F;:LayoutType;;;;;[;{;IC;" ;T;@-;.0;F;[;[; I";T;!0;'@&;I" Card::Set::Type::LayoutType;F;+T@)o;7;IC;[o; ; F; ;,;;;I",Card::Set::Type::JavaScript#clean_html?;F;[;[[I"7tmpsets/set/mod004-03_machines/type/java_script.rb;Ti[I"7tmpsets/set/mod004-03_machines/type/java_script.rb;Ti;F;;];;;[;{;IC;" ;T;@-;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@-; I";T;!0;'@-;(I"def clean_html?;T;)T;*I" def clean_html? false end;T;+To; ; F; ;,;;;I"*Card::Set::Type::JavaScript#diff_args;F;[;[[@-i*[@-i+;F;;q;;;[;{;IC;" ;T;@-;.0;F;[;[; I";T;!0;'@-;(I"def diff_args;T;)T;*I"*def diff_args {:format=>:text} end;T;+T;I@-;JIC;[o;S ;T0;UI"Card::Set;T;V@-;;;'@;W@;X;Y;I@-;KIC;[o;S ;T0;U0;V0;;Z;'@;W@&;X;Yo;S ;T0;U0;V0;;<;'@;W@$;X;Y;I@-;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@-i;F;:JavaScript;;;;;[;{;IC;" ;T;@-;.0;F;[;[; I";T;!0;'@&;I" Card::Set::Type::JavaScript;F;+To;7;IC;[o; ; F; ;,;;;I"1Card::Set::Type::CoffeeScript#compile_coffee;F;[[I" script;T0;[[I"9tmpsets/set/mod004-03_machines/type/coffee_script.rb;Ti[I"9tmpsets/set/mod004-03_machines/type/coffee_script.rb;Ti;F;:compile_coffee;;;[;{;IC;" ;T;@.;.0;F;[;[; I";T;!0;'@.;(I"def compile_coffee(script);T;)T;*I"Qdef compile_coffee script ::CoffeeScript.compile script rescue =>e e end;T;+To; ; F; ;,;;;I".Card::Set::Type::CoffeeScript#clean_html?;F;[;[[@%.i[@'.i;F;;];;;[;{;IC;" ;T;@0.;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@0.; I";T;!0;'@.;(I"def clean_html?;T;)T;*I" def clean_html? false end;T;+To; ; F; ;,;;;I",Card::Set::Type::CoffeeScript#diff_args;F;[;[[@%.iB[@'.iC;F;;q;;;[;{;IC;" ;T;@C.;.0;F;[;[; I";T;!0;'@.;(I"def diff_args;T;)T;*I"*def diff_args {:format=>:text} end;T;+T;I@.;JIC;[o;S ;T0;UI"Card::Set;T;V@.;;;'@;W@;X;Y;I@.;KIC;[o;S ;T0;U0;V0;;Z;'@;W@&;X;Yo;S ;T0;U0;V0;;<;'@;W@$;X;Y;I@.;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@%.i;F;:CoffeeScript;;;;;[;{;IC;" ;T;@.;.0;F;[;[; I";T;!0;'@&;I""Card::Set::Type::CoffeeScript;F;+To;7;IC;[;I@e.;JIC;[o;S ;T0;UI"Card::Set;T;V@e.;;;'@;W@;X;Y;I@e.;KIC;[;I@e.;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"9tmpsets/set/mod003-02_basic_types/type/plain_text.rb;Ti;F;:PlainText;;;;;[;{;IC;" ;T;@e.;.0;F;[;[; I";T;!0;'@&;I"Card::Set::Type::PlainText;F;+T;I@&;JIC;[;I@&;KIC;[;I@&;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@&i[@'i[@'i[@)i[@)i[@)i[@#*i[@+i[@+i[@g*i[@+i[@+i[@,i[@/,i[@Z,i[@,i[@,i[@,i[@*i[@]-i[@-i[@ )i[@-i[@%.i[@r.i;F;;;;;;;[;{;IC;" ;T;@&;.0;F;[;[; I";T;!0;'@;I"Card::Set::Type;F;+T;W@*;X;Y;I@&;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@&i;F;:Followers;;;;;[;{;IC;" ;T;@&;.0;F;[;[; I";T;!0;'@ ;I" Card::Set::Right::Followers;F;+To;7;IC;[o; ; F; ;,;;;I")Card::Set::Right::Following#virtual?;F;[;[[I"3tmpsets/set/mod006-05_email/right/following.rb;Ti [I"3tmpsets/set/mod006-05_email/right/following.rb;Ti ;T;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_email/set/right/following.rb ~~~~~~~~~~~ ;T;@.;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@.; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_email/set/right/following.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@.;(I"def virtual?;T;)T;*I"def virtual?; true end;T;+T;I@.;JIC;[o;S ;T0;UI"Card::Set;T;V@.;;;'@;W@;X;Y;I@.;KIC;[;I@.;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@.i;F;:Following;;;;;[;{;IC;" ;T;@.;.0;F;[;[; I";T;!0;'@ ;I" Card::Set::Right::Following;F;+To;7;IC;[;I@.;JIC;[o;S ;T0;UI"Card::Set;T;V@.;;;'@;W@;X;Y;I@.;KIC;[o;S ;T0;UI"Abstract::Permission;T;V@.;;;'@!;W@#;X;Y;I@.;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"3tmpsets/set/mod005-04_settings/right/create.rb;Ti;F;: Create;;;;;[;{;IC;" ;T;@.;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Create;F;+To;7;IC;[;I@.;JIC;[o;S ;T0;UI"Card::Set;T;V@.;;;'@;W@;X;Y;I@.;KIC;[o;S ;T0;UI"Abstract::Permission;T;V@.;;;'@!;W@#;X;Y;I@.;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"3tmpsets/set/mod005-04_settings/right/delete.rb;Ti;F;: Delete;;;;;[;{;IC;" ;T;@.;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Delete;F;+To;7;IC;[;I@/;JIC;[o;S ;T0;UI"Card::Set;T;V@/;;;'@;W@;X;Y;I@/;KIC;[o;S ;T0;U0;V0;;<;'@;W@$;X;Y;I@/;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"3tmpsets/set/mod005-04_settings/right/script.rb;Ti;F;: Script;;;;;[;{;IC;" ;T;@/;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Script;F;+To;7;IC;[o; ; F; ;,;;;I"*Card::Set::Right::Status#ok_to_update;F;[;[[I"3tmpsets/set/mod007-05_standard/right/status.rb;Ti [I"3tmpsets/set/mod007-05_standard/right/status.rb;Ti ;F;;;;;[;{;IC;" ;T;@ /;.0;F;[;[; I";T;!0;'@/;(I"def ok_to_update;T;)T;*I"def ok_to_update if is_own_account? && !Auth.always_ok? deny_because you_cant('change the status of your own account') else super end end;T;+T;I@/;JIC;[o;S ;T0;UI"Card::Set;T;V@/;;;'@;W@;X;Y;I@/;KIC;[o;S ;T0;UI"All::Permissions::Accounts;T;V@/;;;'@;W@;X;Y;I@/;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@%/i;F;: Status;;;;;[;{;IC;" ;T;@/;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Status;F;+To;7;IC;[;I@D/;JIC;[o;S ;T0;UI"Card::Set;T;V@D/;;;'@;W@;X;Y;I@D/;KIC;[o;S ;T0;UI"Abstract::Permission;T;V@D/;;;'@!;W@#;X;Y;I@D/;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"3tmpsets/set/mod005-04_settings/right/update.rb;Ti;F;: Update;;;;;[;{;IC;" ;T;@D/;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Update;F;+To;7;IC;[;I@[/;JIC;[o;S ;T0;UI"Card::Set;T;V@[/;;;'@;W@;X;Y;I@[/;KIC;[o;S ;T0;UI"Abstract::Permission;T;V@[/;;;'@!;W@#;X;Y;I@[/;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"4tmpsets/set/mod005-04_settings/right/comment.rb;Ti;F;;;;;;;[;{;IC;" ;T;@[/;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Comment;F;+To;7;IC;[;I@r/;JIC;[o;S ;T0;UI"Card::Set;T;V@r/;;;'@;W@;X;Y;I@r/;KIC;[;I@r/;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"4tmpsets/set/mod005-04_settings/right/default.rb;Ti;F;: Default;;;;;[;{;IC;" ;T;@r/;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Default;F;+To;7;IC;[o; ; F; ;,;;;I"&Card::Set::Right::Account#active?;F;[;[[I"4tmpsets/set/mod007-05_standard/right/account.rb;Ti[I"4tmpsets/set/mod007-05_standard/right/account.rb;Ti;F;: active?;;;[;{;IC;" ;T;@/;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@/; I";T;!0;'@/;(I"def active?;T;)T;*I"*def active? ; status=='active' end;T;+To; ; F; ;,;;;I"'Card::Set::Right::Account#blocked?;F;[;[[@/i[@/i;F;: blocked?;;;[;{;IC;" ;T;@/;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@/; I";T;!0;'@/;(I"def blocked?;T;)T;*I"*def blocked? ; status=='blocked' end;T;+To; ; F; ;,;;;I"(Card::Set::Right::Account#built_in?;F;[;[[@/i[@/i;F;:built_in?;;;[;{;IC;" ;T;@/;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@/; I";T;!0;'@/;(I"def built_in?;T;)T;*I"*def built_in? ; status=='system' end;T;+To; ; F; ;,;;;I"'Card::Set::Right::Account#pending?;F;[;[[@/i[@/i;F;: pending?;;;[;{;IC;" ;T;@/;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@/; I";T;!0;'@/;(I"def pending?;T;)T;*I"*def pending? ; status=='pending' end;T;+To; ; F; ;,;;;I"4Card::Set::Right::Account#authenticate_by_token;F;[[I"val;T0;[[@/i;F;:authenticate_by_token;;;[;{;IC;" ;T;@/;.0;F;[;[; I";T;!0;'@/;(I""def authenticate_by_token val;T;)T;*I"def authenticate_by_token val tcard = token_card or return :token_not_found token == val or return :incorrect_token tcard.updated_at > Card.config.token_expiry.ago or return :token_expired # > means "after" left and left.accountable? or return :illegal_account #(overkill?) Auth.as_bot { tcard.delete! } left.id end;T;+To; ; F; ;,;;;I"*Card::Set::Right::Account#confirm_ok?;F;[;[[@/i\;F;:confirm_ok?;;;[;{;IC;" ;T;@/;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@/; I";T;!0;'@/;(I"def confirm_ok?;T;)T;*I"[def confirm_ok? Card.new( :type_id=>Card.default_accounted_type_id ).ok? :create end;T;+To; ; F; ;,;;;I"9Card::Set::Right::Account#edit_password_success_args;F;[;[[@/iw[@/iv;F;:edit_password_success_args;;;[;{;IC;" ;T;@/;.0;F;[;[; I";T;!0;'@/;(I"#def edit_password_success_args;T;)T;*I"def edit_password_success_args { :id=>left.name, :view=>:related, :related=>{ :name=>"+#{Card[:account].name}", :view=>'edit' } } end;T;+To; ; F; ;,;;;I"/Card::Set::Right::Account#has_reset_token?;F;[;[[@/i;F;:has_reset_token?;;;[;{;IC;" ;T;@0;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@0; I";T;!0;'@/;(I"def has_reset_token?;T;)T;*I"Edef has_reset_token? @env_token = Env.params[:reset_token] end;T;+To; ; F; ;,;;;I")Card::Set::Right::Account#ok_to_read;F;[;[[@/i[@/i;F;;;;;[;{;IC;" ;T;@0;.0;F;[;[; I";T;!0;'@/;(I"def ok_to_read;T;)T;*I"8def ok_to_read is_own_account? ? true : super end;T;+To; ; F; ;,;;;I"/Card::Set::Right::Account#changes_visible?;F;[[I"act;T0;[[@/i;F;:changes_visible?;;;[;{;IC;" ;T;@&0;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@&0; I";T;!0;'@/;(I"def changes_visible?(act);T;)T;*I"def changes_visible? act act.relevant_actions_for(act.card).each do |action| return true if action.card.ok? :read end return false end;T;+To; ; F; ;,;;;I"1Card::Set::Right::Account#send_change_notice;F;[[I"act;T0[I"followed_set;T0[I"follow_option;T0;[[@/i;F;:send_change_notice;;;[;{;IC;" ;T;@:0;.0;F;[;[; I";T;!0;'@/;(I"=def send_change_notice(act, followed_set, follow_option);T;)T;*I"pdef send_change_notice act, followed_set, follow_option if changes_visible?(act) Auth.as(left.id) do Card[:follower_notification_email].deliver( :context => act.card, :to => email, :follower => left.name, :followed_set => followed_set, :follow_option => follow_option ) end end end;T;+To; ; F; ;,;;;I".Card::Set::Right::Account#validate_token!;F;[[I"test_token;T0;[[@/i;F;:validate_token!;;;[;{;IC;" ;T;@M0;.0;F;[;[; I";T;!0;'@/;(I"#def validate_token! test_token;T;)T;*I"}def validate_token! test_token tcard = token_card tcard.validate! test_token copy_errors tcard errors.empty? end;T;+To; ; F; ;,;;;I".Card::Set::Right::Account#reset_password?;F;[;[[@/i~;F;:reset_password?;;;[;{;IC;" ;T;@\0;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@\0; I";T;!0;'@/;(I"def reset_password?;T;)T;*I"udef reset_password? @env_token = Env.params[:token] @env_token && Env.params[:event] == 'reset_password' end;T;+T;I@/;JIC;[o;S ;T0;UI"Card::Set;T;V@/;;;'@;W@;X;Y;I@/;KIC;[o;S ;T0;UI"All::Permissions::Accounts;T;V@/;;;'@;W@;X;Y;I@/;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@/i;F;;;;;;;[;{;IC;" ;T;@/;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Account;F;+To;7;IC;[o; ; F; ;,;;;I"*Card::Set::Right::Password#ok_to_read;F;[;[[I"5tmpsets/set/mod007-05_standard/right/password.rb;Ti+[I"5tmpsets/set/mod007-05_standard/right/password.rb;Ti4;F;;;;;[;{;IC;" ;T;@0;.0;F;[;[; I";T;!0;'@0;(I"def ok_to_read;T;)T;*I"8def ok_to_read is_own_account? ? true : super end;T;+T;I@0;JIC;[o;S ;T0;UI"Card::Set;T;V@0;;;'@;W@;X;Y;I@0;KIC;[o;S ;T0;UI"All::Permissions::Accounts;T;V@0;;;'@;W@;X;Y;I@0;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@0i;F;: Password;;;;;[;{;IC;" ;T;@0;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::Password;F;+To;7;IC;[;I@0;JIC;[o;S ;T0;UI"Card::Set;T;V@0;;;'@;W@;X;Y;I@0;KIC;[;I@0;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"5tmpsets/set/mod005-04_settings/right/add_help.rb;Ti;F;: AddHelp;;;;;[;{;IC;" ;T;@0;.0;F;[;[; I";T;!0;'@ ;I"Card::Set::Right::AddHelp;F;+To;7;IC;[o; ; F; ;,;;;I".Card::Set::Right::HtmlMessage#clean_html?;F;[;[[I"6tmpsets/set/mod006-05_email/right/html_message.rb;Ti [I"6tmpsets/set/mod006-05_email/right/html_message.rb;Ti;T;;];;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_email/set/right/html_message.rb ~~~~~~~~~~~ ;T;@0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@0; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_email/set/right/html_message.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@0;(I"def clean_html?;T;)T;*I" def clean_html? false end;T;+T;I@0;JIC;[o;S ;T0;UI"Card::Set;T;V@0;;;'@;W@;X;Y;I@0;KIC;[;I@0;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@0i;F;:HtmlMessage;;;;;[;{;IC;" ;T;@0;.0;F;[;[; I";T;!0;'@ ;I""Card::Set::Right::HtmlMessage;F;+To;7;IC;[o; ; F; ;,;;;I"1Card::Set::Right::Structure#structuree_names;F;[;[[I"6tmpsets/set/mod005-04_settings/right/structure.rb;Ti";F;;;;;[;{;IC;" ;T;@0;.0;F;[;[; I";T;!0;'@0;(I"def structuree_names;T;)T;*I"def structuree_names if (wql = structuree_statement) Auth.as_bot do Card::Query.run(wql.merge return: :name) end else [] end end;T;+To; ; F; ;,;;;I"3Card::Set::Right::Structure#update_structurees;F;[[I" args;T0;[[@0i,;F;;;;;[;{;IC;" ;T;@0;.0;F;[;[; I";T;!0;'@0;(I" def update_structurees args;T;)T;*I"def update_structurees args # note that this is not smart about overriding templating rules # for example, if someone were to change the type of a # +*right+*structure rule that was overridden # by a +*type plus right+*structure rule, the override would not be respected. statement = structuree_statement return unless statement Auth.as_bot do statement[:return] = :id Card::Query.run(statement).each_slice(100) do |id_batch| Card.where(id: id_batch).update_all args end end end;T;+To; ; F; ;,;;;I"5Card::Set::Right::Structure#structuree_statement;F;[;[[@0i<;F;:structuree_statement;;;[;{;IC;" ;T;@1;.0;F;[;[; I";T;!0;'@0;(I"def structuree_statement;T;)T;*I"sdef structuree_statement set_card = trunk return unless set_card.type_id == SetID set_card.get_query end;T;+T;I@0;JIC;[o;S ;T0;UI"Card::Set;T;V@0;;;'@;W@;X;Y;I@0;KIC;[;I@0;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"6tmpsets/set/mod005-04_settings/right/structure.rb;Ti;F;:Structure;;;;;[;{;IC;" ;T;@0;.0;F;[;[; I";T;!0;'@ ;I" Card::Set::Right::Structure;F;+To;7;IC;[;I@&1;JIC;[o;S ;T0;UI"Card::Set;T;V@&1;;;'@;W@;X;Y;I@&1;KIC;[;I@&1;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"7tmpsets/set/mod006-05_email/right/follow_fields.rb;Ti;F;:FollowFields;;;;;[;{;IC;" ;T;@&1;.0;F;[;[; I";T;!0;'@ ;I"#Card::Set::Right::FollowFields;F;+To;7;IC;[o; ; F; ;,;;;I">Card::Set::Right::Discussion#show_comment_box_in_related?;F;[;[[I"7tmpsets/set/mod007-05_standard/right/discussion.rb;Ti [I"7tmpsets/set/mod007-05_standard/right/discussion.rb;Ti;T;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/right/discussion.rb ~~~~~~~~~~~ ;T;@=1;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@=1; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/right/discussion.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@;1;(I"%def show_comment_box_in_related?;T;)T;*I"0def show_comment_box_in_related? true end;T;+T;I@;1;JIC;[o;S ;T0;UI"Card::Set;T;V@;1;;;'@;W@;X;Y;I@;1;KIC;[;I@;1;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@D1i;F;:Discussion;;;;;[;{;IC;" ;T;@;1;.0;F;[;[; I";T;!0;'@ ;I"!Card::Set::Right::Discussion;F;+To;7;IC;[;I@e1;JIC;[o;S ;T0;UI"Card::Set;T;V@e1;;;'@;W@;X;Y;I@e1;KIC;[;I@e1;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"9tmpsets/set/mod007-05_standard/right/when_created.rb;Ti;F;:WhenCreated;;;;;[;{;IC;" ;T;@e1;.0;F;[;[; I";T;!0;'@ ;I""Card::Set::Right::WhenCreated;F;+To;7;IC;[o; ; F; ;,;;;I"/Card::Set::Right::MachineInput#followable?;F;[;[[I":tmpsets/set/mod004-03_machines/right/machine_input.rb;Ti [I":tmpsets/set/mod004-03_machines/right/machine_input.rb;Ti;T;;R;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/03_machines/set/right/machine_input.rb ~~~~~~~~~~~ ;T;@|1;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@|1; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/03_machines/set/right/machine_input.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@z1;(I"def followable?;T;)T;*I" def followable? false end;T;+T;I@z1;JIC;[o;S ;T0;UI"Card::Set;T;V@z1;;;'@;W@;X;Y;I@z1;KIC;[;I@z1;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@1i;F;;Z;;;;;[;{;IC;" ;T;@z1;.0;F;[;[; I";T;!0;'@ ;I"#Card::Set::Right::MachineInput;F;+To;7;IC;[o; ; F; ;,;;;I"0Card::Set::Right::MachineOutput#followable?;F;[;[[I";tmpsets/set/mod004-03_machines/right/machine_output.rb;Ti [I";tmpsets/set/mod004-03_machines/right/machine_output.rb;Ti;T;;R;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/03_machines/set/right/machine_output.rb ~~~~~~~~~~~ ;T;@1;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@1; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/03_machines/set/right/machine_output.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@1;(I"def followable?;T;)T;*I" def followable? false end;T;+To; ; F; ;,;;;I"-Card::Set::Right::MachineOutput#history?;F;[;[[@1i ;F;;^;;;[;{;IC;" ;T;@1;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@1; I";T;!0;'@1;(I"def history?;T;)T;*I"def history? false end;T;+T;I@1;JIC;[o;S ;T0;UI"Card::Set;T;V@1;;;'@;W@;X;Y;I@1;KIC;[;I@1;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@1i;F;:MachineOutput;;;;;[;{;IC;" ;T;@1;.0;F;[;[; I";T;!0;'@ ;I"$Card::Set::Right::MachineOutput;F;+To;7;IC;[;I@1;JIC;[o;S ;T0;UI"Card::Set;T;V@1;;;'@;W@;X;Y;I@1;KIC;[;I@1;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"=tmpsets/set/mod007-05_standard/right/when_last_edited.rb;Ti;F;:WhenLastEdited;;;;;[;{;IC;" ;T;@1;.0;F;[;[; I";T;!0;'@ ;I"%Card::Set::Right::WhenLastEdited;F;+T;I@ ;JIC;[;I@ ;KIC;[;I@ ;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[%[@ i[@ i[@ i[@!i[@#!i[@_!i[@t!i[@#i[@#i[@<$i[@$i[@&i[@&i[@.i[@.i[@/i[@/i[@%/i[@S/i[@j/i[@/i[@/i[@0i[@0i[@0i[@1i[@31i[@D1i[@r1i[@1i[@1i[@1i;F;: Right;;;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;I"Card::Set::Right;F;+To;7;IC;[>o;7;IC;[o; ; F; ;,;;;I"!Card::Set::Self::Never#title;F;[;[[I".tmpsets/set/mod006-05_email/self/never.rb;Ti[I".tmpsets/set/mod006-05_email/self/never.rb;Ti;F;: title;;;[;{;IC;" ;T;@(2;.0;F;[;[; I";T;!0;'@&2;(I"def title;T;)T;*I"def title 'Ignoring' end;T;+To; ; F; ;,;;;I"!Card::Set::Self::Never#label;F;[;[[@-2i[@/2i;F;;Z;;;[;{;IC;" ;T;@82;.0;F;[;[; I";T;!0;'@&2;(I"def label;T;)T;*I"def label 'ignore' end;T;+T;I@&2;JIC;[o;S ;T0;UI"Card::Set;T;V@&2;;;'@;W@;X;Y;I@&2;KIC;[o;S ;T0;UI"Card::FollowOption;T;V@&2;:FollowOption;'@;Wo;7;IC;[o;[;[[I"+mod/05_email/lib/card/follow_option.rb;Ti;F;:@@options;;;;;[;{;IC;" ;T;@N2;.0;F;[;[; I";T;!0;'@L2;I""Card::FollowOption::@@options;F;(I"7@@options = { all: [], main: [], restrictive: [] };T;*I"7@@options = { all: [], main: [], restrictive: [] };T;6I"+{ all: [], main: [], restrictive: [] };T;+To; ; F; ; ;;;I" Card::FollowOption.included;F;[[I"host_class;T0;[[@Q2i;F;;;;;[;{;IC;" ;T;@\2;.0;F;[;[o;0 ;1I" private;F;20;0;30;@\2o;0 ;1I" private;F;20;0;30;@\2; I";T;!0;'@L2;(I"def included(host_class);T;)T;*I"Hdef self.included(host_class) host_class.extend ClassMethods end;T;+To; ; F; ; ;;;I"!Card::FollowOption.codenames;F;[[I" type;TI" :all;T;[[@Q2i;F;:codenames;;;[;{;IC;" ;T;@o2;.0;F;[;[; I";T;!0;'@L2;(I"def codenames(type=:all);T;)T;*I"7def self.codenames type=:all @@options[type] end;T;+To; ; F; ; ;;;I"Card::FollowOption.cards;F;[;[[@Q2i;F;: cards;;;[;{;IC;" ;T;@2;.0;F;[;[; I";T;!0;'@L2;(I"def cards;T;)T;*I"Fdef self.cards codenames.map { |codename| Card[codename] } end;T;+To; ; F; ; ;;;I"+Card::FollowOption.restrictive_options;F;[;[[@Q2i;F;:restrictive_options;;;[;{;IC;" ;T;@2;.0;F;[;[; I";T;!0;'@L2;(I"def restrictive_options;T;)T;*I"Cdef self.restrictive_options self.codenames :restrictive end;T;+To; ; F; ; ;;;I"$Card::FollowOption.main_options;F;[;[[@Q2i ;F;:main_options;;;[;{;IC;" ;T;@2;.0;F;[;[; I";T;!0;'@L2;(I"def main_options;T;)T;*I"5def self.main_options self.codenames :main end;T;+To; ; F; ;,;;;I"+Card::FollowOption#restrictive_option?;F;[;[[@Q2i$;F;:restrictive_option?;;;[;{;IC;" ;T;@2;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@2; I";T;!0;'@L2;(I"def restrictive_option?;T;)T;*I"[def restrictive_option? Card::FollowOption.restrictive_options.include? codename end;T;+To; ; F; ;,;;;I"#Card::FollowOption#description;F;[[I" set_card;T0;[[@Q2i(;F;:description;;;[;{;IC;" ;T;@2;.0;F;[;[; I";T;!0;'@L2;(I"def description(set_card);T;)T;*I"9def description set_card set_card.follow_label end;T;+To;7;IC;[ o; ; F; ;,;;;I"=Card::FollowOption::ClassMethods#restrictive_follow_opts;F;[[I" args;T0;[[@Q2i0[I"+mod/05_email/lib/card/follow_option.rb;Ti/;T;:restrictive_follow_opts;;;[;{;IC;"Bargs: position: (starting at 1, default: add to end) ;T;@2;F;[;[; I"Bargs: position: (starting at 1, default: add to end);T;!0;"o;#;$F;%i-;&i.;'@2;(I"&def restrictive_follow_opts(args);T;)T;*I"Idef restrictive_follow_opts args add_option args, :restrictive end;T;+To; ; F; ;,;;;I"1Card::FollowOption::ClassMethods#follow_opts;F;[[I" args;T0;[[@Q2i6[@2i5;T;:follow_opts;;;[;{;IC;"Bargs: position: (starting at 1, default: add to end) ;T;@2;F;[;[; I"Bargs: position: (starting at 1, default: add to end);T;!0;"o;#;$F;%i3;&i4;'@2;(I"def follow_opts(args);T;)T;*I"6def follow_opts args add_option args, :main end;T;+To; ; F; ;,;;;I"1Card::FollowOption::ClassMethods#follow_test;F;[[I" opts;TI"{};T[I" &block;T0;[[@Q2i:[@2i9;F;:follow_test;;;[;{;IC;" ;T;@2;.0;F;[;[; I";T;!0;'@2;(I"%def follow_test(opts={}, &block);T;)T;*I"`def follow_test opts={}, &block Card::FollowOption.test[ get_codename(opts) ] = block end;T;+To; ; F; ;,;;;I"[@2i=;F;:follower_candidate_ids;;;[;{;IC;" ;T;@2;.0;F;[;[; I";T;!0;'@2;(I"0def follower_candidate_ids(opts={}, &block);T;)T;*I"}def follower_candidate_ids opts={}, &block Card::FollowOption.follower_candidate_ids[ get_codename(opts) ] = block end;T;+To; ; F; ;,;;;I"3Card::FollowOption::ClassMethods#insert_option;F;[[I"pos;T0[I" item;T0[I" type;T0;[[@Q2iD[@2iC;F;:insert_option;;;[;{;IC;" ;T;@3;.0;F;[;[; I";T;!0;'@2;(I"'def insert_option(pos, item, type);T;)T;*I"def insert_option pos, item, type if Card::FollowOption.codenames(type)[pos] Card::FollowOption.codenames(type).insert(pos, item) else # If pos > codenames.size in a previous insert then we have a bunch of preceding nils in the array. # Hence, we have to overwrite a nil value if we encounter one and can't use insert. Card::FollowOption.codenames(type)[pos] = item end end;T;+To; ; F; ;,;;;I"0Card::FollowOption::ClassMethods#add_option;F;[[I" opts;T0[I" type;T0[I" &_block;T0;[[@Q2iN[@2iM;F;:add_option;;;[;{;IC;" ;T;@&3;.0;F;[;[; I";T;!0;'@2;(I"(def add_option(opts, type, &_block);T;)T;*I"def add_option opts, type, &block codename = get_codename opts if opts[:position] insert_option opts[:position]-1, codename, type else Card::FollowOption.codenames(type) << codename end Card::FollowOption.codenames(:all) << codename end;T;+To; ; F; ;,;;;I"2Card::FollowOption::ClassMethods#get_codename;F;[[I" opts;T0;[[@Q2iX[@2iW;F;:get_codename;;;[;{;IC;" ;T;@:3;.0;F;[;[; I";T;!0;'@2;(I"def get_codename(opts);T;)T;*I"ddef get_codename opts opts[:codename] || self.name.match(/::(\w+)$/)[1].underscore.to_sym end;T;+T;I@2;JIC;[;I@2;KIC;[;I@2;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Q2i,;F;;;;;;;[;{;IC;" ;T;@2;.0;F;[;[; I";T;!0;'@L2;I"%Card::FollowOption::ClassMethods;F;+To;[;[[@2i ;F;: @@test;;;;;[;{;IC;" ;T;@Z3;.0;F;[;[; I";T;!0;'@L2;I"Card::FollowOption::@@test;F;(I"@@test = {};T;*I"@@test = {};T;6I"{};T;+To;[;[[@2i ;F;:@@follower_candidate_ids;;;;;[;{;IC;" ;T;@g3;.0;F;[;[; I";T;!0;'@L2;I"1Card::FollowOption::@@follower_candidate_ids;F;(I""@@follower_candidate_ids = {};T;*I""@@follower_candidate_ids = {};T;6I"{};T;+T;I@L2;JIC;[;I@L2;KIC;[;I@L2;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Q2i [@2i ;F;;;;;;;[;{;IC;" ;T;@L2;.0;F;[;[; I";T;!0;'@;I"Card::FollowOption;F;+T;X;Y;I@&2;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@-2i;F;: Never;;;;;[;{;IC;" ;T;@&2;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Never;F;+To;7;IC;[;I@3;JIC;[o;S ;T0;UI"Card::Set;T;V@3;;;'@;W@;X;Y;I@3;KIC;[;I@3;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"/tmpsets/set/mod007-05_standard/self/now.rb;Ti;F;:Now;;;;;[;{;IC;" ;T;@3;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Now;F;+To;7;IC;[o; ; F; ;,;;;I""Card::Set::Self::Edited#title;F;[;[[I"/tmpsets/set/mod006-05_email/self/edited.rb;Ti[I"/tmpsets/set/mod006-05_email/self/edited.rb;Ti;F;;;;;[;{;IC;" ;T;@3;.0;F;[;[; I";T;!0;'@3;(I"def title;T;)T;*I"4def title 'Following content you edited' end;T;+To; ; F; ;,;;;I""Card::Set::Self::Edited#label;F;[;[[@3i[@3i;F;;Z;;;[;{;IC;" ;T;@3;.0;F;[;[; I";T;!0;'@3;(I"def label;T;)T;*I")def label "follow if I edited" end;T;+To; ; F; ;,;;;I"(Card::Set::Self::Edited#description;F;[[I" set_card;T0;[[@3i[@3i;F;;;;;[;{;IC;" ;T;@3;.0;F;[;[; I";T;!0;'@3;(I"def description(set_card);T;)T;*I"Gdef description set_card "#{set_card.follow_label} I edited" end;T;+T;I@3;JIC;[o;S ;T0;UI"Card::Set;T;V@3;;;'@;W@;X;Y;I@3;KIC;[o;S ;T0;UI"Card::FollowOption;T;V@3;;;'@;W@L2;X;Y;I@3;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@3i;F;: Edited;;;;;[;{;IC;" ;T;@3;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Edited;F;+To;7;IC;[;I@3;JIC;[o;S ;T0;UI"Card::Setting;T;V@3;;;'@;Wo;7;IC;[o; ; F; ;,;;;I"Card::Setting#codename;F;[;[[I"(mod/04_settings/lib/card/setting.rb;Ti;T;: codename;;;[;{;IC;"Let M = Card::Setting (module) E = Card::Set::Self::Create (module extended with M) O = Card['*create'] (object) accessible in E ;T;@3;F;[;[; I"Let M = Card::Setting (module) E = Card::Set::Self::Create (module extended with M) O = Card['*create'] (object) accessible in E;T;!0;"o;#;$F;%i ;&i;'@3;(I"def codename;T;*I"!def codename @codename end;T;+To; ; F; ;,;;;I"Card::Setting#codename=;F;[[I" value;T0;[[@3i;T;:codename=;;;[;{;IC;"Let M = Card::Setting (module) E = Card::Set::Self::Create (module extended with M) O = Card['*create'] (object) accessible in E ;T;@4;F;[;[; @3;!0;"@3;'@3;(I"def codename=(value);T;*I"1def codename=(value) @codename = value end;T;+To; ; F; ; ;;;I"Card::Setting.extended;F;[[I"host_class;T0;[[@3i[I"(mod/04_settings/lib/card/setting.rb;Ti;F;;u;;;[;{;IC;" ;T;@4;.0;F;[;[o;0 ;1I" private;F;20;0;30;@4o;0 ;1I" private;F;20;0;30;@4; I";T;!0;'@3;(I"def extended(host_class);T;)T;*I"def self.extended(host_class) host_class.mattr_accessor :restricted_to_type, :rule_type_editable # accessible in E and O end;T;+To;[;[[@3i[@4i;F;:@@group_names;;;;;[;{;IC;" ;T;@%4;.0;F;[;[; I";T;!0;'@3;I"!Card::Setting::@@group_names;F;(I"@@group_names = {;T;*I"@@group_names = { templating: 'Templating', permission: 'Permissions', webpage: 'Webpage', pointer: 'Pointer', editing_cue: 'Editing cues', event: 'Events', other: 'Other', config: 'Config' };T;6I"{ templating: 'Templating', permission: 'Permissions', webpage: 'Webpage', pointer: 'Pointer', editing_cue: 'Editing cues', event: 'Events', other: 'Other', config: 'Config' };T;+To;[;[[@3i[@4i";F;: @@groups;;;;;[;{;IC;" ;T;@34;.0;F;[;[; I";T;!0;'@3;I"Card::Setting::@@groups;F;(I"H@@groups = @@group_names.keys.each_with_object({}) do |key, groups|;T;*I"_@@groups = @@group_names.keys.each_with_object({}) do |key, groups| groups[key] = [] end;T;6I"\@@group_names.keys.each_with_object({}) do |key, groups| groups[key] = [] end;T;+To;[;[[@3i [@4i%;F;:@@user_specific;;;;;[;{;IC;" ;T;@A4;.0;F;[;[; I";T;!0;'@3;I"#Card::Setting::@@user_specific;F;(I" @@user_specific = ::Set.new;T;*I" @@user_specific = ::Set.new;T;6I"::Set.new;T;+To; ; F; ; ;;;I"!Card::Setting.user_specific?;F;[[I" codename;T0;[[@3i"[@4i';F;:user_specific?;;;[;{;IC;" ;T;@O4;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@O4; I";T;!0;'@3;(I"!def user_specific?(codename);T;)T;*I"Mdef self.user_specific? codename @@user_specific.include? codename end;T;+To; ; F; ;,;;;I"Card::Setting#to_type_id;F;[[I" type;T0;[[@3i&[@4i+;F;:to_type_id;;;[;{;IC;" ;T;@d4;.0;F;[;[; I";T;!0;'@3;(I"def to_type_id(type);T;)T;*I"Odef to_type_id type type.is_a?(Fixnum) ? type : Card::Codename[type] end;T;+To; ; F; ;,;;;I"Card::Setting#setting_opts;F;[[I" opts;T0;[[@3i/[@4i4;T;:setting_opts;;;[;{;IC;"usage: setting_opts group: :permission | :event | ... position: (starting at 1, default: add to end) rule_type_editable: true | false (default: false) restricted_to_type: | [ , ...] ;T;@t4;F;[;[; I"usage: setting_opts group: :permission | :event | ... position: (starting at 1, default: add to end) rule_type_editable: true | false (default: false) restricted_to_type: | [ , ...];T;!0;"o;#;$F;%i/;&i3;'@3;(I"def setting_opts(opts);T;)T;*I"def setting_opts opts group = opts[:group] || :other @@groups[group] ||= [] if opts[:position] if @@groups[group][opts[:position]-1] @@groups[group].insert(opts[:position]-1, self) else @@groups[group][opts[:position]-1] = self end else @@groups[group] << self end @codename = opts[:codename] || self.name.match(/::(\w+)$/)[1].underscore.to_sym self.rule_type_editable = opts[:rule_type_editable] self.restricted_to_type = opts[:restricted_to_type] ? ::Set.new([opts[:restricted_to_type]].flatten.map{ |cardtype| to_type_id(cardtype) }) : false if opts[:user_specific] @@user_specific << @codename end end;T;+To; ; F; ;,;;;I"&Card::Setting#applies_to_cardtype;F;[[I" type_id;T0;[[@3iD[@4iS;F;:applies_to_cardtype;;;[;{;IC;" ;T;@4;.0;F;[;[; I";T;!0;'@3;(I"%def applies_to_cardtype(type_id);T;)T;*I"odef applies_to_cardtype type_id !self.restricted_to_type or self.restricted_to_type.include? type_id end;T;+To; ; F; ;,;;;I"Card::Setting#set_position;F;[[I" group;T0[I"pos;T0;[[@4iG;F;:set_position;;;[;{;IC;" ;T;@4;.0;F;[;[; I";T;!0;'@3;(I" def set_position group, pos;T;)T;*I"def set_position group, pos if pos if @@groups[group][pos - 1] @@groups[group].insert(pos - 1, self) else @@groups[group][pos - 1] = self end else @@groups[group] << self end end;T;+T;I@3;JIC;[;I@3;KIC;[;I@3;LIC;M{; IC;M{;NT;,IC;M{;IC;M{;C@3;D@4;NT;NT;NT;O{;P[;[[@3i [@4i ;T;;;;;;;[;{;IC;"TUsed to extend setting modules like Card::Set::Self::Create in the settings mod ;T;@3;F;[;[; I"TUsed to extend setting modules like Card::Set::Self::Create in the settings mod;T;!0;"o;#;$F;%i ;&i ;'@;I"Card::Setting;F;+T;X;Yo;S ;T0;UI"Card::Set;T;V@3;;;'@;W@;X;Y;I@3;KIC;[;I@3;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"/tmpsets/set/mod006-05_email/self/follow.rb;Ti;F;;8;;;;;[;{;IC;" ;T;@3;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Follow;F;+To;7;IC;[o;7;IC;[o; ; F; ;,;;;I";Card::Set::Self::All::ClassMethods#delete_old_sessions;F;[;[[I"/tmpsets/set/mod007-05_standard/self/all.rb;Ti;F;:delete_old_sessions;;;[;{;IC;" ;T;@4;.0;F;[;[; I";T;!0;'@4;(I"def delete_old_sessions;T;)T;*I"def delete_old_sessions return unless (months = Env.params[:months].to_i) && months > 0 ActiveRecord::SessionStore::Session.delete_all( ['updated_at < ?', months.months.ago] ) end;T;+T;I@4;JIC;[;I@4;KIC;[;I@4;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@4i;F;;;;;;;[;{;IC;" ;T;@4;.0;F;[;[; I";T;!0;'@4;I"'Card::Set::Self::All::ClassMethods;F;+T;I@4;JIC;[o;S ;T0;UI"Card::Set;T;V@4;;;'@;W@;X;Y;I@4;KIC;[;I@4;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"/tmpsets/set/mod007-05_standard/self/all.rb;Ti;F;;;;;;;[;{;IC;" ;T;@4;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::All;F;+To;7;IC;[o; ; F; ;,;;;I""Card::Set::Self::Always#title;F;[;[[I"/tmpsets/set/mod006-05_email/self/always.rb;Ti[I"/tmpsets/set/mod006-05_email/self/always.rb;Ti;F;;;;;[;{;IC;" ;T;@5;.0;F;[;[; I";T;!0;'@5;(I"def title;T;)T;*I" def title 'Following' end;T;+To; ; F; ;,;;;I""Card::Set::Self::Always#label;F;[;[[@5i[@ 5i;F;;Z;;;[;{;IC;" ;T;@5;.0;F;[;[; I";T;!0;'@5;(I"def label;T;)T;*I"def label 'follow' end;T;+T;I@5;JIC;[o;S ;T0;UI"Card::Set;T;V@5;;;'@;W@;X;Y;I@5;KIC;[o;S ;T0;UI"Card::FollowOption;T;V@5;;;'@;W@L2;X;Y;I@5;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@5i;F;: Always;;;;;[;{;IC;" ;T;@5;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Always;F;+To;7;IC;[;I@45;JIC;[o;S ;T0;UI"Card::Setting;T;V@45;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@45;;;'@;W@;X;Y;I@45;KIC;[;I@45;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"0tmpsets/set/mod005-04_settings/self/help.rb;Ti;F;; ;;;;;[;{;IC;" ;T;@45;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Help;F;+To;7;IC;[;I@K5;JIC;[o;S ;T0;UI"Card::Setting;T;V@K5;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@K5;;;'@;W@;X;Y;I@K5;KIC;[;I@K5;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"0tmpsets/set/mod005-04_settings/self/read.rb;Ti;F;;/;;;;;[;{;IC;" ;T;@K5;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Read;F;+To;7;IC;[;I@b5;JIC;[o;S ;T0;UI"Card::Set;T;V@b5;;;'@;W@;X;Y;I@b5;KIC;[;I@b5;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"0tmpsets/set/mod007-05_standard/self/head.rb;Ti;F;: Head;;;;;[;{;IC;" ;T;@b5;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Head;F;+To;7;IC;[;I@w5;JIC;[o;S ;T0;UI"Card::Set;T;V@w5;;;'@;W@;X;Y;I@w5;KIC;[;I@w5;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"0tmpsets/set/mod007-05_standard/self/foot.rb;Ti;F;: Foot;;;;;[;{;IC;" ;T;@w5;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Foot;F;+To;7;IC;[o; ; F; ;,;;;I"#Card::Set::Self::Created#title;F;[;[[I"0tmpsets/set/mod006-05_email/self/created.rb;Ti[I"0tmpsets/set/mod006-05_email/self/created.rb;Ti;F;;;;;[;{;IC;" ;T;@5;.0;F;[;[; I";T;!0;'@5;(I"def title;T;)T;*I"4def title 'Following content you created' end;T;+To; ; F; ;,;;;I"#Card::Set::Self::Created#label;F;[;[[@5i[@5i;F;;Z;;;[;{;IC;" ;T;@5;.0;F;[;[; I";T;!0;'@5;(I"def label;T;)T;*I"*def label "follow if I created" end;T;+To; ; F; ;,;;;I")Card::Set::Self::Created#description;F;[[I" set_card;T0;[[@5i[@5i;F;;;;;[;{;IC;" ;T;@5;.0;F;[;[; I";T;!0;'@5;(I"def description(set_card);T;)T;*I"Hdef description set_card "#{set_card.follow_label} I created" end;T;+T;I@5;JIC;[o;S ;T0;UI"Card::Set;T;V@5;;;'@;W@;X;Y;I@5;KIC;[o;S ;T0;UI"Card::FollowOption;T;V@5;;;'@;W@L2;X;Y;I@5;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@5i;F;: Created;;;;;[;{;IC;" ;T;@5;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Created;F;+To;7;IC;[;I@5;JIC;[o;S ;T0;UI"Card::Setting;T;V@5;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@5;;;'@;W@;X;Y;I@5;KIC;[;I@5;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"1tmpsets/set/mod005-04_settings/self/style.rb;Ti;F;;W;;;;;[;{;IC;" ;T;@5;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Style;F;+To;7;IC;[;I@5;JIC;[o;S ;T0;UI"Card::Setting;T;V@5;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@5;;;'@;W@;X;Y;I@5;KIC;[;I@5;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"1tmpsets/set/mod005-04_settings/self/input.rb;Ti;F;: Input;;;;;[;{;IC;" ;T;@5;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Input;F;+To;7;IC;[o; ; F; ;,;;;I"4Card::Set::Self::Stats#get_current_memory_usage;F;[;[[I"1tmpsets/set/mod007-05_standard/self/stats.rb;Ti`[I"1tmpsets/set/mod007-05_standard/self/stats.rb;Tia;F;:get_current_memory_usage;;;[;{;IC;" ;T;@6;.0;F;[;[; I";T;!0;'@5;(I"!def get_current_memory_usage;T;)T;*I"Kdef get_current_memory_usage `ps -o rss= -p #{Process.pid}`.to_i end;T;+To; ; F; ;,;;;I"*Card::Set::Self::Stats#profile_memory;F;[[I" &block;T0;[[@6id[@6ie;F;:profile_memory;;;[;{;IC;" ;T;@6;.0;F;[;[; I";T;!0;'@5;(I"def profile_memory(&block);T;)T;*I"def profile_memory(&block) before = get_current_memory_usage file, line, _ = caller[0].split(':') if block_given? instance_eval(&block) (get_current_memory_usage - before) / 1024 else before = 0 (get_current_memory_usage - before) / 1024 end.to_i end;T;+T;I@5;JIC;[o;S ;T0;UI"Card::Set;T;V@5;;;'@;W@;X;Y;I@5;KIC;[;I@5;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@6i;F;;3;;;;;[;{;IC;" ;T;@5;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Stats;F;+To;7;IC;[;I@26;JIC;[o;S ;T0;UI"Card::Setting;T;V@26;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@26;;;'@;W@;X;Y;I@26;KIC;[;I@26;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod005-04_settings/self/create.rb;Ti;F;;;;;;;[;{;IC;" ;T;@26;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Create;F;+To;7;IC;[;I@I6;JIC;[o;S ;T0;UI"Card::Setting;T;V@I6;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@I6;;;'@;W@;X;Y;I@I6;KIC;[;I@I6;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod005-04_settings/self/delete.rb;Ti;F;;;;;;;[;{;IC;" ;T;@I6;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Delete;F;+To;7;IC;[;I@`6;JIC;[o;S ;T0;UI"Card::Setting;T;V@`6;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@`6;;;'@;W@;X;Y;I@`6;KIC;[;I@`6;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod005-04_settings/self/layout.rb;Ti;F;: Layout;;;;;[;{;IC;" ;T;@`6;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Layout;F;+To;7;IC;[;I@w6;JIC;[o;S ;T0;UI"Card::Setting;T;V@w6;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@w6;;;'@;W@;X;Y;I@w6;KIC;[;I@w6;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod005-04_settings/self/script.rb;Ti;F;;;;;;;[;{;IC;" ;T;@w6;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Script;F;+To;7;IC;[;I@6;JIC;[o;S ;T0;UI"Card::Setting;T;V@6;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@6;;;'@;W@;X;Y;I@6;KIC;[;I@6;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod005-04_settings/self/thanks.rb;Ti;F;: Thanks;;;;;[;{;IC;" ;T;@6;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Thanks;F;+To;7;IC;[;I@6;JIC;[o;S ;T0;UI"Card::Setting;T;V@6;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@6;;;'@;W@;X;Y;I@6;KIC;[;I@6;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod005-04_settings/self/update.rb;Ti;F;;;;;;;[;{;IC;" ;T;@6;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Update;F;+To;7;IC;[;I@6;JIC;[o;S ;T0;UI"Card::Set;T;V@6;;;'@;W@;X;Y;I@6;KIC;[;I@6;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod007-05_standard/self/alerts.rb;Ti;F;: Alerts;;;;;[;{;IC;" ;T;@6;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Alerts;F;+To;7;IC;[;I@6;JIC;[o;S ;T0;UI"Card::Set;T;V@6;;;'@;W@;X;Y;I@6;KIC;[;I@6;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod007-05_standard/self/navbox.rb;Ti;F;: Navbox;;;;;[;{;IC;" ;T;@6;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Navbox;F;+To;7;IC;[;I@6;JIC;[o;S ;T0;UI"Card::Set;T;V@6;;;'@;W@;X;Y;I@6;KIC;[;I@6;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod007-05_standard/self/recent.rb;Ti;F;: Recent;;;;;[;{;IC;" ;T;@6;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Recent;F;+To;7;IC;[;I@6;JIC;[o;S ;T0;UI"Card::Set;T;V@6;;;'@;W@;X;Y;I@6;KIC;[;I@6;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod007-05_standard/self/search.rb;Ti;F;: Search;;;;;[;{;IC;" ;T;@6;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Search;F;+To;7;IC;[;I@7;JIC;[o;S ;T0;UI"Card::Set;T;V@7;;;'@;W@;X;Y;I@7;KIC;[;I@7;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"2tmpsets/set/mod007-05_standard/self/signin.rb;Ti;F;: Signin;;;;;[;{;IC;" ;T;@7;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Signin;F;+To;7;IC;[;I@%7;JIC;[o;S ;T0;UI"Card::Set;T;V@%7;;;'@;W@;X;Y;I@%7;KIC;[;I@%7;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"3tmpsets/set/mod007-05_standard/self/version.rb;Ti;F;: Version;;;;;[;{;IC;" ;T;@%7;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Version;F;+To;7;IC;[;I@:7;JIC;[o;S ;T0;UI"Card::Setting;T;V@:7;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@:7;;;'@;W@;X;Y;I@:7;KIC;[;I@:7;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"3tmpsets/set/mod005-04_settings/self/options.rb;Ti;F;: Options;;;;;[;{;IC;" ;T;@:7;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Options;F;+To;7;IC;[;I@Q7;JIC;[o;S ;T0;UI"Card::Setting;T;V@Q7;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@Q7;;;'@;W@;X;Y;I@Q7;KIC;[;I@Q7;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"3tmpsets/set/mod005-04_settings/self/default.rb;Ti;F;;;;;;;[;{;IC;" ;T;@Q7;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Default;F;+To;7;IC;[;I@h7;JIC;[o;S ;T0;UI"Card::Setting;T;V@h7;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@h7;;;'@;W@;X;Y;I@h7;KIC;[;I@h7;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"3tmpsets/set/mod005-04_settings/self/captcha.rb;Ti;F;: Captcha;;;;;[;{;IC;" ;T;@h7;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Captcha;F;+To;7;IC;[;I@7;JIC;[o;S ;T0;UI"Card::Setting;T;V@7;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@7;;;'@;W@;X;Y;I@7;KIC;[;I@7;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"4tmpsets/set/mod005-04_settings/self/add_help.rb;Ti;F;;;;;;;[;{;IC;" ;T;@7;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::AddHelp;F;+To;7;IC;[;I@7;JIC;[o;S ;T0;UI"Card::Setting;T;V@7;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@7;;;'@;W@;X;Y;I@7;KIC;[;I@7;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"4tmpsets/set/mod005-04_settings/self/autoname.rb;Ti;F;: Autoname;;;;;[;{;IC;" ;T;@7;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Autoname;F;+To;7;IC;[;I@7;JIC;[o;S ;T0;UI"Card::Setting;T;V@7;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@7;;;'@;W@;X;Y;I@7;KIC;[;I@7;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"5tmpsets/set/mod005-04_settings/self/on_create.rb;Ti;F;: OnCreate;;;;;[;{;IC;" ;T;@7;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::OnCreate;F;+To;7;IC;[;I@7;JIC;[o;S ;T0;UI"Card::Setting;T;V@7;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@7;;;'@;W@;X;Y;I@7;KIC;[;I@7;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"5tmpsets/set/mod005-04_settings/self/structure.rb;Ti;F;;;;;;;[;{;IC;" ;T;@7;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::Structure;F;+To;7;IC;[;I@7;JIC;[o;S ;T0;UI"Card::Setting;T;V@7;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@7;;;'@;W@;X;Y;I@7;KIC;[;I@7;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"5tmpsets/set/mod005-04_settings/self/on_delete.rb;Ti;F;: OnDelete;;;;;[;{;IC;" ;T;@7;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::OnDelete;F;+To;7;IC;[;I@7;JIC;[o;S ;T0;UI"Card::Setting;T;V@7;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@7;;;'@;W@;X;Y;I@7;KIC;[;I@7;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"5tmpsets/set/mod005-04_settings/self/on_update.rb;Ti;F;: OnUpdate;;;;;[;{;IC;" ;T;@7;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::OnUpdate;F;+To;7;IC;[;I@ 8;JIC;[o;S ;T0;UI"Card::Set;T;V@ 8;;;'@;W@;X;Y;I@ 8;KIC;[;I@ 8;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"6tmpsets/set/mod004-03_machines/self/script_ace.rb;Ti;F;:ScriptAce;;;;;[;{;IC;" ;T;@ 8;.0;F;[;[; I";T;!0;'@$2;I"Card::Set::Self::ScriptAce;F;+To;7;IC;[;I@8;JIC;[o;S ;T0;UI"Card::Set;T;V@8;;;'@;W@;X;Y;I@8;KIC;[;I@8;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"7tmpsets/set/mod004-03_machines/self/style_cards.rb;Ti;F;:StyleCards;;;;;[;{;IC;" ;T;@8;.0;F;[;[; I";T;!0;'@$2;I" Card::Set::Self::StyleCards;F;+To;7;IC;[;I@38;JIC;[o;S ;T0;UI"Card::Set;T;V@38;;;'@;W@;X;Y;I@38;KIC;[;I@38;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"7tmpsets/set/mod004-03_machines/self/script_slot.rb;Ti;F;:ScriptSlot;;;;;[;{;IC;" ;T;@38;.0;F;[;[; I";T;!0;'@$2;I" Card::Set::Self::ScriptSlot;F;+To;7;IC;[;I@H8;JIC;[o;S ;T0;UI"Card::Setting;T;V@H8;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@H8;;;'@;W@;X;Y;I@H8;KIC;[;I@H8;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"7tmpsets/set/mod005-04_settings/self/accountable.rb;Ti;F;:Accountable;;;;;[;{;IC;" ;T;@H8;.0;F;[;[; I";T;!0;'@$2;I"!Card::Set::Self::Accountable;F;+To;7;IC;[;I@_8;JIC;[o;S ;T0;UI"Card::Set;T;V@_8;;;'@;W@;X;Y;I@_8;KIC;[;I@_8;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"8tmpsets/set/mod006-05_email/self/follow_defaults.rb;Ti;F;:FollowDefaults;;;;;[;{;IC;" ;T;@_8;.0;F;[;[; I";T;!0;'@$2;I"$Card::Set::Self::FollowDefaults;F;+To;7;IC;[;I@t8;JIC;[o;S ;T0;UI"Card::Set;T;V@t8;;;'@;W@;X;Y;I@t8;KIC;[;I@t8;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"9tmpsets/set/mod007-05_standard/self/account_links.rb;Ti;F;:AccountLinks;;;;;[;{;IC;" ;T;@t8;.0;F;[;[; I";T;!0;'@$2;I""Card::Set::Self::AccountLinks;F;+To;7;IC;[;I@8;JIC;[o;S ;T0;UI"Card::Set;T;V@8;;;'@;W@;X;Y;I@8;KIC;[;I@8;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"9tmpsets/set/mod004-03_machines/self/script_jquery.rb;Ti;F;:ScriptJquery;;;;;[;{;IC;" ;T;@8;.0;F;[;[; I";T;!0;'@$2;I""Card::Set::Self::ScriptJquery;F;+To;7;IC;[;I@8;JIC;[o;S ;T0;UI"Card::Set;T;V@8;;;'@;W@;X;Y;I@8;KIC;[;I@8;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"9tmpsets/set/mod008-06_bootstrap/self/smartmenu_js.rb;Ti;F;:SmartmenuJs;;;;;[;{;IC;" ;T;@8;.0;F;[;[; I";T;!0;'@$2;I"!Card::Set::Self::SmartmenuJs;F;+To;7;IC;[;I@8;JIC;[o;S ;T0;UI"Card::Set;T;V@8;;;'@;W@;X;Y;I@8;KIC;[;I@8;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"9tmpsets/set/mod008-06_bootstrap/self/bootstrap_js.rb;Ti;F;:BootstrapJs;;;;;[;{;IC;" ;T;@8;.0;F;[;[; I";T;!0;'@$2;I"!Card::Set::Self::BootstrapJs;F;+To;7;IC;[;I@8;JIC;[o;S ;T0;UI"Card::Setting;T;V@8;;;'@;W@3;X;Yo;S ;T0;UI"Card::Set;T;V@8;;;'@;W@;X;Y;I@8;KIC;[;I@8;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"9tmpsets/set/mod005-04_settings/self/options_label.rb;Ti;F;:OptionsLabel;;;;;[;{;IC;" ;T;@8;.0;F;[;[; I";T;!0;'@$2;I""Card::Set::Self::OptionsLabel;F;+To;7;IC;[;I@8;JIC;[o;S ;T0;UI"Card::Set;T;V@8;;;'@;W@;X;Y;I@8;KIC;[;I@8;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I":tmpsets/set/mod004-03_machines/self/script_tinymce.rb;Ti;F;:ScriptTinymce;;;;;[;{;IC;" ;T;@8;.0;F;[;[; I";T;!0;'@$2;I"#Card::Set::Self::ScriptTinymce;F;+To;7;IC;[;I@8;JIC;[o;S ;T0;UI"Card::Set;T;V@8;;;'@;W@;X;Y;I@8;KIC;[;I@8;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I":tmpsets/set/mod008-06_bootstrap/self/smartmenu_css.rb;Ti;F;:SmartmenuCss;;;;;[;{;IC;" ;T;@8;.0;F;[;[; I";T;!0;'@$2;I""Card::Set::Self::SmartmenuCss;F;+To;7;IC;[o; ; F; ;,;;;I"0Card::Set::Self::RecentSettings#followable?;F;[;[[I";tmpsets/set/mod005-04_settings/self/recent_settings.rb;Ti [I";tmpsets/set/mod005-04_settings/self/recent_settings.rb;Ti;T;;R;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/04_settings/set/self/recent_settings.rb ~~~~~~~~~~~ ;T;@ 9;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@ 9; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/04_settings/set/self/recent_settings.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i;&i;'@ 9;(I"def followable?;T;)T;*I" def followable? false end;T;+T;I@ 9;JIC;[o;S ;T0;UI"Card::Set;T;V@ 9;;;'@;W@;X;Y;I@ 9;KIC;[;I@ 9;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@9i;F;:RecentSettings;;;;;[;{;IC;" ;T;@ 9;.0;F;[;[; I";T;!0;'@$2;I"$Card::Set::Self::RecentSettings;F;+To;7;IC;[ o; ; F; ;,;;;I",Card::Set::Self::PerformanceLog#log_dir;F;[;[[I";tmpsets/set/mod007-05_standard/self/performance_log.rb;Ti;F;: log_dir;;;[;{;IC;" ;T;@59;.0;F;[;[; I";T;!0;'@39;(I"def log_dir;T;)T;*I"def log_dir dir = File.join File.dirname(Wagn.paths['log'].existent.first), 'performance' Dir.mkdir dir unless Dir.exists? dir dir end;T;+To; ; F; ;,;;;I"-Card::Set::Self::PerformanceLog#log_path;F;[[I" item;T0;[[@:9i;F;: log_path;;;[;{;IC;" ;T;@C9;.0;F;[;[; I";T;!0;'@39;(I"def log_path item;T;)T;*I"ldef log_path item File.join log_dir, "#{item.gsub('/','_').gsub(/[^0-9A-Za-z.\-]/, '_')}.log" end;T;+To; ; F; ;,;;;I"-Card::Set::Self::PerformanceLog#csv_path;F;[;[[@:9i;F;: csv_path;;;[;{;IC;" ;T;@R9;.0;F;[;[; I";T;!0;'@39;(I"def csv_path;T;)T;*I"Sdef csv_path File.join log_dir, "#{Card[:performance_log].codename}.csv" end;T;+To; ; F; ;,;;;I"2Card::Set::Self::PerformanceLog#add_log_entry;F;[[I" request;T0[I" html_log;T0;[[@:9i;F;:add_log_entry;;;[;{;IC;" ;T;@_9;.0;F;[;[; I";T;!0;'@39;(I"(def add_log_entry request, html_log;T;)T;*I"def add_log_entry request, html_log time = DateTime.now.utc.strftime "%Y%m%d%H%M%S" name = "%s+%s %s" % [Card[:performance_log].name, time, request.gsub('/','/') ] if Card.fetch name name += 'a' while Card.fetch name name.next! end end Card::Auth.as_bot do File.open(Card[:performance_log].log_path(name), 'w') {|f| f.puts html_log} Card[:performance_log].add_item! name end end;T;+To; ; F; ;,;;;I"2Card::Set::Self::PerformanceLog#add_csv_entry;F;[[I" page;T0[I"wbench_data;T0[I" runs;T0;[[@:9i&;F;:add_csv_entry;;;[;{;IC;" ;T;@p9;.0;F;[;[; I";T;!0;'@39;(I".def add_csv_entry page, wbench_data, runs;T;)T;*I"-def add_csv_entry page, wbench_data, runs if !File.exists? csv_path File.open(csv_path, 'w') { |f| f.puts "page,render time, dom loading time, connection time"} end browser = wbench_data.browser runs.times do |i| csv_data = [ page, browser['responseEnd'][i] - browser['requestStart'][i], browser['domComplete'][i] - browser['domLoading'][i], # domLoadingTime browser['requestStart'][i], # domLoadingStart ] csv_line = CSV.generate_line(csv_data) File.open(csv_path, 'a') { |f| f.puts csv_line } end end;T;+T;I@39;JIC;[o;S ;T0;UI"Card::Set;T;V@39;;;'@;W@;X;Y;I@39;KIC;[;I@39;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@:9i;F;:PerformanceLog;;;;;[;{;IC;" ;T;@39;.0;F;[;[; I";T;!0;'@$2;I"$Card::Set::Self::PerformanceLog;F;+To;7;IC;[;I@9;JIC;[o;S ;T0;UI"Card::Set;T;V@9;;;'@;W@;X;Y;I@9;KIC;[;I@9;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"tmpsets/set/mod008-06_bootstrap/self/bootswatch_shared.rb;Ti;F;:BootswatchShared;;;;;[;{;IC;" ;T;@9;.0;F;[;[; I";T;!0;'@$2;I"&Card::Set::Self::BootswatchShared;F;+To;7;IC;[;I@9;JIC;[o;S ;T0;UI"Card::Set;T;V@9;;;'@;W@;X;Y;I@9;KIC;[;I@9;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"@tmpsets/set/mod004-03_machines/self/script_jquery_helper.rb;Ti;F;:ScriptJqueryHelper;;;;;[;{;IC;" ;T;@9;.0;F;[;[; I";T;!0;'@$2;I"(Card::Set::Self::ScriptJqueryHelper;F;+To;7;IC;[;I@:;JIC;[o;S ;T0;UI"Card::Set;T;V@:;;;'@;W@;X;Y;I@:;KIC;[;I@:;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"Ftmpsets/set/mod004-03_machines/self/style_bootstrap_compatible.rb;Ti;F;:StyleBootstrapCompatible;;;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@$2;I".Card::Set::Self::StyleBootstrapCompatible;F;+To;7;IC;[;I@:;JIC;[o;S ;T0;UI"Card::Set;T;V@:;;;'@;W@;X;Y;I@:;KIC;[;I@:;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"Ftmpsets/set/mod004-03_machines/self/style_jquery_ui_smoothness.rb;Ti;F;:StyleJqueryUiSmoothness;;;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@$2;I"-Card::Set::Self::StyleJqueryUiSmoothness;F;+To;7;IC;[;I@*:;JIC;[o;S ;T0;UI"Card::Set;T;V@*:;;;'@;W@;X;Y;I@*:;KIC;[;I@*:;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"Ftmpsets/set/mod004-03_machines/self/script_html5shiv_printshiv.rb;Ti;F;:ScriptHtml5shivPrintshiv;;;;;[;{;IC;" ;T;@*:;.0;F;[;[; I";T;!0;'@$2;I".Card::Set::Self::ScriptHtml5shivPrintshiv;F;+T;I@$2;JIC;[;I@$2;KIC;[;I@$2;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[>[@-2i[@3i[@3i[@4i[@4i[@5i[@C5i[@Z5i[@o5i[@5i[@5i[@5i[@5i[@6i[@A6i[@X6i[@o6i[@6i[@6i[@6i[@6i[@6i[@6i[@7i[@7i[@27i[@I7i[@`7i[@w7i[@7i[@7i[@7i[@7i[@7i[@8i[@8i[@+8i[@@8i[@W8i[@l8i[@8i[@8i[@8i[@8i[@8i[@8i[@9i[@9i[@:9i[@9i[@9i[@9i[@9i[@9i[@ :i[@":i[@7:i;F;: Self;;;;;[;{;IC;" ;T;@$2;.0;F;[;[; I";T;!0;'@;I"Card::Set::Self;F;+T@&o;7;IC;[o;7;IC;[o; ; F; ;,;;;I")Card::Set::Rstar::Rules#rule_set_key;F;[;[[I"2tmpsets/set/mod007-05_standard/rstar/rules.rb;Ti?[I"2tmpsets/set/mod007-05_standard/rstar/rules.rb;Ti;F;:rule_set_key;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@:;(I"def rule_set_key;T;)T;*I"-def rule_set_key rule_set_name.key end;T;+To; ; F; ;,;;;I"*Card::Set::Rstar::Rules#rule_set_name;F;[;[[@:iC[@:i;F;:rule_set_name;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@:;(I"def rule_set_name;T;)T;*I"udef rule_set_name if is_user_rule? cardname.trunk_name.trunk_name else cardname.trunk_name end end;T;+To; ; F; ;,;;;I"%Card::Set::Rstar::Rules#rule_set;F;[;[[@:iK[@:i;F;: rule_set;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@:;(I"def rule_set;T;)T;*I"Odef rule_set if is_user_rule? self[0..-3] else trunk end end;T;+To; ; F; ;,;;;I".Card::Set::Rstar::Rules#rule_setting_name;F;[;[[@:iS[@:i%;F;:rule_setting_name;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@:;(I"def rule_setting_name;T;)T;*I"-def rule_setting_name cardname.tag end;T;+To; ; F; ;,;;;I"3Card::Set::Rstar::Rules#rule_user_setting_name;F;[;[[@:iW[@:i);F;:rule_user_setting_name;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@:;(I"def rule_user_setting_name;T;)T;*I"def rule_user_setting_name if is_user_rule? "#{rule_user_name}+#{rule_setting_name}" else rule_setting_name end end;T;+To; ; F; ;,;;;I"+Card::Set::Rstar::Rules#rule_user_name;F;[;[[@:i_[@:i1;F;:rule_user_name;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@:;(I"def rule_user_name;T;)T;*I"Kdef rule_user_name is_user_rule? ? cardname.trunk_name.tag : nil end;T;+To; ; F; ;,;;;I"&Card::Set::Rstar::Rules#rule_user;F;[;[[@:ic[@:i5;F;:rule_user;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@:;(I"def rule_user;T;)T;*I"7def rule_user is_user_rule? ? self[-2] : nil end;T;+To; ; F; ;,;;;I"(Card::Set::Rstar::Rules#set_options;F;[;[[@:ii[@:i:;T;:set_options;;;[;{;IC;"O~~~~~~~~~~ determine the set options to which the user can apply the rule. ;T;@:;F;[;[; I"O~~~~~~~~~~ determine the set options to which the user can apply the rule.;T;!0;"o;#;$F;%i9;&i9;'@:;(I"def set_options;T;)T;*I"def set_options first = new_card? ? 0 : set_prototype.set_names.index{|s| s.to_name.key == rule_set_key} rule_cnt = 0 res = [] fallback_set = nil set_prototype.set_names[first..-1].each do |set_name| if Card.exists?("#{set_name}+#{rule_user_setting_name}") rule_cnt += 1 res << if rule_cnt == 1 [set_name,:current] else fallback_set ||= set_name [set_name,:overwritten] end else res << (rule_cnt < 1 ? [set_name,:enabled] : [set_name,:disabled]) end end # fallback_set = if first > 0 # res[0..(first-1)].find do |set_name| # Card.exists?("#{set_name}+#{rule_user_setting_name}") # end # end # last = res.index{|s| s.to_name.key == cardname.trunk_name.key} || -1 # # note, the -1 can happen with virtual cards because the self set doesn't show up in the set_names. FIXME!! # [res[first..last], fallback_set] # # The broadest set should always be the currently applied rule # (for anything more general, they must explicitly choose to "DELETE" the current one) # the narrowest rule should be the one attached to the set being viewed. So, eg, if you're looking at the "*all plus" set, you shouldn't # have the option to create rules based on arbitrary narrower sets, though narrower sets will always apply to whatever prototype we create return res, fallback_set end;T;+To; ; F; ;,;;;I"*Card::Set::Rstar::Rules#set_prototype;F;[;[[@:i[@:if;F;:set_prototype;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@:;(I"def set_prototype;T;)T;*I"hdef set_prototype if is_user_rule? self[0..-3].prototype else trunk.prototype end end;T;+T;I@:;JIC;[o;S ;T0;UI"Card::Set;T;V@:;;;'@;W@;X;Y;I@:;KIC;[;I@:;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@:i;F;;;;;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@:;I"Card::Set::Rstar::Rules;F;+T;I@:;JIC;[;I@:;KIC;[;I@:;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@:i;F;: Rstar;;;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@;I"Card::Set::Rstar;F;+T@!o;7;IC;[o;7;IC;[o;7;IC;[o; ; F; ;,;;;I"7Card::Set::TypePlusRight::User::Follow#raw_content;F;[;[[I"?tmpsets/set/mod006-05_email/type_plus_right/user/follow.rb;Ti [I"?tmpsets/set/mod006-05_email/type_plus_right/user/follow.rb;Ti ;F;;Y;;;[;{;IC;" ;T;@4;;.0;F;[;[; I";T;!0;'@2;;(I"def raw_content;T;)T;*I"def raw_content @raw_content ||= if left items = if left.type_id == Card::UserID user = left follow_rules = Card.user_rule_cards left.name, 'follow' follow_rules.map {|card| "[[#{card.name}]]" } end.join "\n" else '' end end;T;+To; ; F; ;,;;;I"4Card::Set::TypePlusRight::User::Follow#virtual?;F;[;[[@9;i[@;;i;F;;;;;[;{;IC;" ;T;@D;;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@D;; I";T;!0;'@2;;(I"def virtual?;T;)T;*I"def virtual?; true end;T;+T;I@2;;JIC;[o;S ;T0;UI"Card::Set;T;V@2;;;;'@;W@;X;Y;I@2;;KIC;[o;S ;T0;UI"Card::Set::Type::Pointer;T;V@2;;;X;'@&;W@*;X;Y;I@2;;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@9;i;F;;8;;;;;[;{;IC;" ;T;@2;;.0;F;[;[; I";T;!0;'@0;;I"+Card::Set::TypePlusRight::User::Follow;F;+T;I@0;;JIC;[;I@0;;KIC;[;I@0;;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@9;i;F;;};;;;;[;{;IC;" ;T;@0;;.0;F;[;[; I";T;!0;'@.;;I"#Card::Set::TypePlusRight::User;F;+T;I@.;;JIC;[;I@.;;KIC;[;I@.;;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@9;i;F;:TypePlusRight;;;;;[;{;IC;" ;T;@.;;.0;F;[;[; I";T;!0;'@;I"Card::Set::TypePlusRight;F;+To; ; F; ;,;;;I"( 44;F;[[I"set;T0[I" opts;TI"{};T;[[@aiq;T;:include_set;;;[;{;IC;"Zinclude a set module and all its format modules include_set Type::Basic, except: :css ;T;@;;F;[;[ o;0 ;1I" param;F;20;I"set;T;3[I" Module;T;@;o;0 ;1I" param;F;2I"+choose the formats you want to include;T;I" opts;T;3[I" Hash;T;@;o;m ;1I" option;F;20;I" opts;T;30;no;o ;1I" option;F;2I"include only these formats;T;I" :only;T;3[I" Symbol;TI"Array;T;p0;@;o;m ;1I" option;F;20;I" opts;T;30;no;o ;1I" option;F;2I" don't include these formats;T;I" :except;T;3[I" Symbol;TI"Array;T;p0;@;; I";include a set module and all its format modules @param [Module] set @param [Hash] opts choose the formats you want to include @option opts [Symbol, Array] :only include only these formats @option opts [Symbol, Array] :except don't include these formats @example include_set Type::Basic, except: :css;T;!0;"o;#;$F;%ij;&ip;'@;(I"!def include_set set, opts={};T;)T;*I"def include_set set, opts={} set_type = set.abstract_set? ? :abstract : :nonbase @@modules[set_type][set.shortname].each do |set_mod| include set_mod end include_set_formats set, opts end;T;+To; ; F; ;,;;;I""Card::Set#include_set_formats;F;[[I"set;T0[I" opts;TI"{};T;[[@ai{;T;:include_set_formats;;;[;{;IC;"Linclude a format modules of a set include_set Type::Basic, except: :css ;T;@;;F;[;[ o;0 ;1I" param;F;20;I"set;T;3[I" Module;T;@;o;0 ;1I" param;F;2I"+choose the formats you want to include;T;I" opts;T;3[I" Hash;T;@;o;m ;1I" option;F;20;I" opts;T;30;no;o ;1I" option;F;2I"include only these formats;T;I" :only;T;3[I" Symbol;TI"Array;T;p0;@;o;m ;1I" option;F;20;I" opts;T;30;no;o ;1I" option;F;2I" don't include these formats;T;I" :except;T;3[I" Symbol;TI"Array;T;p0;@;; I"-include a format modules of a set @param [Module] set @param [Hash] opts choose the formats you want to include @option opts [Symbol, Array] :only include only these formats @option opts [Symbol, Array] :except don't include these formats @example include_set Type::Basic, except: :css;T;!0;"o;#;$F;%iy;&i;'@;(I")def include_set_formats set, opts={};T;)T;*I"def include_set_formats set, opts={} each_format set do |format, format_mods| match = format.to_s.match(/::(?[^:]+)Format/) format_sym = match ? match[:format] : :base next unless applicable_format?(format_sym, opts[:except], opts[:only]) format_mods.each do |format_mod| define_on_format format_sym do include format_mod end end end end;T;+To; ; F; ;,;;;I"?eЋ ;F;[[I" method;T0[I" opts;TI"{};T[I" &block;T0;[[@ai;F;:stage_method;;;[;{;IC;" ;T;@;;.0;F;[;[; I";T;!0;'@;(I"-def stage_method method, opts={}, &block;T;)T;*I",def stage_method method, opts={}, &block class_eval do define_method "_#{method}", &block define_method method do |*args| if (error = wrong_stage(opts) || wrong_action(opts[:on])) raise Card::Error, error else send "_#{method}", *args end end end end;T;+To;7;IC;[ o; ; F; ;,;;;I" 7S;F;[ [I" event;T0[I"stage_or_opts;TI"{};T[I" opts;TI"{};T[I" &final;T0;[[I"lib/card/set/event.rb;Ti ;F;;i;;;[;{;IC;" ;T;@<;.0;F;[;[; I";T;!0;'@<;(I"7def event event, stage_or_opts={}, opts={}, &final;T;)T;*I"def event event, stage_or_opts={}, opts={}, &final if stage_or_opts.is_a? Symbol opts[:in] = stage_or_opts else opts = stage_or_opts end process_stage_opts opts Card.define_callbacks event define_event event, opts, &final set_event_callbacks event, opts end;T;+To; ; F; ;,;;;I""Card::Set::Event#define_event;F;[[I" event;T0[I" opts;T0[I" &final;T0;[[@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@>; I";T;!0;'@>;(I"def star?;T;)T;*I".def star? simple? and '*' == s[0,1] end;T;+To; ; F; ;,;;;I"Card::Name#rstar?;F;[;[[@>i[@>i;F;: rstar?;;;[;{;IC;" ;T;@>;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@>; I";T;!0;'@>;(I"def rstar?;T;)T;*I"1def rstar? right and '*' == right[0,1] end;T;+To; ; F; ;,;;;I"Card::Name#trait_name?;F;[[I"*traitlist;T0;[[@>i[@>i;F;:trait_name?;;;[;{;IC;" ;T;@>;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@>; I";T;!0;'@>;(I" def trait_name?(*traitlist);T;)T;*I"def trait_name? *traitlist junction? && begin right_key = right_name.key !!traitlist.find do |codename| card_id = Card::Codename[ codename ] and card = Card.fetch( card_id, skip_modules: true, skip_virtual: true ) and card.key == right_key end end end;T;+To; ; F; ;,;;;I"Card::Name#trait_name;F;[[I" tag_code;T0;[[@>i$[@>i&;F;:trait_name;;;[;{;IC;" ;T;@>;.0;F;[;[; I";T;!0;'@>;(I"def trait_name(tag_code);T;)T;*I"def trait_name tag_code card_id = Card::Codename[ tag_code ] and card = Card.fetch( card_id, skip_modules: true, skip_virtual: true ) and [ self, card.cardname ].to_name end;T;+To; ; F; ;,;;;I"Card::Name#trait;F;[[I" tag_code;T0;[[@>i)[@>i,;F;: trait;;;[;{;IC;" ;T;@?;.0;F;[;[; I";T;!0;'@>;(I"def trait(tag_code);T;)T;*I"def trait tag_code name = trait_name( tag_code ) name ? name.s : ( raise Card::NotFound, "unknown codename: #{tag_code}" ) end;T;+To; ; F; ;,;;;I"Card::Name#code;F;[;[[@>i.[@>i5;F;: code;;;[;{;IC;" ;T;@?;.0;F;[;[; I";T;!0;'@>;(I" def code;T;)T;*I"8def code Card::Codename[ Card.fetch_id self ] end;T;+To; ; F; ;,;;;I"Card::Name#is_a_field_of?;F;[[I"context_name;T0;[[@>i3;F;:is_a_field_of?;;;[;{;IC;" ;T;@?;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@?; I";T;!0;'@>;(I"$def is_a_field_of? context_name;T;)T;*I"hdef is_a_field_of? context_name if context_name.present? # Do I still equal myself after I've been relativised in the context of context_name? relative_name = self.to_show(*context_name.to_name.parts).to_name absolute_name = self.to_absolute_name(context_name) relative_name.key != absolute_name.key else self.s.match /^\s*\+/ end end;T;+To; ; F; ;,;;;I"Card::Name#is_setting?;F;[;[[@>i>;F;:is_setting?;;;[;{;IC;" ;T;@2?;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@2?; I";T;!0;'@>;(I"def is_setting?;T;)T;*I"Adef is_setting? Set::Type::Setting.member_names[ key ] end;T;+To; ; F; ;,;;;I"Card::Name#is_set?;F;[;[[@>iB;F;: is_set?;;;[;{;IC;" ;T;@D?;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@D?; I";T;!0;'@>;(I"def is_set?;T;)T;*I";def is_set? SetPattern.card_keys[ tag_name.key ] end;T;+To;4;[[@>i ;F;:RELATIVE_REGEXP;;;;;[;{;IC;" ;T;@V?;.0;F;[;[; I";T;!0;'@>;I" Card::Name::RELATIVE_REGEXP;F;(I"HRELATIVE_REGEXP = /\b_(left|right|whole|self|user|main|\d+|L*R?)\b/;T;*I"HRELATIVE_REGEXP = /\b_(left|right|whole|self|user|main|\d+|L*R?)\b/;T;6I"6/\b_(left|right|whole|self|user|main|\d+|L*R?)\b/;T;+To; ; F; ;,;;;I"$;F;[[I" tag_name;T0;[[@>i1;F;: field;;;[;{;IC;" ;T;@c?;.0;F;[;[; I";T;!0;'@>;(I"def field tag_name;T;)T;*I"4def field tag_name field_name(tag_name).s end;T;+To; ; F; ;,;;;I"| ;F;[[I" tag_name;T0;[[@>i:;T;:field_name;;;[;{;IC;""returns full name for a field ;T;@r?;F;[;[; I""returns full name for a field;T;!0;"o;#;$F;%i9;&i9;'@>;(I"def field_name tag_name;T;)T;*I"def field_name tag_name case tag_name when Symbol trait_name tag_name else tag_name = tag_name.to_s[1..-1] if tag_name.to_s[0] == '+' [self, tag_name].to_name end end;T;+To; ; F; ;,;;;I"#Card::Name#relative_field_name;F;[[I" tag_name;T0;[[@>iD;F;:relative_field_name;;;[;{;IC;" ;T;@?;.0;F;[;[; I";T;!0;'@>;(I"%def relative_field_name tag_name;T;)T;*I"Tdef relative_field_name tag_name field_name(tag_name).relative_name(self) end;T;+To; ; F; ;,;;;I"Card::Name#relative_name;F;[[I"context_name;T0;[[@>iH;F;;;;;[;{;IC;" ;T;@?;.0;F;[;[; I";T;!0;'@>;(I"#def relative_name context_name;T;)T;*I"Vdef relative_name context_name to_show(*context_name.to_name.parts).to_name end;T;+To; ; F; ;,;;;I"Card::Name#absolute_name;F;[[I"context_name;T0;[[@>iL;F;;;;;[;{;IC;" ;T;@?;.0;F;[;[; I";T;!0;'@>;(I"#def absolute_name context_name;T;)T;*I"Hdef absolute_name context_name to_absolute_name(context_name) end;T;+To; ; F; ;,;;;I"<<<;F;[[I"context_name;T0;[[@>iP;F;:child_of?;;;[;{;IC;" ;T;@?;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@?; I";T;!0;'@>;(I"def child_of? context_name;T;)T;*I"def child_of? context_name if context_name.present? # Do I still equal myself after I've been relativised in the context # of context_name? relative_name(context_name).key != absolute_name(context_name).key else s.match(/^\s*\+/) end end;T;+To; ; F; ;,;;;I" A8;F;[[I"context_name;T0;[[@>iZ;F;:field_of?;;;[;{;IC;" ;T;@?;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@?; I";T;!0;'@>;(I"def field_of? context_name;T;)T;*I"def field_of? context_name if context_name.present? child_of?(context_name) && relative_name(context_name).length == 2 else s.match(/^\s*\+[^+]+$/) end end;T;+To; ; F; ;,;;;I"$ MHM;F;[;[[@>ib;F;: setting?;;;[;{;IC;" ;T;@?;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@?; I";T;!0;'@>;(I"def setting?;T;)T;*I"if;F;: set?;;;[;{;IC;" ;T;@?;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@?; I";T;!0;'@>;(I" def set?;T;)T;*I"6def set? SetPattern.card_keys[tag_name.key] end;T;+To; ; F; ;,;;;I"Card::Set::Type ;F;[;[[@>ij;F;:relative?;;;[;{;IC;" ;T;@?;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@?; I";T;!0;'@>;(I"def relative?;T;)T;*I"Cdef relative? s =~ RELATIVE_REGEXP || starts_with_joint? end;T;+To; ; F; ;,;;;I" 0¾X;F;[;[[@>in;F;:absolute?;;;[;{;IC;" ;T;@ @;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@ @; I";T;!0;'@>;(I"def absolute?;T;)T;*I"#def absolute? !relative? end;T;+To; ; F; ;,;;;I"$ M(;F;[;[[@>ir;F;: stripped;;;[;{;IC;" ;T;@@;.0;F;[;[; I";T;!0;'@>;(I"def stripped;T;)T;*I"2def stripped s.gsub RELATIVE_REGEXP, '' end;T;+To; ; F; ;,;;;I""Card::Name#starts_with_joint?;F;[;[[@>iv;F;:starts_with_joint?;;;[;{;IC;" ;T;@,@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@,@; I";T;!0;'@>;(I"def starts_with_joint?;T;)T;*I",def starts_with_joint? s =~ /^\+/ end;T;+To; ; F; ;,;;;I" 7 \;F;[;[[@>iz;F;: to_sym;;;[;{;IC;" ;T;@>@;.0;F;[;[; I";T;!0;'@>;(I"def to_sym;T;)T;*I"def to_sym s.to_sym end;T;+T;I@>;JIC;[;I@>;KIC;[;I@>;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@>i ;F;;;;;;;[;{;IC;" ;T;@>;.0;F;[;[; I";T;!0;'@;I"Card::Name;F;Io;S ;T0;U0;V0;:SmartName;'@;W0;X; ;+To;7;IC;[ o; ; F; ; ;;;I"Card::Diff.complete;F;[[I"a;T0[I"b;T0[I" opts;TI"{};T;[[I"lib/card/diff.rb;Ti [I"lib/card/diff.rb;Ti ;F;: complete;;;[;{;IC;" ;T;@^@;.0;F;[;[; I";T;!0;'@\@;(I" def complete(a, b, opts={});T;)T;*I"Odef self.complete a, b, opts={} DiffBuilder.new(a, b, opts).complete end;T;+To; ; F; ; ;;;I"Card::Diff.summary;F;[[I"a;T0[I"b;T0[I" opts;TI"{};T;[[@j@i[@l@i;F;: summary;;;[;{;IC;" ;T;@u@;.0;F;[;[; I";T;!0;'@\@;(I"def summary(a, b, opts={});T;)T;*I"Mdef self.summary a, b, opts={} DiffBuilder.new(a, b, opts).summary end;T;+To; ; F; ; ;;;I""Card::Diff.render_added_chunk;F;[[I" text;T0;[[@j@i[@l@i;F;:render_added_chunk;;;[;{;IC;" ;T;@@;.0;F;[;[; I";T;!0;'@\@;(I"!def render_added_chunk(text);T;)T;*I"[def self.render_added_chunk text "#{text}" end;T;+To; ; F; ; ;;;I"$Card::Diff.render_deleted_chunk;F;[[I" text;T0[I" _count;TI" true;T;[[@j@i[@l@i;F;:render_deleted_chunk;;;[;{;IC;" ;T;@@;.0;F;[;[; I";T;!0;'@\@;(I"0def render_deleted_chunk(text, _count=true);T;)T;*I"gdef self.render_deleted_chunk text, count=true "#{text}" end;T;+To; ; F; ; ;;;I"Card::Diff.render_chunk;F;[[I" action;T0[I" text;T0;[[@j@i;F;:render_chunk;;;[;{;IC;" ;T;@@;.0;F;[;[; I";T;!0;'@\@;(I"'def self.render_chunk action, text;T;)T;*I"def self.render_chunk action, text case action when '+' then render_added_chunk text when :added then render_added_chunk text when '-' then render_deleted_chunk text when :deleted then render_deleted_chunk text else text end end;T;+To; ;IC;[ o; ; F; ;,;;;I"$Card::Diff::DiffBuilder#summary;F;[;[[@j@i%;F;;<;;;[;{;IC;"+Returns the value of attribute summary ;T;@@;.0;F;[;[; I"+Returns the value of attribute summary;T;!0;'@@;(I"def summary;T;*I"def summary @summary end;T;+To; ; F; ;,;;;I"%Card::Diff::DiffBuilder#complete;F;[;[[@j@i%;F;;;;;;[;{;IC;",Returns the value of attribute complete ;T;@@;.0;F;[;[; I",Returns the value of attribute complete;T;!0;'@@;(I"def complete;T;*I"!def complete @complete end;T;+To; ; F; ;,;;;I"'Card::Diff::DiffBuilder#initialize;F;[[I"old_version;T0[I"new_version;T0[I" opts;TI"{};T;[[@j@i0;T;;C;;;[;{;IC;";diff options :format => :html|:text|:pointer|:raw :html = maintain html structure, but compare only content :text = remove all html tags; compare plain text :pointer = remove all double square brackets :raw = escape html tags and compare everything summary: {length: , joint: } ;T;@@;F;[;[o;0 ;1I" return;F;2I""a new instance of DiffBuilder;T;0;3[I"DiffBuilder;F;@@; I";diff options :format => :html|:text|:pointer|:raw :html = maintain html structure, but compare only content :text = remove all html tags; compare plain text :pointer = remove all double square brackets :raw = escape html tags and compare everything summary: {length: , joint: };T;!0;"o;#;$F;%i';&i.;'@@;(I"6def initialize(old_version, new_version, opts={});T;)T;*I"=def initialize(old_version, new_version, opts={}) @new_version = new_version @old_version = old_version @lcs_opts = lcs_opts_for_format opts[:format] @lcs_opts[:summary] = opts[:summary] @dels_cnt = 0 @adds_cnt = 0 if not @new_version @complete = '' @summary = '' else lcs_diff end end;T;+To; ; F; ;,;;;I"!Card::Diff::DiffBuilder#red?;F;[;[[@j@i@;F;: red?;;;[;{;IC;" ;T;@@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@@; I";T;!0;'@@;(I" def red?;T;)T;*I"!def red? @dels_cnt > 0 end;T;+To; ; F; ;,;;;I"#Card::Diff::DiffBuilder#green?;F;[;[[@j@iD;F;: green?;;;[;{;IC;" ;T;@A;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@A; I";T;!0;'@@;(I"def green?;T;)T;*I"#def green? @adds_cnt > 0 end;T;+To; ; F; ;,;;;I"0Card::Diff::DiffBuilder#lcs_opts_for_format;F;[[I" format;T0;[[@j@iH;F;:lcs_opts_for_format;;;[;{;IC;" ;T;@A;.0;F;[;[; I";T;!0;'@@;(I"#def lcs_opts_for_format format;T;)T;*I"def lcs_opts_for_format format opts = {} case format when :html opts[:exclude] = /^') end when :pointer opts[:preprocess] = Proc.new do |word| word.gsub('[[','').gsub(']]','') end else #:raw opts[:preprocess] = Proc.new do |word| CGI::escapeHTML(word) end end opts end;T;+To; ; F; ;,;;;I"%Card::Diff::DiffBuilder#lcs_diff;F;[;[[@j@i^;F;: lcs_diff;;;[;{;IC;" ;T;@'A;.0;F;[;[; I";T;!0;'@@;(I"def lcs_diff;T;)T;*I"def lcs_diff @lcs = LCS.new(@old_version, @new_version, @lcs_opts) @summary = @lcs.summary @complete = @lcs.complete @dels_cnt = @lcs.dels_cnt @adds_cnt = @lcs.adds_cnt end;T;+To; ;IC;[o; ; F; ;,;;;I"*Card::Diff::DiffBuilder::LCS#adds_cnt;F;[;[[@j@ih;F;: adds_cnt;;;[;{;IC;",Returns the value of attribute adds_cnt ;T;@6A;.0;F;[;[; I",Returns the value of attribute adds_cnt;T;!0;'@4A;(I"def adds_cnt;T;*I"!def adds_cnt @adds_cnt end;T;+To; ; F; ;,;;;I"*Card::Diff::DiffBuilder::LCS#dels_cnt;F;[;[[@j@ih;F;: dels_cnt;;;[;{;IC;",Returns the value of attribute dels_cnt ;T;@CA;.0;F;[;[; I",Returns the value of attribute dels_cnt;T;!0;'@4A;(I"def dels_cnt;T;*I"!def dels_cnt @dels_cnt end;T;+To; ; F; ;,;;;I",Card::Diff::DiffBuilder::LCS#initialize;F;[ [I" old_text;T0[I" new_text;T0[I" opts;T0[I" summary;TI"nil;T;[[@j@ii;F;;C;;;[;{;IC;" ;T;@PA;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of LCS;T;0;3[I"LCS;F;@PA; I";T;!0;'@4A;(I"9def initialize old_text, new_text, opts, summary=nil;T;)T;*I"Qdef initialize old_text, new_text, opts, summary=nil @reject_pattern = opts[:reject] # regex; remove match completely from diff @exclude_pattern = opts[:exclude] # regex; put back to the result after diff @preprocess = opts[:preprocess] # block; called with every word @postprocess = opts[:postprocess] # block; called with complete diff @adds_cnt = 0 @dels_cnt = 0 @splitters = %w( <[^>]+> \[\[[^\]]+\]\] \{\{[^}]+\}\} \s+ ) @disjunction_pattern = /^\s/ @summary ||= Summary.new opts[:summary] if not old_text list = split_and_preprocess(new_text) if @exclude_pattern list = list.reject{ |word| word.match @exclude_pattern } end text = postprocess list.join @result = added_chunk text @summary.add text else init_diff old_text, new_text run_diff end end;T;+To; ; F; ;,;;;I")Card::Diff::DiffBuilder::LCS#summary;F;[;[[@j@i~;F;;<;;;[;{;IC;" ;T;@kA;.0;F;[;[; I";T;!0;'@4A;(I"def summary;T;)T;*I"&def summary @summary.result end;T;+To; ; F; ;,;;;I"*Card::Diff::DiffBuilder::LCS#complete;F;[;[[@j@i;F;;;;;;[;{;IC;" ;T;@xA;.0;F;[;[; I";T;!0;'@4A;(I"def complete;T;)T;*I"def complete @result end;T;+To; ; F; ;,;;;I"+Card::Diff::DiffBuilder::LCS#init_diff;F;[[I" old_text;T0[I" new_text;T0;[[@j@i;F;:init_diff;;;[;{;IC;" ;T;@A;.0;F;[;[; I";T;!0;'@4A;(I"%def init_diff old_text, new_text;T;)T;*I"ndef init_diff old_text, new_text @adds = [] @dels = [] @result = '' old_words, old_ex = separate_comparables_from_excludees old_text new_words, new_ex = separate_comparables_from_excludees new_text @words = { old: old_words, new: new_words } @excludees = { old: ExcludeeIterator.new(old_ex), new: ExcludeeIterator.new(new_ex) } end;T;+To; ; F; ;,;;;I"*Card::Diff::DiffBuilder::LCS#run_diff;F;[;[[@j@i;F;: run_diff;;;[;{;IC;" ;T;@A;.0;F;[;[; I";T;!0;'@4A;(I"def run_diff;T;)T;*I"def run_diff prev_action = nil ::Diff::LCS.traverse_balanced(@words[:old], @words[:new]) do |word| if prev_action if prev_action != word.action and !(prev_action == '-' and word.action == '!') and !(prev_action == '!' and word.action == '+') # delete and/or add section stops here; write changes to result write_dels write_adds write_excludees # new neutral section starts, we can just write excludees to result else # current word belongs to edit of previous word case word.action when '-' del_old_excludees when '+' add_new_excludees when '!' del_old_excludees add_new_excludees else write_excludees end end else write_excludees end process_word word prev_action = word.action end write_dels write_adds write_excludees @result = postprocess @result end;T;+To; ; F; ;,;;;I"-Card::Diff::DiffBuilder::LCS#added_chunk;F;[[I" text;T0[I" count;TI" true;T;[[@j@i;F;:added_chunk;;;[;{;IC;" ;T;@A;.0;F;[;[; I";T;!0;'@4A;(I"%def added_chunk text, count=true;T;)T;*I"hdef added_chunk text, count=true @adds_cnt += 1 if count Card::Diff.render_added_chunk text end;T;+To; ; F; ;,;;;I"/Card::Diff::DiffBuilder::LCS#deleted_chunk;F;[[I" text;T0[I" count;TI" true;T;[[@j@i;F;:deleted_chunk;;;[;{;IC;" ;T;@A;.0;F;[;[; I";T;!0;'@4A;(I"'def deleted_chunk text, count=true;T;)T;*I"ldef deleted_chunk text, count=true @dels_cnt += 1 if count Card::Diff.render_deleted_chunk text end;T;+To; ; F; ;,;;;I"1Card::Diff::DiffBuilder::LCS#write_unchanged;F;[[I" text;T0;[[@j@i;F;:write_unchanged;;;[;{;IC;" ;T;@A;.0;F;[;[; I";T;!0;'@4A;(I"def write_unchanged text;T;)T;*I"Cdef write_unchanged text @result << text @summary.omit end;T;+To; ; F; ;,;;;I",Card::Diff::DiffBuilder::LCS#write_dels;F;[;[[@j@i;F;:write_dels;;;[;{;IC;" ;T;@A;.0;F;[;[; I";T;!0;'@4A;(I"def write_dels;T;)T;*I"def write_dels if !@dels.empty? @result << deleted_chunk(@dels.join) @summary.delete @dels.join @dels = [] end end;T;+To; ; F; ;,;;;I",Card::Diff::DiffBuilder::LCS#write_adds;F;[;[[@j@i;F;:write_adds;;;[;{;IC;" ;T;@A;.0;F;[;[; I";T;!0;'@4A;(I"def write_adds;T;)T;*I"}def write_adds if !@adds.empty? @result << added_chunk(@adds.join) @summary.add @adds.join @adds = [] end end;T;+To; ; F; ;,;;;I"1Card::Diff::DiffBuilder::LCS#write_excludees;F;[;[[@j@i;F;:write_excludees;;;[;{;IC;" ;T;@A;.0;F;[;[; I";T;!0;'@4A;(I"def write_excludees;T;)T;*I"adef write_excludees while ex = @excludees[:new].next @result << ex[:element] end end;T;+To; ; F; ;,;;;I"3Card::Diff::DiffBuilder::LCS#del_old_excludees;F;[;[[@j@i;F;:del_old_excludees;;;[;{;IC;" ;T;@A;.0;F;[;[; I";T;!0;'@4A;(I"def del_old_excludees;T;)T;*I"def del_old_excludees while ex = @excludees[:old].next if ex[:type] == :disjunction @dels << ex[:element] else write_dels @result << ex[:element] end end end;T;+To; ; F; ;,;;;I"3Card::Diff::DiffBuilder::LCS#add_new_excludees;F;[;[[@j@i;F;:add_new_excludees;;;[;{;IC;" ;T;@ B;.0;F;[;[; I";T;!0;'@4A;(I"def add_new_excludees;T;)T;*I"def add_new_excludees while ex = @excludees[:new].next if ex[:type] == :disjunction @adds << ex[:element] else write_adds @result << ex[:element] end end end;T;+To; ; F; ;,;;;I".Card::Diff::DiffBuilder::LCS#process_word;F;[[I" word;T0;[[@j@i;F;:process_word;;;[;{;IC;" ;T;@B;.0;F;[;[; I";T;!0;'@4A;(I"def process_word word;T;)T;*I"`def process_word word process_element word.old_element, word.new_element, word.action end;T;+To; ; F; ;,;;;I"1Card::Diff::DiffBuilder::LCS#process_element;F;[[I"old_element;T0[I"new_element;T0[I" action;T0;[[@j@i;F;:process_element;;;[;{;IC;" ;T;@&B;.0;F;[;[; I";T;!0;'@4A;(I"9def process_element old_element, new_element, action;T;)T;*I"def process_element old_element, new_element, action case action when '-' @dels << old_element @excludees[:old].word_step when '+' @adds << new_element @excludees[:new].word_step when '!' @dels << old_element @adds << new_element @excludees[:old].word_step @excludees[:new].word_step else write_unchanged new_element @excludees[:new].word_step end end;T;+To; ; F; ;,;;;I"ECard::Diff::DiffBuilder::LCS#separate_comparables_from_excludees;F;[[I" text;T0;[[@j@i;F;:(separate_comparables_from_excludees;;;[;{;IC;" ;T;@9B;.0;F;[;[; I";T;!0;'@4A;(I"1def separate_comparables_from_excludees text;T;)T;*I"adef separate_comparables_from_excludees text # return two arrays, one with all words, one with pairs (index in word list, html_tag) list = split_and_preprocess text if @exclude_pattern list.each_with_index.inject([[],[]]) do |res, pair| element, index = pair if element.match @disjunction_pattern res[1] << {chunk_index: index, element: element, type: :disjunction} elsif element.match @exclude_pattern res[1] << {chunk_index: index, element: element, type: :excludee} else res[0] << element end res end else [list, []] end end;T;+To; ; F; ;,;;;I"6Card::Diff::DiffBuilder::LCS#split_and_preprocess;F;[[I" text;T0;[[@j@i+;F;:split_and_preprocess;;;[;{;IC;" ;T;@HB;.0;F;[;[; I";T;!0;'@4A;(I""def split_and_preprocess text;T;)T;*I"def split_and_preprocess text splitted = split_to_list_of_words(text).select do |s| s.size > 0 and (!@reject_pattern or !s.match @reject_pattern) end @preprocess ? splitted.map {|s| @preprocess.call(s) } : splitted end;T;+To; ; F; ;,;;;I"8Card::Diff::DiffBuilder::LCS#split_to_list_of_words;F;[[I" text;T0;[[@j@i2;F;:split_to_list_of_words;;;[;{;IC;" ;T;@WB;.0;F;[;[; I";T;!0;'@4A;(I"$def split_to_list_of_words text;T;)T;*I"mdef split_to_list_of_words text split_regex = /(#{@splitters.join '|'})/ text.split(split_regex) end;T;+To; ; F; ;,;;;I",Card::Diff::DiffBuilder::LCS#preprocess;F;[[I" text;T0;[[@j@i7;F;:preprocess;;;[;{;IC;" ;T;@fB;.0;F;[;[; I";T;!0;'@4A;(I"def preprocess text;T;)T;*I"^def preprocess text if @preprocess @preprocess.call(text) else text end end;T;+To; ; F; ;,;;;I"-Card::Diff::DiffBuilder::LCS#postprocess;F;[[I" text;T0;[[@j@i?;F;:postprocess;;;[;{;IC;" ;T;@uB;.0;F;[;[; I";T;!0;'@4A;(I"def postprocess text;T;)T;*I"adef postprocess text if @postprocess @postprocess.call(text) else text end end;T;+To; ;IC;[ o; ; F; ;,;;;I"5Card::Diff::DiffBuilder::LCS::Summary#initialize;F;[[I" opts;T0;[[@j@iI;F;;C;;;[;{;IC;" ;T;@B;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of Summary;T;0;3[I" Summary;F;@B; I";T;!0;'@B;(I"def initialize opts;T;)T;*I"def initialize opts opts ||= {} @remaining_chars = opts[:length] || 50 @joint = opts[:joint] || '...' @summary = nil @chunks = [] end;T;+To; ; F; ;,;;;I"1Card::Diff::DiffBuilder::LCS::Summary#result;F;[;[[@j@iR;F;: result;;;[;{;IC;" ;T;@B;.0;F;[;[; I";T;!0;'@B;(I"def result;T;)T;*I"0def result @summary ||= render_chunks end;T;+To; ; F; ;,;;;I".Card::Diff::DiffBuilder::LCS::Summary#add;F;[[I" text;T0;[[@j@iV;F;:add;;;[;{;IC;" ;T;@B;.0;F;[;[; I";T;!0;'@B;(I"def add text;T;)T;*I".def add text add_chunk text, :added end;T;+To; ; F; ;,;;;I"1Card::Diff::DiffBuilder::LCS::Summary#delete;F;[[I" text;T0;[[@j@iZ;F;;;;;[;{;IC;" ;T;@B;.0;F;[;[; I";T;!0;'@B;(I"def delete text;T;)T;*I"3def delete text add_chunk text, :deleted end;T;+To; ; F; ;,;;;I"/Card::Diff::DiffBuilder::LCS::Summary#omit;F;[;[[@j@i^;F;: omit;;;[;{;IC;" ;T;@B;.0;F;[;[; I";T;!0;'@B;(I" def omit;T;)T;*I"rdef omit if @chunks.empty? or @chunks.last[:action] != :ellipsis add_chunk @joint, :ellipsis end end;T;+To; ; F; ;,;;;I"4Card::Diff::DiffBuilder::LCS::Summary#add_chunk;F;[[I" text;T0[I" action;T0;[[@j@if;F;:add_chunk;;;[;{;IC;" ;T;@B;.0;F;[;[; I";T;!0;'@B;(I"def add_chunk text, action;T;)T;*I"def add_chunk text, action if @remaining_chars > 0 @chunks << {action: action, text: text} @remaining_chars -= text.size end end;T;+To; ; F; ;,;;;I"8Card::Diff::DiffBuilder::LCS::Summary#render_chunks;F;[;[[@j@im;F;:render_chunks;;;[;{;IC;" ;T;@B;.0;F;[;[; I";T;!0;'@B;(I"def render_chunks;T;)T;*I"def render_chunks truncate_overlap @chunks.map do |chunk| Card::Diff.render_chunk chunk[:action], chunk[:text] end.join end;T;+To; ; F; ;,;;;I";Card::Diff::DiffBuilder::LCS::Summary#truncate_overlap;F;[;[[@j@it;F;:truncate_overlap;;;[;{;IC;" ;T;@B;.0;F;[;[; I";T;!0;'@B;(I"def truncate_overlap;T;)T;*I"def truncate_overlap if @remaining_chars < 0 if @chunks.last[:action] == :ellipsis @chunks.pop @remaining_chars += @joint.size end index = @chunks.size - 1 while @remaining_chars < @joint.size and index >= 0 if @remaining_chars + @chunks[index][:text].size == @joint.size # d @chunks.pop if index-1 >= 0 if @chunks[index-1][:action] == :added @chunks << {action: :ellipsis, text: @joint} elsif @chunks[index-1][:action] == :deleted @chunks << {action: :added, text: @joint} end end break elsif @remaining_chars + @chunks[index][:text].size > @joint.size @chunks[index][:text] = @chunks[index][:text][0..(@remaining_chars-@joint.size-1)] @chunks[index][:text] += @joint break else @remaining_chars += @chunks[index][:text].size @chunks.delete_at(index) end index -= 1 end end end;T;+T;I@B;JIC;[;I@B;KIC;[;I@B;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@j@iH;F;: Summary;;;;;[;{;IC;" ;T;@B;.0;F;[;[; I";T;!0;'@4A;I"*Card::Diff::DiffBuilder::LCS::Summary;F;Io;S ;T0;U0;V0;;J;'@;W@;X; ;+To; ;IC;[o; ; F; ;,;;;I">Card::Diff::DiffBuilder::LCS::ExcludeeIterator#initialize;F;[[I" list;T0;[[@j@i;F;;C;;;[;{;IC;" ;T;@C;.0;F;[;[o;0 ;1I" return;F;2I"'a new instance of ExcludeeIterator;T;0;3[I"ExcludeeIterator;F;@C; I";T;!0;'@C;(I"def initialize list;T;)T;*I"Kdef initialize list @list = list @index = 0 @chunk_index = 0 end;T;+To; ; F; ;,;;;I"=Card::Diff::DiffBuilder::LCS::ExcludeeIterator#word_step;F;[;[[@j@i;F;:word_step;;;[;{;IC;" ;T;@$C;.0;F;[;[; I";T;!0;'@C;(I"def word_step;T;)T;*I"*def word_step @chunk_index += 1 end;T;+To; ; F; ;,;;;I"8Card::Diff::DiffBuilder::LCS::ExcludeeIterator#next;F;[;[[@j@i;F;: next;;;[;{;IC;" ;T;@1C;.0;F;[;[; I";T;!0;'@C;(I" def next;T;)T;*I"def next if @index < @list.size and @list[@index][:chunk_index] == @chunk_index res = @list[@index] @index += 1 @chunk_index +=1 res end end;T;+T;I@C;JIC;[;I@C;KIC;[;I@C;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@j@i;F;:ExcludeeIterator;;;;;[;{;IC;" ;T;@C;.0;F;[;[; I";T;!0;'@4A;I"3Card::Diff::DiffBuilder::LCS::ExcludeeIterator;F;Io;S ;T0;U0;V0;;J;'@;W@;X; ;+T;I@4A;JIC;[;I@4A;KIC;[;I@4A;LIC;M{; IC;M{;NT;,IC;M{;DIC;M{;C@6A;D0;NT;EIC;M{;C@CA;D0;NT;NT;NT;O{;P[;[[@j@ig;F;:LCS;;;;;[;{;IC;" ;T;@4A;.0;F;[;[; I";T;!0;'@@;I"!Card::Diff::DiffBuilder::LCS;F;Io;S ;T0;U0;V0;;J;'@;W@;X; ;+T;I@@;JIC;[;I@@;KIC;[;I@@;LIC;M{; IC;M{;NT;,IC;M{;<IC;M{;C@@;D0;NT;;IC;M{;C@@;D0;NT;NT;NT;O{;P[;[[@j@i$;F;:DiffBuilder;;;;;[;{;IC;" ;T;@@;.0;F;[;[; I";T;!0;'@\@;I"Card::Diff::DiffBuilder;F;Io;S ;T0;U0;V0;;J;'@;W@;X; ;+T;I@\@;JIC;[;I@\@;KIC;[;I@\@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@j@i;F;: Diff;;;;;[;{;IC;" ;T;@\@;.0;F;[;[; I";T;!0;'o;S ;T0;U0;V0;: Card;'@;W@;X0;I"Card::Diff;Fo;7;IC;['o;[;[[I"lib/card/auth.rb;Ti ;F;:@@as_card;;;;;[;{;IC;" ;T;@C;.0;F;[;[; I";T;!0;'@C;I"Card::Auth::@@as_card;F;(I"9@@as_card = @@as_id = @@current_id = @@current = nil;T;*I"9@@as_card = @@as_id = @@current_id = @@current = nil;T;6I"-@@as_id = @@current_id = @@current = nil;T;+To;4;[[@Ci ;T;:NON_CREATEABLE_TYPES;;;;;[;{;IC;" NEED API ;T;@C;F;[;[; I" NEED API;T;!0;"o;#;$F;%i ;&i ;'@C;I"%Card::Auth::NON_CREATEABLE_TYPES;F;(I"?NON_CREATEABLE_TYPES = %w{ signup setting set } # NEED API;T;*I"4NON_CREATEABLE_TYPES = %w{ signup setting set };T;6I"%w{ signup setting set };T;+To;4;[[@Ci ;F;:NEED_SETUP_KEY;;;;;[;{;IC;" ;T;@C;.0;F;[;[; I";T;!0;'@C;I"Card::Auth::NEED_SETUP_KEY;F;(I""NEED_SETUP_KEY = 'NEED_SETUP';T;*I""NEED_SETUP_KEY = 'NEED_SETUP';T;6I"'NEED_SETUP';T;+To; ; F; ; ;;;I"Card::Auth.authenticate;F;[[I" email;T0[I" password;T0;[[@Ci[I"lib/card/auth.rb;Ti;T;:authenticate;;;[;{;IC;"GAuthenticates a user by their login name and unencrypted password. ;T;@C;F;[;[; I"GAuthenticates a user by their login name and unencrypted password.;T;!0;"o;#;$F;%i;&i;'@C;(I"&def authenticate(email, password);T;)T;*I"def authenticate email, password accounted = Auth[ email ] if accounted and account = accounted.account and account.active? if Card.config.no_authentication or password_authenticated?( account, password.strip ) accounted.id end end end;T;+To; ; F; ; ;;;I"'Card::Auth.password_authenticated?;F;[[I" account;T0[I" password;T0;[[@Ci;F;:password_authenticated?;;;[;{;IC;" ;T;@C;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@C; I";T;!0;'@C;(I"2def password_authenticated? account, password;T;)T;*I"ndef password_authenticated? account, password account.password == encrypt( password, account.salt ) end;T;+To; ; F; ; ;;;I"Card::Auth.encrypt;F;[[I" password;T0[I" salt;T0;[[@Ci#[@CiJ;T;: encrypt;;;[;{;IC;"&Encrypts some data with the salt. ;T;@C;F;[;[; I"&Encrypts some data with the salt.;T;!0;"o;#;$F;%iI;&iI;'@C;(I" def encrypt(password, salt);T;)T;*I"Udef encrypt password, salt Digest::SHA1.hexdigest "#{salt}--#{password}--" end;T;+To; ; F; ; ;;;I"Card::Auth.[];F;[[I" email;T0;[[@Ci([@CiO;T;;9;;;[;{;IC;"find account by email ;T;@C;F;[;[; I"find account by email;T;!0;"o;#;$F;%iN;&iN;'@C;(I"def [](email);T;)T;*I"def [] email Auth.as_bot do Card.search( right_plus: [ {id: Card::AccountID}, {right_plus: [{id: Card::EmailID},{ content: email.strip.downcase }]} ]).first end end;T;+To; ; F; ; ;;;I"Card::Auth.signin;F;[[I"signin_id;T0;[[@Ci1[@CiZ;F;: signin;;;[;{;IC;" ;T;@C;.0;F;[;[; I";T;!0;'@C;(I"def signin(signin_id);T;)T;*I"cdef signin signin_id self.current_id = signin_id session[:user] = signin_id if session end;T;+To; ; F; ; ;;;I"Card::Auth.session;F;[;[[@Ci6[@Ci_;F;;<;;;[;{;IC;" ;T;@D;.0;F;[;[; I";T;!0;'@C;(I"def session;T;)T;*I"*def session Card::Env[:session] end;T;+To; ; F; ; ;;;I"(Card::Auth.set_current_from_session;F;[;[[@Ci:[@Cic;F;:set_current_from_session;;;[;{;IC;" ;T;@D;.0;F;[;[; I";T;!0;'@C;(I"!def set_current_from_session;T;)T;*I"def set_current_from_session self.current_id = if session if card_id=session[:user] and Card.exists? card_id card_id else session[:user] = nil end end current_id end;T;+To; ; F; ; ;;;I"Card::Auth.current_id;F;[;[[@CiF[@Cio;F;:current_id;;;[;{;IC;" ;T;@+D;.0;F;[;[; I";T;!0;'@C;(I"def current_id;T;)T;*I"(#{obj_to_key(value)})" end.join "," when Array obj.map do |value| obj_to_key(value) end.join "," else obj.to_s end end;T;+To; ; F; ; ;;;I"Card::Cache.prepopulate;F;[;[[@Eib[@EiX;F;:prepopulate;;;[;{;IC;" ;T;@zF;.0;F;[;[; I";T;!0;'@E;(I"def prepopulate;T;)T;*I"def prepopulate if @@prepopulating @@rule_cache ||= Card.rule_cache @@read_rule_cache ||= Card.read_rule_cache @@user_ids_cache ||= Card.user_ids_cache @@rule_keys_cache ||= Card.rule_keys_cache Card.cache.write_local 'RULES', @@rule_cache Card.cache.write_local 'READRULES', @@read_rule_cache Card.cache.write_local 'USER_IDS', @@user_ids_cache Card.cache.write_local 'RULE_KEYS', @@rule_keys_cache end end;T;+To; ; F; ;,;;;I"Card::Cache#prefix;F;[;[[@Eis;F;: prefix;;;[;{;IC;"*Returns the value of attribute prefix ;T;@F;.0;F;[;[; I"*Returns the value of attribute prefix;T;!0;'@E;(I"def prefix;T;*I"def prefix @prefix end;T;+To; ; F; ;,;;;I"Card::Cache#store;F;[;[[@Eis;F;; ;;;[;{;IC;")Returns the value of attribute store ;T;@F;.0;F;[;[; I")Returns the value of attribute store;T;!0;'@E;(I"def store;T;*I"def store @store end;T;+To; ; F; ;,;;;I"Card::Cache#klass;F;[;[[@Eis;F;: klass;;;[;{;IC;")Returns the value of attribute klass ;T;@F;.0;F;[;[; I")Returns the value of attribute klass;T;!0;'@E;(I"def klass;T;*I"def klass @klass end;T;+To; ; F; ;,;;;I"Card::Cache#local;F;[;[[@Eit;F;: local;;;[;{;IC;")Returns the value of attribute local ;T;@F;.0;F;[;[; I")Returns the value of attribute local;T;!0;'@E;(I"def local;T;*I"def local @local end;T;+To; ; F; ;,;;;I"Card::Cache#local=;F;[[I" value;T0;[[@Eit;F;: local=;;;[;{;IC;"Sets the attribute local ;T;@F;.0;F;[;[o;0 ;1I" param;F;2I"-the value to set the attribute local to.;T;I" value;T;30;@F; I"SSets the attribute local @param value the value to set the attribute local to.;T;!0;'@E;(I"def local=(value);T;*I"+def local=(value) @local = value end;T;+To; ; F; ;,;;;I"Card::Cache#initialize;F;[[I" opts;TI"{};T;[[@Eiv[@Eih;F;;C;;;[;{;IC;" ;T;@F;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of Cache;T;0;3[I" Cache;F;@F; I";T;!0;'@E;(I"def initialize(opts={});T;)T;*I"def initialize opts={} #warn "new cache #{opts.inspect}" @klass = opts[:class] @store = opts[:store] @local = Hash.new self.system_prefix = opts[:prefix] || self.class.system_prefix(opts[:class]) cache_by_class[klass] = self end;T;+To; ; F; ;,;;;I"Card::Cache#system_prefix=;F;[[I"system_prefix;T0;[[@Ei{;F;:system_prefix=;;;[;{;IC;" ;T;@F;.0;F;[;[; I";T;!0;'@E;(I"%def system_prefix= system_prefix;T;)T;*I"vdef system_prefix= system_prefix @system_prefix = system_prefix if @store.nil? @prefix = system_prefix + self.class.generate_cache_id + "/" else @system_prefix += '/' unless @system_prefix[-1] == '/' @cache_id = @store.fetch(@system_prefix + "cache_id") do self.class.generate_cache_id end @prefix = @system_prefix + @cache_id + "/" end end;T;+To; ; F; ;,;;;I"Card::Cache#read;F;[[I"key;T0;[[@Ei[@Eiu;F;;C;;;[;{;IC;" ;T;@F;.0;F;[;[; I";T;!0;'@E;(I"def read(key);T;)T;*I"def read key if @local.has_key? key read_local key elsif @store write_local key, @store.read(@prefix + key) end end;T;+To; ; F; ;,;;;I"Card::Cache#read_local;F;[[I"key;T0;[[@Ei;F;:read_local;;;[;{;IC;" ;T;@G;.0;F;[;[; I";T;!0;'@E;(I"def read_local key;T;)T;*I")def read_local key @local[key] end;T;+To; ; F; ;,;;;I"Card::Cache#write_variable;F;[[I"key;T0[I" variable;T0[I" value;T0;[[@Ei;F;:write_variable;;;[;{;IC;" ;T;@G;.0;F;[;[; I";T;!0;'@E;(I",def write_variable key, variable, value;T;)T;*I"def write_variable key, variable, value key = @prefix + key if @store and object = @store.read(key) object.instance_variable_set "@#{ variable }", value @store.write key, object end value end;T;+To; ; F; ;,;;;I"Card::Cache#write;F;[[I"key;T0[I" value;T0;[[@Ei[@Eiz;F;;D;;;[;{;IC;" ;T;@&G;.0;F;[;[; I";T;!0;'@E;(I"def write(key, value);T;)T;*I"edef write key, value @store.write(@prefix + key, value) if @store write_local key, value end;T;+To; ; F; ;,;;;I"Card::Cache#write_local;F;[[I"key;T0[I" value;T0;[[@Ei;F;:write_local;;;[;{;IC;" ;T;@8G;.0;F;[;[; I";T;!0;'@E;(I"def write_local key, value;T;)T;*I"9def write_local key, value @local[key] = value end;T;+To; ; F; ;,;;;I"Card::Cache#fetch;F;[[I"key;T0[I" &block;T0;[[@Ei[@Ei;F;;;;;[;{;IC;" ;T;@IG;.0;F;[;[; I";T;!0;'@E;(I"def fetch(key, &block);T;)T;*I"def fetch key, &block fetch_local key do if @store @store.fetch(@prefix + key, &block) else block.call end end end;T;+To; ; F; ;,;;;I"Card::Cache#fetch_local;F;[[I"key;T0;[[@Ei;F;:fetch_local;;;[;{;IC;" ;T;@[G;.0;F;[;[; I";T;!0;'@E;(I"def fetch_local key;T;)T;*I"Gdef fetch_local key read_local key or write_local key, yield end;T;+To; ; F; ;,;;;I"Card::Cache#delete;F;[[I"key;T0;[[@Ei[@Ei;F;;;;;[;{;IC;" ;T;@jG;.0;F;[;[; I";T;!0;'@E;(I"def delete(key);T;)T;*I"Tdef delete key @store.delete(@prefix + key) if @store @local.delete key end;T;+To; ; F; ;,;;;I"Card::Cache#dump;F;[;[[@Ei[@Ei;F;: dump;;;[;{;IC;" ;T;@zG;.0;F;[;[; I";T;!0;'@E;(I" def dump;T;)T;*I"ldef dump p "dumping local...." @local.each do |k, v| p "#{k} --> #{v.inspect[0..30]}" end end;T;+To; ; F; ;,;;;I"Card::Cache#reset;F;[;[[@Ei[@Ei;F;;8;;;[;{;IC;" ;T;@G;.0;F;[;[; I";T;!0;'@E;(I"def reset;T;)T;*I"fdef reset hard=false reset_local @cache_id = self.class.generate_cache_id if @store if hard begin @store.clear rescue => e Rails.logger.debug "Problem clearing cache: #{e.message}" end else @store.write @system_prefix + "cache_id", @cache_id end end @prefix = @system_prefix + @cache_id + "/" end;T;+To; ; F; ;,;;;I"Card::Cache#reset_local;F;[;[[@Ei;F;;;;;[;{;IC;" ;T;@G;.0;F;[;[; I";T;!0;'@E;(I"def reset_local;T;)T;*I"&def reset_local @local = {} end;T;+To; ; F; ;,;;;I"Card::Cache#exist?;F;[[I"key;T0;[[@Ei[@Ei;F;: exist?;;;[;{;IC;" ;T;@G;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@G; I";T;!0;'@E;(I"def exist?(key);T;)T;*I"Ddef exist? key @local.has_key?(key) || @store.exist?(key) end;T;+To; ; F; ; ;;;I"d ;F;[;[[@Ei0;F;:reset_all;;;[;{;IC;" ;T;@G;.0;F;[;[; I";T;!0;'@E;(I"def reset_all;T;)T;*I">def reset_all reset_hard reset_soft reset_other end;T;+To; ; F; ; ;;;I"𝅿ޱm;F;[;[[@Ei6;F;:reset_hard;;;[;{;IC;" ;T;@G;.0;F;[;[; I";T;!0;'@E;(I"def reset_hard;T;)T;*I"idef reset_hard cache_by_class.each do |_klass, cache| cache.hard.reset if cache.hard end end;T;+To; ; F; ; ;;;I" AŸ;F;[;[[@Ei<;F;:reset_soft;;;[;{;IC;" ;T;@G;.0;F;[;[; I";T;!0;'@E;(I"def reset_soft;T;)T;*I"[def reset_soft cache_by_class.each do |_klass, cache| cache.soft.reset end end;T;+To; ; F; ; ;;;I"O`w(k ;F;[;[[@EiB;F;:reset_other;;;[;{;IC;" ;T;@G;.0;F;[;[; I";T;!0;'@E;(I"def reset_other;T;)T;*I"Odef reset_other Card::Codename.reset_cache Cardio.delete_tmp_files end;T;+To; ; F; ;,;;;I" ;F;[;[[@Eif;F;: hard;;;[;{;IC;"(Returns the value of attribute hard ;T;@G;.0;F;[;[; I"(Returns the value of attribute hard;T;!0;'@E;(I" def hard;T;*I"def hard @hard end;T;+To; ; F; ;,;;;I"\b@{;F;[;[[@Eif;F;: soft;;;[;{;IC;"(Returns the value of attribute soft ;T;@G;.0;F;[;[; I"(Returns the value of attribute soft;T;!0;'@E;(I" def soft;T;*I"def soft @soft end;T;+To; ;IC;[o; ; F; ;,;;;I"!Card::Cache::Temporary#store;F;[;[[I" lib/card/cache/temporary.rb;Ti;F;; ;;;[;{;IC;")Returns the value of attribute store ;T;@H;.0;F;[;[; I")Returns the value of attribute store;T;!0;'@H;(I"def store;T;*I"def store @store end;T;+To; ; F; ;,;;;I"&Card::Cache::Temporary#initialize;F;[;[[@ Hi ;F;;C;;;[;{;IC;" ;T;@H;.0;F;[;[o;0 ;1I" return;F;2I" a new instance of Temporary;T;0;3[I"Temporary;F;@H; I";T;!0;'@H;(I"def initialize;T;)T;*I"%def initialize @store = {} end;T;+To; ; F; ;,;;;I" Card::Cache::Temporary#read;F;[[I"key;T0;[[@ Hi ;F;;C;;;[;{;IC;" ;T;@(H;.0;F;[;[; I";T;!0;'@H;(I"def read key;T;)T;*I"Cdef read key return unless @store.key? key @store[key] end;T;+To; ; F; ;,;;;I"!Card::Cache::Temporary#write;F;[[I"key;T0[I" value;T0;[[@ Hi;F;;D;;;[;{;IC;" ;T;@7H;.0;F;[;[; I";T;!0;'@H;(I"def write key, value;T;)T;*I"3def write key, value @store[key] = value end;T;+To; ; F; ;,;;;I"!Card::Cache::Temporary#fetch;F;[[I"key;T0[I" &_block;T0;[[@ Hi;F;;;;;[;{;IC;" ;T;@HH;.0;F;[;[; I";T;!0;'@H;(I"def fetch key, &_block;T;)T;*I"@def fetch key, &_block read(key) || write(key, yield) end;T;+To; ; F; ;,;;;I""Card::Cache::Temporary#delete;F;[[I"key;T0;[[@ Hi;F;;;;;[;{;IC;" ;T;@YH;.0;F;[;[; I";T;!0;'@H;(I"def delete key;T;)T;*I"+def delete key @store.delete key end;T;+To; ; F; ;,;;;I" Card::Cache::Temporary#dump;F;[;[[@ Hi;F;;;;;[;{;IC;" ;T;@hH;.0;F;[;[; I";T;!0;'@H;(I" def dump;T;)T;*I"Tdef dump @store.each do |k, v| p "#{k} --> #{v.inspect[0..30]}" end end;T;+To; ; F; ;,;;;I"!Card::Cache::Temporary#reset;F;[;[[@ Hi$;F;;8;;;[;{;IC;" ;T;@uH;.0;F;[;[; I";T;!0;'@H;(I"def reset;T;)T;*I" def reset @store = {} end;T;+To; ; F; ;,;;;I""Card::Cache::Temporary#exist?;F;[[I"key;T0;[[@ Hi(;F;;;;;[;{;IC;" ;T;@H;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@H; I";T;!0;'@H;(I"def exist? key;T;)T;*I")def exist? key @store.key? key end;T;+T;I@H;JIC;[;I@H;KIC;[;I@H;LIC;M{; IC;M{;NT;,IC;M{; IC;M{;C@H;D0;NT;NT;NT;O{;P[;[[@ Hi;F;:Temporary;;;;;[;{;IC;" ;T;@H;.0;F;[;[; I";T;!0;'o;S ;T0;UI"Card::Cache;T;V@;: Cache;'@;W@E;X0;I"$ M`;F;Io;S ;T0;U0;V0;;J;'@;W@;X0o; ;IC;[o; ; F; ;,;;;I"#Card::Cache::Persistent#prefix;F;[;[[I"!lib/card/cache/persistent.rb;Ti [@Hi1;F;;;;;[;{;IC;"*Returns the value of attribute prefix ;T;@H;.0;F;[;[; I"*Returns the value of attribute prefix;T;!0;'@H;(I"def prefix;T;)T;*I"def prefix @prefix end;T;+To; ; F; ;,;;;I"$Card::Cache::Persistent#prefix=;F;[[I" value;T0;[[@Hi ;F;: prefix=;;;[;{;IC;"Sets the attribute prefix ;T;@H;.0;F;[;[o;0 ;1I" param;F;2I".the value to set the attribute prefix to.;T;I" value;T;30;@H; I"USets the attribute prefix @param value the value to set the attribute prefix to.;T;!0;'@H;(I"def prefix=(value);T;*I"-def prefix=(value) @prefix = value end;T;+To; ; F; ; ;;;I"*Card::Cache::Persistent.database_name;F;[;[[@Hi ;F;:database_name;;;[;{;IC;" ;T;@H;.0;F;[;[; I";T;!0;'@H;(I"def database_name;T;)T;*I"def database_name @database_name ||= (cfg = Cardio.config) && (dbcfg = cfg.database_configuration) && dbcfg[Rails.env]['database'] end;T;+To; ; F; ;,;;;I"'Card::Cache::Persistent#initialize;F;[[I" opts;T0;[[@Hi;F;;C;;;[;{;IC;" ;T;@H;.0;F;[;[o;0 ;1I" return;F;2I"!a new instance of Persistent;T;0;3[I"Persistent;F;@H; I";T;!0;'@H;(I"def initialize opts;T;)T;*I"def initialize opts @store = opts[:store] @klass = opts[:class] @class_key = @klass.to_s.to_name.key @database = opts[:database] || self.class.database_name end;T;+To; ; F; ;,;;;I""Card::Cache::Persistent#renew;F;[;[[@Hi;F;;;;;[;{;IC;" ;T;@H;.0;F;[;[; I";T;!0;'@H;(I"def renew;T;)T;*I"1def renew @stamp = nil @prefix = nil end;T;+To; ; F; ;,;;;I""Card::Cache::Persistent#reset;F;[;[[@Hi;F;;8;;;[;{;IC;" ;T;@H;.0;F;[;[; I";T;!0;'@H;(I"def reset;T;)T;*I"^def reset @stamp = new_stamp @prefix = nil Cardio.cache.write stamp_key, @stamp end;T;+To; ; F; ;,;;;I""Card::Cache::Persistent#stamp;F;[;[[@Hi%;F;: stamp;;;[;{;IC;" ;T;@ I;.0;F;[;[; I";T;!0;'@H;(I"def stamp;T;)T;*I"Jdef stamp @stamp ||= Cardio.cache.fetch stamp_key { new_stamp } end;T;+To; ; F; ;,;;;I"&Card::Cache::Persistent#stamp_key;F;[;[[@Hi);F;:stamp_key;;;[;{;IC;" ;T;@I;.0;F;[;[; I";T;!0;'@H;(I"def stamp_key;T;)T;*I";def stamp_key "#{@database}/#{@class_key}/stamp" end;T;+To; ; F; ;,;;;I"&Card::Cache::Persistent#new_stamp;F;[;[[@Hi-;F;:new_stamp;;;[;{;IC;" ;T;@#I;.0;F;[;[; I";T;!0;'@H;(I"def new_stamp;T;)T;*I".def new_stamp Time.now.to_i.to_s 32 end;T;+To; ; F; ;,;;;I"%Card::Cache::Persistent#full_key;F;[[I"key;T0;[[@Hi5;F;: full_key;;;[;{;IC;" ;T;@0I;.0;F;[;[; I";T;!0;'@H;(I"def full_key key;T;)T;*I".def full_key key "#{prefix}/#{key}" end;T;+To; ; F; ;,;;;I"!Card::Cache::Persistent#read;F;[[I"key;T0;[[@Hi9;F;;C;;;[;{;IC;" ;T;@?I;.0;F;[;[; I";T;!0;'@H;(I"def read key;T;)T;*I"1def read key @store.read full_key(key) end;T;+To; ; F; ;,;;;I"+Card::Cache::Persistent#write_variable;F;[[I"key;T0[I" variable;T0[I" value;T0;[[@Hi=;F;;;;;[;{;IC;" ;T;@NI;.0;F;[;[; I";T;!0;'@H;(I",def write_variable key, variable, value;T;)T;*I"def write_variable key, variable, value if @store && (object = read key) object.instance_variable_set "@#{variable}", value write key, object end value end;T;+To; ; F; ;,;;;I""Card::Cache::Persistent#write;F;[[I"key;T0[I" value;T0;[[@HiE;F;;D;;;[;{;IC;" ;T;@aI;.0;F;[;[; I";T;!0;'@H;(I"def write key, value;T;)T;*I"Adef write key, value @store.write full_key(key), value end;T;+To; ; F; ;,;;;I""Card::Cache::Persistent#fetch;F;[[I"key;T0[I" &block;T0;[[@HiI;F;;;;;[;{;IC;" ;T;@rI;.0;F;[;[; I";T;!0;'@H;(I"def fetch key, &block;T;)T;*I"Cdef fetch key, &block @store.fetch full_key(key), &block end;T;+To; ; F; ;,;;;I"#Card::Cache::Persistent#delete;F;[[I"key;T0;[[@HiM;F;;;;;[;{;IC;" ;T;@I;.0;F;[;[; I";T;!0;'@H;(I"def delete key;T;)T;*I"5def delete key @store.delete full_key(key) end;T;+To; ; F; ;,;;;I"'Card::Cache::Persistent#annihilate;F;[;[[@HiQ;F;:annihilate;;;[;{;IC;" ;T;@I;.0;F;[;[; I";T;!0;'@H;(I"def annihilate;T;)T;*I"&def annihilate @store.clear end;T;+To; ; F; ;,;;;I"#Card::Cache::Persistent#exist?;F;[[I"key;T0;[[@HiU;F;;;;;[;{;IC;" ;T;@I;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@I; I";T;!0;'@H;(I"def exist? key;T;)T;*I"5def exist? key @store.exist? full_key(key) end;T;+T;I@H;JIC;[;I@H;KIC;[;I@H;LIC;M{; IC;M{;NT;,IC;M{;IC;M{;C@H;D@H;NT;NT;NT;O{;P[;[[@Hi;F;:Persistent;;;;;[;{;IC;" ;T;@H;.0;F;[;[; I";T;!0;'o;S ;T0;UI"Card::Cache;T;V@;;;'@;W@E;X0;I";F;Io;S ;T0;U0;V0;;J;'@;W@;X0;I@E;JIC;[;I@E;KIC;[;I@E;LIC;M{; IC;M{;NT;,IC;M{ ;IC;M{;C@F;D0;NT; IC;M{;C@F;D0;NT;IC;M{;C@F;D0;NT;IC;M{;C@F;D@F;NT;IC;M{;C@G;D0;NT;IC;M{;C@G;D0;NT;NT;NT;O{;P[;[[@Ei[@Ei ;F;;;;;;;[;{;IC;" ;T;@E;.0;F;[;[; I";T;!0;'@;I"Card::Cache;F;Io;S ;T0;U0;V0;;J;'@;W@;X; ;+To;7;IC;[ o; ; F; ; ;;;I"Card::Chunk.register_class;F;[[I" klass;T0[I" hash;T0;[[I"lib/card/chunk.rb;Ti;F;:register_class;;;[;{;IC;" ;T;@I;.0;F;[;[; I";T;!0;'@I;(I"#def register_class klass, hash;T;)T;*I"def register_class klass, hash klass.config = hash.merge class: klass prefix_index = hash[:idx_char] || :default # this is gross and needs to be moved out. prefix_map[prefix_index] = klass.config end;T;+To; ; F; ; ;;;I"Card::Chunk.register_list;F;[[I"key;T0[I" list;T0;[[@Ii";F;:register_list;;;[;{;IC;" ;T;@I;.0;F;[;[; I";T;!0;'@I;(I" def register_list key, list;T;)T;*I";def register_list key, list raw_list[key] = list end;T;+To; ; F; ; ;;;I"%Card::Chunk.find_class_by_prefix;F;[[I" prefix;T0;[[@Ii&;F;:find_class_by_prefix;;;[;{;IC;" ;T;@J;.0;F;[;[; I";T;!0;'@I;(I"$def find_class_by_prefix prefix;T;)T;*I"def find_class_by_prefix prefix config = prefix_map[ prefix[0,1] ] || prefix_map[ prefix[-1,1] ] || prefix_map[:default] #prefix identified by first character, last character, or default. a little ugly... config[:class] end;T;+To; ; F; ; ;;;I""Card::Chunk.get_prefix_regexp;F;[[I"chunk_list_key;T0;[[@Ii,;F;:get_prefix_regexp;;;[;{;IC;" ;T;@J;.0;F;[;[; I";T;!0;'@I;(I")def get_prefix_regexp chunk_list_key;T;)T;*I"3def get_prefix_regexp chunk_list_key prefix_regexp_by_list[chunk_list_key] ||= begin chunk_types = raw_list[chunk_list_key].map { |chunkname| const_get chunkname } prefix_res = chunk_types.map do |chunk_class| chunk_class.config[:prefix_re] end /(?:#{ prefix_res * '|' })/m end end;T;+To; ;IC;[o; ; F; ;,;;;I"Card::Chunk::Abstract#text;F;[;[[@IiA;F;: text;;;[;{;IC;"(Returns the value of attribute text ;T;@$J;.0;F;[;[; I"(Returns the value of attribute text;T;!0;'@"J;(I" def text;T;*I"def text @text end;T;+To; ; F; ;,;;;I"(Card::Chunk::Abstract#process_chunk;F;[;[[@IiA;F;:process_chunk;;;[;{;IC;"1Returns the value of attribute process_chunk ;T;@1J;.0;F;[;[; I"1Returns the value of attribute process_chunk;T;!0;'@"J;(I"def process_chunk;T;*I"+def process_chunk @process_chunk end;T;+To; ; F; ; ;;;I"%Card::Chunk::Abstract.full_match;F;[[I" content;T0[I" prefix;TI"nil;T;[[@IiF;T;:full_match;;;[;{;IC;"Hif the prefix regex matched check that chunk against the full regex ;T;@>J;F;[;[; I"Hif the prefix regex matched check that chunk against the full regex;T;!0;"o;#;$F;%iE;&iE;'@"J;(I"'def full_match content, prefix=nil;T;)T;*I"def full_match content, prefix=nil # warn "attempting full match on #{content}. class = #{self}" content.match full_re( prefix ) end;T;+To; ; F; ; ;;;I""Card::Chunk::Abstract.full_re;F;[[I" prefix;T0;[[@IiK;F;: full_re;;;[;{;IC;" ;T;@QJ;.0;F;[;[; I";T;!0;'@"J;(I"def full_re prefix;T;)T;*I".def full_re prefix config[:full_re] end;T;+To; ; F; ; ;;;I"&Card::Chunk::Abstract.context_ok?;F;[[I" content;T0[I"chunk_start;T0;[[@IiO;F;:context_ok?;;;[;{;IC;" ;T;@`J;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@`J; I";T;!0;'@"J;(I")def context_ok? content, chunk_start;T;)T;*I"4def context_ok? content, chunk_start true end;T;+To; ; F; ;,;;;I"%Card::Chunk::Abstract#initialize;F;[[I" match;T0[I" content;T0;[[@IiT;F;;C;;;[;{;IC;" ;T;@vJ;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of Abstract;T;0;3[I" Abstract;F;@vJ; I";T;!0;'@"J;(I""def initialize match, content;T;)T;*I"~def initialize match, content @text = match[0] @processed = nil @content = content interpret match, content self end;T;+To; ; F; ;,;;;I"$Card::Chunk::Abstract#interpret;F;[[I"match_string;T0[I" content;T0[I" params;T0;[[@Ii\;F;:interpret;;;[;{;IC;" ;T;@J;.0;F;[;[; I";T;!0;'@"J;(I"0def interpret match_string, content, params;T;)T;*I"def interpret match_string, content, params Rails.logger.info "no #interpret method found for chunk class: #{self.class}" end;T;+To; ; F; ;,;;;I"!Card::Chunk::Abstract#format;F;[;[[@Ii`;F;;`;;;[;{;IC;" ;T;@J;.0;F;[;[; I";T;!0;'@"J;(I"def format;T;)T;*I"%def format @content.format end;T;+To; ; F; ;,;;;I"Card::Chunk::Abstract#card;F;[;[[@Iid;F;: card;;;[;{;IC;" ;T;@J;.0;F;[;[; I";T;!0;'@"J;(I" def card;T;)T;*I"!def card @content.card end;T;+To; ; F; ;,;;;I"Card::Chunk::Abstract#to_s;F;[;[[@Iih;F;;;;;[;{;IC;" ;T;@J;.0;F;[;[; I";T;!0;'@"J;(I" def to_s;T;)T;*I"9def to_s @process_chunk || @processed || @text end;T;+To; ; F; ;,;;;I""Card::Chunk::Abstract#inspect;F;[;[[@Iil;F;;;;;[;{;IC;" ;T;@J;.0;F;[;[; I";T;!0;'@"J;(I"def inspect;T;)T;*I"1def inspect "<##{self.class}##{to_s}>" end;T;+To; ; F; ;,;;;I""Card::Chunk::Abstract#as_json;F;[[I" options;TI"{};T;[[@Iip;F;: as_json;;;[;{;IC;" ;T;@J;.0;F;[;[; I";T;!0;'@"J;(I"def as_json(options={});T;)T;*I"udef as_json(options={}) @process_chunk || @processed|| "not rendered #{self.class}, #{card and card.name}" end;T;+T;I@"J;JIC;[;I@"J;KIC;[;I@"J;LIC;M{; IC;M{;NT;,IC;M{;IC;M{;C@$J;D0;NT;IC;M{;C@1J;D0;NT;NT;NT;O{;P[;[[@Ii?;F;;.;;;;;[;{;IC;" ;T;@"J;.0;F;[;[; I";T;!0;'@I;I"Card::Chunk::Abstract;F;Io;S ;T0;U0;V0;;J;'@;W@;X; ;+T;I@I;JIC;[;I@I;KIC;[;I@I;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Ii;T;: Chunk;;;;;[;{;IC;"A chunk is a pattern of text that can be protected and interrogated by a format. Each Chunk class has a +pattern+ that states what sort of text it matches. Chunks are initalized by passing in the result of a match by its pattern. ;T;@I;F;[;[; I"A chunk is a pattern of text that can be protected and interrogated by a format. Each Chunk class has a +pattern+ that states what sort of text it matches. Chunks are initalized by passing in the result of a match by its pattern.;T;!0;"o;#;$F;%i;&i;'@;I"Card::Chunk;F;+To; ; F; ; ;;;I"Card.config;F;[;[[I"lib/card/loader.rb;Ti ;F;: config;;;[;{;IC;" ;T;@K;.0;F;[;[; I";T;!0;'@;(I"def config;T;)T;*I"#def config Cardio.config end;T;+To; ; F; ; ;;;I"Card.paths;F;[;[[@ Ki;F;: paths;;;[;{;IC;" ;T;@K;.0;F;[;[; I";T;!0;'@;(I"def paths;T;)T;*I"!def paths Cardio.paths end;T;+To;7;IC;[o; ; F; ; ;;;I"Card::Loader.load_mods;F;[;[[@ Ki[I"lib/card/loader.rb;Ti;F;:load_mods;;;[;{;IC;" ;T;@$K;.0;F;[;[; I";T;!0;'@"K;(I"def load_mods;T;)T;*I"Edef load_mods load_set_patterns load_formats load_sets end;T;+To; ; F; ; ;;;I"Card::Loader.load_chunks;F;[;[[@ Ki[@*KiF;F;:load_chunks;;;[;{;IC;" ;T;@3K;.0;F;[;[; I";T;!0;'@"K;(I"def load_chunks;T;)T;*I"Xdef load_chunks mod_dirs.each do |mod| load_dir "#{mod}/chunk/*.rb" end end;T;+To; ; F; ; ;;;I"Card::Loader.load_layouts;F;[;[[@ Ki%[@*KiL;F;:load_layouts;;;[;{;IC;" ;T;@AK;.0;F;[;[; I";T;!0;'@"K;(I"def load_layouts;T;)T;*I"6def load_layouts mod_dirs.inject({}) do |hash, mod| dirname = "#{mod}/layout" if File.exists? dirname Dir.foreach( dirname ) do |filename| next if filename =~ /^\./ hash[ filename.gsub /\.html$/, '' ] = File.read( [dirname, filename] * '/' ) end end hash end end;T;+To; ; F; ; ;;;I"Card::Loader.mod_dirs;F;[;[[@ Ki2[@*KiZ;F;: mod_dirs;;;[;{;IC;" ;T;@OK;.0;F;[;[; I";T;!0;'@"K;(I"def mod_dirs;T;)T;*I"def mod_dirs @@mod_dirs ||= begin Card.paths['mod'].existent.map do |dirname| Dir.entries( dirname ).sort.map do |filename| "#{dirname}/#{filename}" if filename !~ /^\./ end.compact end.flatten.compact end end;T;+To; ; F; ; ;;;I"#Card::Loader.load_set_patterns;F;[;[[@ Ki>[@*Kif;F;:load_set_patterns;;;[;{;IC;" ;T;@]K;.0;F;[;[; I";T;!0;'@"K;(I"def load_set_patterns;T;)T;*I"def load_set_patterns if rewrite_tmp_files? generate_set_pattern_tmp_files end load_dir "#{Card.paths['tmp/set_pattern'].first}/*.rb" end;T;+To; ; F; ; ;;;I"0Card::Loader.generate_set_pattern_tmp_files;F;[;[[@ KiE[@*Kik;F;:#generate_set_pattern_tmp_files;;;[;{;IC;" ;T;@kK;.0;F;[;[; I";T;!0;'@"K;(I"'def generate_set_pattern_tmp_files;T;)T;*I"def generate_set_pattern_tmp_files prepare_tmp_dir 'tmp/set_pattern' seq = 100 mod_dirs.each do |mod| dirname = "#{mod}/set_pattern" if Dir.exists? dirname Dir.entries( dirname ).sort.each do |filename| if m = filename.match( /^(\d+_)?([^\.]*).rb/) and key = m[2] filename = [ dirname, filename ] * '/' SetPattern.write_tmp_file key, filename, seq seq = seq + 1 end end end end end;T;+To; ; F; ; ;;;I"Card::Loader.load_formats;F;[;[[@ KiV[@*Ki|;F;:load_formats;;;[;{;IC;" ;T;@yK;.0;F;[;[; I";T;!0;'@"K;(I"def load_formats;T;)T;*I"def load_formats #cheating on load issues now by putting all inherited-from formats in core mod. mod_dirs.each do |mod| load_dir "#{mod}/format/*.rb" end end;T;+To; ; F; ; ;;;I"Card::Loader.load_sets;F;[;[[@ Ki][@*Ki;F;:load_sets;;;[;{;IC;" ;T;@K;.0;F;[;[; I";T;!0;'@"K;(I"def load_sets;T;)T;*I"}def load_sets generate_tmp_set_modules load_tmp_set_modules Set.process_base_modules Set.clean_empty_modules end;T;+To; ; F; ; ;;;I"*Card::Loader.generate_tmp_set_modules;F;[;[[@ Kie[@*Ki;F;:generate_tmp_set_modules;;;[;{;IC;" ;T;@K;.0;F;[;[; I";T;!0;'@"K;(I"!def generate_tmp_set_modules;T;)T;*I"def generate_tmp_set_modules if prepare_tmp_dir 'tmp/set' seq = 1 mod_dirs.each do |mod_dir| mod_tmp_dir = make_set_module_tmp_dir mod_dir, seq Dir.glob("#{mod_dir}/set/**/*.rb").each do |abs_filename| rel_filename = abs_filename.gsub "#{mod_dir}/set/", '' tmp_filename = "#{mod_tmp_dir}/#{rel_filename}" Set.write_tmp_file abs_filename, tmp_filename, rel_filename end seq = seq + 1 end end end;T;+To; ; F; ; ;;;I"&Card::Loader.load_tmp_set_modules;F;[;[[@ Kiu[@*Ki;F;:load_tmp_set_modules;;;[;{;IC;" ;T;@K;.0;F;[;[; I";T;!0;'@"K;(I"def load_tmp_set_modules;T;)T;*I"`def load_tmp_set_modules patterns = Card.set_patterns.reverse.map(&:pattern_code).unshift 'abstract' Dir.glob( "#{Card.paths['tmp/set'].first}/*" ).sort.each do |tmp_mod| patterns.each do |pattern| pattern_dir = "#{tmp_mod}/#{pattern}" if Dir.exists? pattern_dir load_dir "#{pattern_dir}/**/*.rb" end end end end;T;+To; ; F; ; ;;;I")Card::Loader.make_set_module_tmp_dir;F;[[I" mod_dir;T0[I"seq;T0;[[@ Ki|[@*Ki;F;:make_set_module_tmp_dir;;;[;{;IC;" ;T;@K;.0;F;[;[; I";T;!0;'@"K;(I".def make_set_module_tmp_dir(mod_dir, seq);T;)T;*I"def make_set_module_tmp_dir mod_dir, seq modname = mod_dir.match(/[^\/]+$/)[0] mod_tmp_dir = "#{Card.paths['tmp/set'].first}/mod#{"%03d" % seq}-#{modname}" Dir.mkdir mod_tmp_dir mod_tmp_dir end;T;+To; ; F; ; ;;;I"!Card::Loader.prepare_tmp_dir;F;[[I" path;T0;[[@ Ki[@*Ki;F;:prepare_tmp_dir;;;[;{;IC;" ;T;@K;.0;F;[;[; I";T;!0;'@"K;(I"def prepare_tmp_dir(path);T;)T;*I"def prepare_tmp_dir path if rewrite_tmp_files? p = Card.paths[ path ] if p.existent.first FileUtils.rm_rf p.first, secure: true end Dir.mkdir p.first end end;T;+To; ; F; ; ;;;I"$Card::Loader.rewrite_tmp_files?;F;[;[[@ Ki[@*Ki;F;:rewrite_tmp_files?;;;[;{;IC;" ;T;@K;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@K; I";T;!0;'@"K;(I"def rewrite_tmp_files?;T;)T;*I"def rewrite_tmp_files? if defined?( @@rewrite ) @@rewrite else @@rewrite = !( Rails.env.production? and Card.paths['tmp/set'].existent.first ) end end;T;+To; ; F; ; ;;;I"Card::Loader.load_dir;F;[[I"dir;T0;[[@ Ki[@*Ki;F;: load_dir;;;[;{;IC;" ;T;@K;.0;F;[;[; I";T;!0;'@"K;(I"def load_dir(dir);T;)T;*I"def load_dir dir Dir[dir].sort.each do |file| # puts Benchmark.measure("from #load_dir: rd: #{file}") { require_dependency file # }.format("%n: %t %r") end end;T;+To; ; F; ; ;;;I",Card::Loader.update_machine_output_hack;F;[;[[@*Ki ;F;:update_machine_output_hack;;;[;{;IC;" ;T;@K;.0;F;[;[; I";T;!0;'@"K;(I"#def update_machine_output_hack;T;)T;*I"Tdef update_machine_output_hack update_script_output update_style_output end;T;+To; ; F; ; ;;;I"&Card::Loader.update_script_output;F;[;[[@*Ki%;F;:update_script_output;;;[;{;IC;" ;T;@L;.0;F;[;[; I";T;!0;'@"K;(I"def update_script_output;T;)T;*I"def update_script_output script = Card['*all+*script'] return unless (mtime_output = script.machine_output_card.updated_at) ['wagn_mod.js.coffee', 'wagn.js.coffee', 'script_card_menu.js.coffee'].each do |name| mtime_file = File.mtime( "#{Cardio.gem_root}/mod/03_machines/lib/javascript/#{name}" ) if mtime_file > mtime_output script.update_machine_output break end end end;T;+To; ; F; ; ;;;I"%Card::Loader.update_style_output;F;[;[[@*Ki4;F;:update_style_output;;;[;{;IC;" ;T;@L;.0;F;[;[; I";T;!0;'@"K;(I"def update_style_output;T;)T;*I"=def update_style_output style = Card['*all+*style'] return unless (mtime_output = style.machine_output_card.updated_at) style.machine_input_card.item_cards.each do |i_card| next unless i_card.codename %w(03_machines 06_bootstrap).each do |mod| style_dir = "#{Cardio.gem_root}/mod/#{mod}/lib/stylesheets" file_path = "#{style_dir}/#{i_card.codename}.scss" next unless File.exist? file_path mtime_file = File.mtime file_path if mtime_file > mtime_output style.update_machine_output break end end end end;T;+T;I@"K;JIC;[;I@"K;KIC;[;I@"K;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@ Ki;F;;#;;;;;[;{;IC;" ;T;@"K;.0;F;[;[; I";T;!0;'@;I"Card::Loader;F;+To; ;IC;[No;4;[[I"lib/card/format.rb;Ti [I"lib/card/format.rb;Ti;F;:DEPRECATED_VIEWS;;;;;[;{;IC;" ;T;@/L;.0;F;[;[; I";T;!0;'@-L;I"#Card::Format::DEPRECATED_VIEWS;F;(I"BDEPRECATED_VIEWS = { view: :open, card: :open, line: :closed,;T;*I"eDEPRECATED_VIEWS = { view: :open, card: :open, line: :closed, bare: :core, naked: :core }.freeze;T;6I"R{ view: :open, card: :open, line: :closed, bare: :core, naked: :core }.freeze;T;+To;4;[[@2Li [@4Li;F;:INCLUSION_MODES;;;;;[;{;IC;" ;T;@?L;.0;F;[;[; I";T;!0;'@-L;I""Card::Format::INCLUSION_MODES;F;(I"PINCLUSION_MODES = { closed: :closed, closed_content: :closed, edit: :edit,;T;*I"INCLUSION_MODES = { closed: :closed, closed_content: :closed, edit: :edit, layout: :layout, new: :edit, setup: :edit, normal: :normal, template: :template }.freeze;T;6I"{ closed: :closed, closed_content: :closed, edit: :edit, layout: :layout, new: :edit, setup: :edit, normal: :normal, template: :template }.freeze;T;+To; ; F; ;,;;;I"Card::Format#card;F;[;[[@2Li[@4Li;F;;;;;[;{;IC;"(Returns the value of attribute card ;T;@ML;.0;F;[;[; I"(Returns the value of attribute card;T;!0;'@-L;(I" def card;T;*I"def card @card end;T;+To; ; F; ;,;;;I"Card::Format#root;F;[;[[@2Li[@4Li;F;;;;;[;{;IC;"(Returns the value of attribute root ;T;@[L;.0;F;[;[; I"(Returns the value of attribute root;T;!0;'@-L;(I" def root;T;*I"def root @root end;T;+To; ; F; ;,;;;I"Card::Format#parent;F;[;[[@2Li[@4Li;F;: parent;;;[;{;IC;"*Returns the value of attribute parent ;T;@iL;.0;F;[;[; I"*Returns the value of attribute parent;T;!0;'@-L;(I"def parent;T;*I"def parent @parent end;T;+To; ; F; ;,;;;I"Card::Format#main_opts;F;[;[[@2Li[@4Li;F;:main_opts;;;[;{;IC;"-Returns the value of attribute main_opts ;T;@wL;.0;F;[;[; I"-Returns the value of attribute main_opts;T;!0;'@-L;(I"def main_opts;T;*I"#def main_opts @main_opts end;T;+To; ; F; ;,;;;I"Card::Format#form;F;[;[[@2Li[@4Li;F;: form;;;[;{;IC;"(Returns the value of attribute form ;T;@L;.0;F;[;[; I"(Returns the value of attribute form;T;!0;'@-L;(I" def form;T;*I"def form @form end;T;+To; ; F; ;,;;;I"Card::Format#form=;F;[[I" value;T0;[[@2Li[@4Li;F;: form=;;;[;{;IC;"Sets the attribute form ;T;@L;.0;F;[;[o;0 ;1I" param;F;2I",the value to set the attribute form to.;T;I" value;T;30;@L; I"QSets the attribute form @param value the value to set the attribute form to.;T;!0;'@-L;(I"def form=(value);T;*I")def form=(value) @form = value end;T;+To; ; F; ;,;;;I"Card::Format#error_status;F;[;[[@2Li[@4Li;F;:error_status;;;[;{;IC;"0Returns the value of attribute error_status ;T;@L;.0;F;[;[; I"0Returns the value of attribute error_status;T;!0;'@-L;(I"def error_status;T;*I")def error_status @error_status end;T;+To; ; F; ;,;;;I"Card::Format#error_status=;F;[[I" value;T0;[[@2Li[@4Li;F;:error_status=;;;[;{;IC;"$Sets the attribute error_status ;T;@L;.0;F;[;[o;0 ;1I" param;F;2I"4the value to set the attribute error_status to.;T;I" value;T;30;@L; I"aSets the attribute error_status @param value the value to set the attribute error_status to.;T;!0;'@-L;(I"def error_status=(value);T;*I"9def error_status=(value) @error_status = value end;T;+To; ; F; ;,;;;I" Card::Format#inclusion_opts;F;[;[[@2Li;F;:inclusion_opts;;;[;{;IC;"2Returns the value of attribute inclusion_opts ;T;@L;.0;F;[;[; I"2Returns the value of attribute inclusion_opts;T;!0;'@-L;(I"def inclusion_opts;T;*I"-def inclusion_opts @inclusion_opts end;T;+To; ; F; ;,;;;I"!Card::Format#inclusion_opts=;F;[[I" value;T0;[[@2Li;F;:inclusion_opts=;;;[;{;IC;"&Sets the attribute inclusion_opts ;T;@L;.0;F;[;[o;0 ;1I" param;F;2I"6the value to set the attribute inclusion_opts to.;T;I" value;T;30;@L; I"eSets the attribute inclusion_opts @param value the value to set the attribute inclusion_opts to.;T;!0;'@-L;(I"def inclusion_opts=(value);T;*I"=def inclusion_opts=(value) @inclusion_opts = value end;T;+To;[;[[@2Li[@4Li!;F;:@@registered;;;;;[;{;IC;" ;T;@L;.0;F;[;[; I";T;!0;'@-L;I"Card::Format::@@registered;F;(I"@@registered = [];T;*I"@@registered = [];T;6I"[];T;+To; ; F; ; ;;;I"Card::Format.register;F;[[I" format;T0;[[@2Li[@4Li#;F;: register;;;[;{;IC;" ;T;@L;.0;F;[;[; I";T;!0;'@-L;(I"def register(format);T;)T;*I":def register format @@registered << format.to_s end;T;+To; ; F; ; ;;;I"#Card::Format.format_class_name;F;[[I" format;T0;[[@2Li [@4Li';F;:format_class_name;;;[;{;IC;" ;T;@M;.0;F;[;[; I";T;!0;'@-L;(I""def format_class_name(format);T;)T;*I"def format_class_name format format = format.to_s format = '' if format == 'base' format = @@aliases[ format ] if @@aliases[ format ] "#{ format.camelize }Format" end;T;+To; ; F; ; ;;;I"$Card::Format.extract_class_vars;F;[[I" view;T0[I" opts;T0;[[@2Li'[@4Li.;F;:extract_class_vars;;;[;{;IC;" ;T;@M;.0;F;[;[; I";T;!0;'@-L;(I"'def extract_class_vars(view, opts);T;)T;*I"def extract_class_vars view, opts return unless opts.present? perms[view] = opts.delete(:perms) if opts[:perms] error_codes[view] = opts.delete(:error_code) if opts[:error_code] denial_views[view] = opts.delete(:denial) if opts[:denial] closed_views[view] = opts.delete(:closed) if opts[:closed] if tags = opts.delete(:tags) Array.wrap(tags).each do |tag| view_tags[view] ||= {} view_tags[view][tag] = true end end end;T;+To; ; F; ; ;;;I"Card::Format.new;F;[[I" card;T0[I" opts;TI"{};T;[[@2Li7[@4Li@;F;;;;;[;{;IC;" ;T;@)M;.0;F;[;[; I";T;!0;'@-L;(I"def new(card, opts={});T;)T;*I"def new card, opts={} if self != Format super else klass = Card.const_get format_class_name( opts[:format] || :html ) self == klass ? super : klass.new( card, opts ) end end;T;+To; ; F; ; ;;;I"Card::Format.tagged;F;[[I" view;T0[I"tag;T0;[[@2Li@[@4LiJ;F;: tagged;;;[;{;IC;" ;T;@ e rescue_view e, view end;T;+To; ; F; ;,;;;I"Card::Format#show_view?;F;[[I" view;T0[I" args;T0;[[@2Li;F;:show_view?;;;[;{;IC;" ;T;@hN;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@hN; I";T;!0;'@-L;(I"def show_view? view, args;T;)T;*I"def show_view? view, args default = args.delete(:default_visibility) || :show #FIXME - ugly view_key = canonicalize_view view api_option = args["optional_#{ view_key }".to_sym] case # args remove option when api_option == :always ; true when api_option == :never ; false # wagneer's choice when show_views( args ).member?( view_key ) ; true when hide_views( args ).member?( view_key ) ; false # args override default when api_option == :show ; true when api_option == :hide ; false # default else ; default==:show end end;T;+To; ; F; ;,;;;I"Card::Format#show_views;F;[[I" args;T0;[[@2Li;F;:show_views;;;[;{;IC;" ;T;@~N;.0;F;[;[; I";T;!0;'@-L;(I"def show_views args;T;)T;*I"@def show_views args parse_view_visibility args[:show] end;T;+To; ; F; ;,;;;I"Card::Format#hide_views;F;[[I" args;T0;[[@2Li;F;:hide_views;;;[;{;IC;" ;T;@N;.0;F;[;[; I";T;!0;'@-L;(I"def hide_views args;T;)T;*I"@def hide_views args parse_view_visibility args[:hide] end;T;+To; ; F; ;,;;;I"'Card::Format#parse_view_visibility;F;[[I"val;T0;[[@2Li;F;:parse_view_visibility;;;[;{;IC;" ;T;@N;.0;F;[;[; I";T;!0;'@-L;(I""def parse_view_visibility val;T;)T;*I"def parse_view_visibility val case val when Array; val when String; val.split(/[\s,]+/) when NilClass; [] else raise Card::Error, "bad show/hide argument: #{val}" end.map{ |view| canonicalize_view view } end;T;+To; ; F; ;,;;;I"%Card::Format#default_render_args;F;[[I" view;T0[I"a;TI"nil;T;[[@2Li;F;:default_render_args;;;[;{;IC;" ;T;@N;.0;F;[;[; I";T;!0;'@-L;(I"(def default_render_args view, a=nil;T;)T;*I"[def default_render_args view, a=nil args = case a when nil ; {} when Hash ; a.clone when Array ; a[0].merge a[1] else ; raise Card::Error, "bad render args: #{a}" end view_key = canonicalize_view view default_method = "default_#{ view }_args" if respond_to? default_method send default_method, args end args end;T;+To; ; F; ;,;;;I"Card::Format#rescue_view;F;[[I"e;T0[I" view;T0;[[@2Li;F;:rescue_view;;;[;{;IC;" ;T;@N;.0;F;[;[; I";T;!0;'@-L;(I"def rescue_view e, view;T;)T;*I"ndef rescue_view e, view if Rails.env =~ /^cucumber|test$/ raise e else Rails.logger.info "\nError rendering #{error_cardname} / #{view}: #{e.class} : #{e.message}" Card::Error.current = e card.notable_exception_raised if (debug = Card[:debugger]) && debug.content == 'on' raise e else rendering_error e, view end end end;T;+To; ; F; ;,;;;I" Card::Format#error_cardname;F;[;[[@2Li;F;:error_cardname;;;[;{;IC;" ;T;@N;.0;F;[;[; I";T;!0;'@-L;(I"def error_cardname;T;)T;*I"Udef error_cardname card && card.name.present? ? card.name : 'unknown card' end;T;+To; ; F; ;,;;;I""Card::Format#unsupported_view;F;[[I" view;T0;[[@2Li!;F;:unsupported_view;;;[;{;IC;" ;T;@N;.0;F;[;[; I";T;!0;'@-L;(I"def unsupported_view view;T;)T;*I"Ydef unsupported_view view "view (#{view}) not supported for #{error_cardname}" end;T;+To; ; F; ;,;;;I"!Card::Format#rendering_error;F;[[I"exception;T0[I" view;T0;[[@2Li%;F;:rendering_error;;;[;{;IC;" ;T;@N;.0;F;[;[; I";T;!0;'@-L;(I"(def rendering_error exception, view;T;)T;*I"bdef rendering_error exception, view "Error rendering: #{error_cardname} (#{view} view)" end;T;+To; ; F; ;,;;;I"Card::Format#subformat;F;[[I" subcard;T0;[[@2Li-;T;:subformat;;;[;{;IC;"C------------- Sub Format and Inclusion Processing ------------ ;T;@N;F;[;[; I"E ------------- Sub Format and Inclusion Processing ------------ ;T;!0;"o;#;$F;%i);&i+;'@-L;(I"def subformat subcard;T;)T;*I"sdef subformat subcard subcard = Card.fetch( subcard, new: {} ) if String===subcard sub = self.class.new subcard, parent: self, depth: @depth+1, root: @root, # FIXME - the following four should not be hard-coded here. need a generalized mechanism # for attribute inheritance context_names: @context_names, mode: @mode, mainline: @mainline, form: @form end;T;+To; ; F; ;,;;;I"!Card::Format#process_content;F;[[I"override_content;TI"nil;T[I" opts;TI"{};T;[[@4Li[@2Li6;T;:process_content;;;[;{;IC;"C------------- Sub Format and Inclusion Processing ------------ ;T;@ O;F;[;[; I"E ------------- Sub Format and Inclusion Processing ------------ ;T;!0;"o;#;$F;%i;&i;'@-L;(I"7def process_content(override_content=nil, opts={});T;)T;*I"^def process_content content=nil, opts={} process_content_object(content, opts).to_s end;T;+To; ; F; ;,;;;I"(Card::Format#process_content_object;F;[[I"override_content;TI"nil;T[I" opts;TI"{};T;[[@2Li:[@4Li;F;:process_content_object;;;[;{;IC;" ;T;@ O;.0;F;[;[; I";T;!0;'@-L;(I">def process_content_object(override_content=nil, opts={});T;)T;*I"def process_content_object content=nil, opts={} return content unless card content = card.raw_content || '' if content.nil? obj_content = Card::Content===content ? content : Card::Content.new( content, format=self, opts.delete(:content_opts) ) card.update_references( obj_content, refresh=true ) if card.references_expired # I thik we need this generalized obj_content.process_content_object do |chunk_opts| prepare_nest chunk_opts.merge(opts) { yield } end end;T;+To; ; F; ;,;;;I"Card::Format#ok_view;F;[[I" view;T0[I" args;TI"{};T;[[@2LiE;F;: ok_view;;;[;{;IC;" ;T;@4O;.0;F;[;[; I";T;!0;'@-L;(I"def ok_view view, args={};T;)T;*I"Zdef ok_view view, args={} return view if args.delete :skip_permissions approved_view = case when @depth >= Card.config.max_depth # prevent recursion. @depth tracks subformats :too_deep when @@perms[view] == :none # permission skipping specified in view definition view when args.delete(:skip_permissions) # permission skipping specified in args view when !card.known? && !tagged(view, :unknown_ok) # handle unknown cards (where view not exempt) view_for_unknown view, args else # run explicit permission checks permitted_view view, args end args[:denied_view] = view if approved_view != view if focal? && error_code = @@error_codes[ approved_view ] root.error_status = error_code end approved_view end;T;+To; ; F; ;,;;;I"Card::Format#tagged;F;[[I" view;T0[I"tag;T0;[[@2Li[[@4Li;F;;;;;[;{;IC;" ;T;@FO;.0;F;[;[; I";T;!0;'@-L;(I"def tagged(view, tag);T;)T;*I";def tagged view, tag self.class.tagged view, tag end;T;+To; ; F; ;,;;;I" Card::Format#permitted_view;F;[[I" view;T0[I" args;T0;[[@2Li_;F;:permitted_view;;;[;{;IC;" ;T;@XO;.0;F;[;[; I";T;!0;'@-L;(I""def permitted_view view, args;T;)T;*I"cdef permitted_view view, args perms_required = @@perms[view] || :read args[:denied_task] = if Proc === perms_required :read if !(perms_required.call self) # read isn't quite right else [perms_required].flatten.find { |task| !ok? task } end if args[:denied_task] @@denial_views[view] || :denial else view end end;T;+To; ; F; ;,;;;I"Card::Format#ok?;F;[[I" task;T0;[[@2Lio;F;;;;;[;{;IC;" ;T;@iO;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@iO; I";T;!0;'@-L;(I"def ok? task;T;)T;*I"def ok? task task = :create if task == :update && card.new_card? @ok ||= {} @ok[task] = card.ok? task if @ok[task].nil? @ok[task] end;T;+To; ; F; ;,;;;I""Card::Format#view_for_unknown;F;[[I" view;T0[I" args;T0;[[@2Liv;F;:view_for_unknown;;;[;{;IC;" ;T;@}O;.0;F;[;[; I";T;!0;'@-L;(I"$def view_for_unknown view, args;T;)T;*I"fdef view_for_unknown view, args # note: overridden in HTML focal? ? :not_found : :missing end;T;+To; ; F; ;,;;;I"#Card::Format#canonicalize_view;F;[[I" view;T0;[[@2Li{;F;:canonicalize_view;;;[;{;IC;" ;T;@O;.0;F;[;[; I";T;!0;'@-L;(I"def canonicalize_view view;T;)T;*I"def canonicalize_view view unless view.blank? view_key = view.to_viewname.key.to_sym DEPRECATED_VIEWS[view_key] || view_key end end;T;+To; ; F; ;,;;;I"%Card::Format#with_inclusion_mode;F;[[I" mode;T0;[[@2Li;F;:with_inclusion_mode;;;[;{;IC;" ;T;@O;.0;F;[;[; I";T;!0;'@-L;(I"!def with_inclusion_mode mode;T;)T;*I"def with_inclusion_mode mode if switch_mode = INCLUSION_MODES[ mode ] and @mode != switch_mode old_mode, @mode = @mode, switch_mode @inclusion_defaults = nil end result = yield if old_mode @inclusion_defaults = nil @mode = old_mode end result end;T;+To; ; F; ;,;;;I"Card::Format#prepare_nest;F;[[I" opts;T0;[[@2Li;F;:prepare_nest;;;[;{;IC;" ;T;@O;.0;F;[;[; I";T;!0;'@-L;(I"def prepare_nest opts;T;)T;*I"fdef prepare_nest opts @char_count ||= 0 opts ||= {} case when opts.has_key?(:comment) # commented nest opts[:comment] when @mode == :closed && @char_count > Card.config.max_char_count # move on; content out of view '' when opts[:inc_name] == '_main' && show_layout? && @depth==0 # the main card within a layout expand_main opts else # standard nest result = nest fetch_nested_card(opts), opts @char_count += result.length if @mode == :closed && result result end end;T;+To; ; F; ;,;;;I"Card::Format#expand_main;F;[[I" opts;T0;[[@2Li;F;:expand_main;;;[;{;IC;" ;T;@O;.0;F;[;[; I";T;!0;'@-L;(I"def expand_main opts;T;)T;*I" def expand_main opts opts.merge! root.main_opts if root.main_opts legacy_main_opts_tweaks! opts #opts[:view] ||= :open with_inclusion_mode :normal do @mainline = true result = wrap_main nest( root.card, opts ) @mainline = false result end end;T;+To; ; F; ;,;;;I"*Card::Format#legacy_main_opts_tweaks!;F;[[I" opts;T0;[[@2Li;F;:legacy_main_opts_tweaks!;;;[;{;IC;" ;T;@O;.0;F;[;[; I";T;!0;'@-L;(I"&def legacy_main_opts_tweaks! opts;T;)T;*I"def legacy_main_opts_tweaks! opts if val=params[:size] and val.present? opts[:size] = val.to_sym end if val=params[:item] and val.present? opts[:items] = (opts[:items] || {}).reverse_merge view: val.to_sym end end;T;+To; ; F; ;,;;;I"Card::Format#wrap_main;F;[[I" content;T0;[[@2Li;F;:wrap_main;;;[;{;IC;" ;T;@O;.0;F;[;[; I";T;!0;'@-L;(I"def wrap_main content;T;)T;*I"Edef wrap_main content content #no wrapping in base format end;T;+To; ; F; ;,;;;I"Card::Format#nest;F;[[I"nested_card;T0[I" opts;TI"{};T;[[@2Li;F;: nest;;;[;{;IC;" ;T;@O;.0;F;[;[; I";T;!0;'@-L;(I""def nest nested_card, opts={};T;)T;*I"def nest nested_card, opts={} #ActiveSupport::Notifications.instrument('card', message: "nest: #{nested_card.name}, #{opts}") do opts.delete_if { |k,v| v.nil? } opts.reverse_merge! inclusion_defaults(nested_card) sub = nil if opts[:inc_name] =~ /^_(self)?$/ sub = self else sub = subformat nested_card sub.inclusion_opts = opts[:items] ? opts[:items].clone : {} end view = canonicalize_view opts.delete :view opts[:home_view] = [:closed, :edit].member?(view) ? :open : view # FIXME: special views should be represented in view definitions view = case @mode when :edit not_ready_for_form = @@perms[view]==:none || nested_card.structure || nested_card.key.blank? # eg {{_self|type}} on new cards not_ready_for_form ? :blank : :edit_in_form when :template :template_rule when :closed case when @@closed_views[view] == true || @@error_codes[view] ; view when specified_view = @@closed_views[view] ; specified_view when !nested_card.known? ; :closed_missing else ; :closed_content end else view end sub.optional_render view, opts #end end;T;+To; ; F; ;,;;;I"'Card::Format#get_inclusion_content;F;[[I" cardname;T0;[[@2Li;F;:get_inclusion_content;;;[;{;IC;" ;T;@O;.0;F;[;[; I";T;!0;'@-L;(I"'def get_inclusion_content cardname;T;)T;*I"def get_inclusion_content cardname content = params[cardname.to_s.gsub(/\+/,'_')] # CLEANME This is a hack to get it so plus cards re-populate on failed signups if p = params['subcards'] and card_params = p[cardname.to_s] content = card_params['content'] end content if content.present? # why is this necessary? - efm # probably for blanks? -- older/wiser efm end;T;+To; ; F; ;,;;;I"#Card::Format#fetch_nested_card;F;[[I" options;T0;[[@2Li;F;:fetch_nested_card;;;[;{;IC;" ;T;@ P;.0;F;[;[; I";T;!0;'@-L;(I""def fetch_nested_card options;T;)T;*I"adef fetch_nested_card options args = { name: options[:inc_name], type: options[:type], supercard: card } args.delete(:supercard) if options[:inc_name].strip.blank? # special case. gets absolutized incorrectly. fix in smartname? if options[:inc_name] =~ /^_main\+/ # FIXME this is a rather hacky (and untested) way to get @superleft to work on new cards named _main+whatever args[:name] = args[:name].gsub /^_main\+/, '+' args[:supercard] = root.card end if content=get_inclusion_content(options[:inc_name]) args[:content]=content end Card.fetch options[:inc_name], new: args end;T;+To; ; F; ;,;;;I"#Card::Format#default_item_view;F;[;[[@2Li;F;:default_item_view;;;[;{;IC;" ;T;@P;.0;F;[;[; I";T;!0;'@-L;(I"def default_item_view;T;)T;*I"&def default_item_view :name end;T;+To; ; F; ;,;;;I"Card::Format#add_class;F;[[I" options;T0[I" klass;T0;[[@2Li;T;:add_class;;;[;{;IC;"'------------ LINKS --------------- ;T;@%P;F;[;[; I") ------------ LINKS --------------- ;T;!0;"o;#;$F;%i;&i;'@-L;(I"!def add_class options, klass;T;)T;*I"jdef add_class options, klass options[:class] = [ options[:class], klass ].flatten.compact * ' ' end;T;+To; ; F; ;,;;;I"Card::Format#unique_id;F;[;[[@2Li ;F;:unique_id;;;[;{;IC;" ;T;@7P;.0;F;[;[; I";T;!0;'@-L;(I"def unique_id;T;)T;*I"Bdef unique_id "#{card.key}-#{Time.now.to_i}-#{rand(3)}" end;T;+To; ; F; ;,;;;I"Card::Format#format_date;F;[[I" date;T0[I"include_time;TI" true;T;[[@4Li[@2Li;T;:format_date;;;[;{;IC;"'------------ LINKS --------------- ;T;@DP;F;[;[; I") ------------ LINKS --------------- ;T;!0;"o;#;$F;%i;&i;'@-L;(I"-def format_date(date, include_time=true);T;)T;*I"Qdef format_date date, include_time = true # Must use DateTime because Time doesn't support %e on at least some platforms if include_time DateTime.new(date.year, date.mon, date.day, date.hour, date.min, date.sec).strftime("%B %e, %Y %H:%M:%S") else DateTime.new(date.year, date.mon, date.day).strftime("%B %e, %Y") end end;T;+To; ; F; ;,;;;I""Card::Format#add_name_context;F;[[I" name;TI"nil;T;[[@2Li[@4Li;F;:add_name_context;;;[;{;IC;" ;T;@XP;.0;F;[;[; I";T;!0;'@-L;(I"#def add_name_context(name=nil);T;)T;*I"~def add_name_context name=nil name ||= card.name @context_names += name.to_name.part_names @context_names.uniq! end;T;+To; ; F; ;,;;;I" r;F;[;[[@4Li;F;:nest_opts;;;[;{;IC;"-Returns the value of attribute nest_opts ;T;@iP;.0;F;[;[; I"-Returns the value of attribute nest_opts;T;!0;'@-L;(I"def nest_opts;T;*I"#def nest_opts @nest_opts end;T;+To; ; F; ;,;;;I"def annihilate @store;F;[[I" value;T0;[[@4Li;F;:nest_opts=;;;[;{;IC;"!Sets the attribute nest_opts ;T;@vP;.0;F;[;[o;0 ;1I" param;F;2I"1the value to set the attribute nest_opts to.;T;I" value;T;30;@vP; I"[Sets the attribute nest_opts @param value the value to set the attribute nest_opts to.;T;!0;'@-L;(I"def nest_opts=(value);T;*I"3def nest_opts=(value) @nest_opts = value end;T;+To; ; F; ; ;;;I"#Card::Format.extract_view_tags;F;[[I" view;T0[I" opts;T0;[[@4Li7;F;:extract_view_tags;;;[;{;IC;" ;T;@P;.0;F;[;[; I";T;!0;'@-L;(I"%def extract_view_tags view, opts;T;)T;*I"def extract_view_tags view, opts tags = opts.delete :tags return unless tags Array.wrap(tags).each do |tag| view_tags[view] ||= {} view_tags[view][tag] = true end end;T;+To; ; F; ;,;;;I"$Card::Format#get_content_object;F;[[I" content;T0[I" opts;T0;[[@4Li;F;:get_content_object;;;[;{;IC;" ;T;@P;.0;F;[;[; I";T;!0;'@-L;(I")def get_content_object content, opts;T;)T;*I"def get_content_object content, opts if content.is_a? Content content else Content.new content, self, opts.delete(:content_opts) end end;T;+To;7;IC;[o; ; F; ;,;;;I"!Card::Format::Nest#subformat;F;[[I" subcard;T0;[[I"lib/card/format/nest.rb;Ti ;F;;;;;[;{;IC;" ;T;@P;.0;F;[;[; I";T;!0;'@P;(I"def subformat subcard;T;)T;*I"def subformat subcard subcard = Card.fetch(subcard, new: {}) if subcard.is_a?(String) self.class.new subcard, parent: self, depth: @depth + 1, root: @root, # FIXME: - the following four should not be hard-coded # here. need a generalized mechanism # for attribute inheritance context_names: @context_names, mode: @mode, mainline: @mainline, form: @form end;T;+To; ; F; ;,;;;I"'Card::Format::Nest#field_subformat;F;[[I" field;T0;[[@Pi;F;:field_subformat;;;[;{;IC;" ;T;@P;.0;F;[;[; I";T;!0;'@P;(I"def field_subformat field;T;)T;*I"rdef field_subformat field field = card.cardname.field(field) unless field.is_a?(Card) subformat field end;T;+To; ; F; ;,;;;I""Card::Format::Nest#field_nest;F;[[I" field;T0[I" opts;TI"{};T;[[@Pi;F;:field_nest;;;[;{;IC;" ;T;@P;.0;F;[;[; I";T;!0;'@P;(I""def field_nest field, opts={};T;)T;*I"def field_nest field, opts={} if field.is_a?(Card) nest field, opts else prepare_nest opts.merge(inc_name: card.cardname.field(field)) end end;T;+To; ; F; ;,;;;I"&Card::Format::Nest#with_nest_mode;F;[[I" mode;T0;[[@Pi!;F;:with_nest_mode;;;[;{;IC;" ;T;@P;.0;F;[;[; I";T;!0;'@P;(I"def with_nest_mode mode;T;)T;*I"def with_nest_mode mode if (switch_mode = INCLUSION_MODES[mode]) && @mode != switch_mode old_mode = @mode @mode = switch_mode @nest_defaults = nil end result = yield if old_mode @nest_defaults = nil @mode = old_mode end result end;T;+To; ; F; ;,;;;I"$Card::Format::Nest#prepare_nest;F;[[I" opts;T0;[[@Pi/;F;;;;;[;{;IC;" ;T;@P;.0;F;[;[; I";T;!0;'@P;(I"def prepare_nest opts;T;)T;*I" def prepare_nest opts @char_count ||= 0 opts ||= {} case when opts.key?(:comment) # commented nest opts[:comment] when @mode == :closed && @char_count > Card.config.max_char_count # move on; content out of view '' when opts[:inc_name] == '_main' && show_layout? && @depth == 0 # the main card within a layout expand_main opts else # standard nest result = nest fetch_nested_card(opts), opts @char_count += result.length if @mode == :closed && result result end end;T;+To; ; F; ;,;;;I" @[{ ;F;[[I"nested_card;T0[I" opts;TI"{};T;[[@PiE;F;;;;;[;{;IC;" ;T;@P;.0;F;[;[; I";T;!0;'@P;(I""def nest nested_card, opts={};T;)T;*I"Bdef nest nested_card, opts={} # ActiveSupport::Notifications.instrument('card', message: # "nest: #{nested_card.name}, #{opts}") do opts.delete_if { |_k, v| v.nil? } opts.reverse_merge! nest_defaults(nested_card) sub = nil if opts[:inc_name] =~ /^_(self)?$/ sub = self else sub = subformat nested_card sub.nest_opts = opts[:items] ? opts[:items].clone : {} end view = canonicalize_view opts.delete :view opts[:home_view] = [:closed, :edit].member?(view) ? :open : view # FIXME: special views should be represented in view definitions view = case @mode when :edit then view_in_edit_mode(view, nested_card) when :template then :template_rule when :closed then view_in_closed_mode(view, nested_card) else view end sub.optional_render view, opts end;T;+To; ; F; ;,;;;I"(Card::Format::Nest#get_nest_content;F;[[I" cardname;T0;[[@Pie;F;:get_nest_content;;;[;{;IC;" ;T;@Q;.0;F;[;[; I";T;!0;'@P;(I""def get_nest_content cardname;T;)T;*I"Ddef get_nest_content cardname content = params[cardname.to_s.tr('+', '_')] # CLEANME This is a hack so plus cards re-populate on failed signups p = params['subcards'] if p && (card_params = p[cardname.to_s]) content = card_params['content'] end content if content.present? # returns nil for empty string end;T;+To; ; F; ;,;;;I")Card::Format::Nest#fetch_nested_card;F;[[I" options;T0;[[@Pip;F;;;;;[;{;IC;" ;T;@Q;.0;F;[;[; I";T;!0;'@P;(I""def fetch_nested_card options;T;)T;*I"cdef fetch_nested_card options Card.fetch options[:inc_name], new: nest_new_args(options) end;T;+To; ; F; ;,;;;I"%Card::Format::Nest#nest_new_args;F;[[I" options;T0;[[@Pit;F;:nest_new_args;;;[;{;IC;" ;T;@,Q;.0;F;[;[; I";T;!0;'@P;(I"def nest_new_args options;T;)T;*I"Cdef nest_new_args options args = { name: options[:inc_name], type: options[:type], supercard: card } args.delete(:supercard) if options[:inc_name].strip.blank? # special case. gets absolutized incorrectly. fix in smartname? if options[:inc_name] =~ /^_main\+/ # FIXME: this is a rather hacky (and untested) way to get @superleft # to work on new cards named _main+whatever args[:name] = args[:name].gsub(/^_main\+/, '+') args[:supercard] = root.card end if (content = get_nest_content options[:inc_name]) args[:content] = content end args end;T;+To; ; F; ;,;;;I"!Card::Format::Nest#wrap_main;F;[[I" content;T0;[[@Pi;F;;;;;[;{;IC;" ;T;@;Q;.0;F;[;[; I";T;!0;'@P;(I"def wrap_main content;T;)T;*I"Edef wrap_main content content # no wrapping in base format end;T;+To; ; F; ;,;;;I"%Card::Format::Nest#nest_defaults;F;[[I"nested_card;T0;[[@Pi;F;:nest_defaults;;;[;{;IC;" ;T;@JQ;.0;F;[;[; I";T;!0;'@P;(I""def nest_defaults nested_card;T;)T;*I"def nest_defaults nested_card @nest_defaults ||= begin defaults = get_nest_defaults(nested_card).clone defaults.merge! @nest_opts if @nest_opts defaults end end;T;+To; ; F; ;,;;;I")Card::Format::Nest#get_nest_defaults;F;[[I"_nested_card;T0;[[@Pi;F;:get_nest_defaults;;;[;{;IC;" ;T;@YQ;.0;F;[;[; I";T;!0;'@P;(I"'def get_nest_defaults _nested_card;T;)T;*I"=def get_nest_defaults _nested_card { view: :name } end;T;+To; ; F; ;,;;;I"#Card::Format::Nest#expand_main;F;[[I" opts;T0;[[@Pi;F;;;;;[;{;IC;" ;T;@hQ;.0;F;[;[; I";T;!0;'@P;(I"def expand_main opts;T;)T;*I"def expand_main opts opts.merge! root.main_opts if root.main_opts legacy_main_opts_tweaks! opts with_nest_mode :normal do @mainline = true result = wrap_main nest(root.card, opts) @mainline = false result end end;T;+To; ; F; ;,;;;I"0Card::Format::Nest#legacy_main_opts_tweaks!;F;[[I" opts;T0;[[@Pi;F;;;;;[;{;IC;" ;T;@wQ;.0;F;[;[; I";T;!0;'@P;(I"&def legacy_main_opts_tweaks! opts;T;)T;*I"def legacy_main_opts_tweaks! opts if (val = params[:size]) && val.present? opts[:size] = val.to_sym end if (val = params[:item]) && val.present? opts[:items] = (opts[:items] || {}).reverse_merge view: val.to_sym end end;T;+To; ; F; ;,;;;I")Card::Format::Nest#view_in_edit_mode;F;[[I" homeview;T0[I"nested_card;T0;[[@Pi;F;:view_in_edit_mode;;;[;{;IC;" ;T;@Q;.0;F;[;[; I";T;!0;'@P;(I"0def view_in_edit_mode homeview, nested_card;T;)T;*I"6def view_in_edit_mode homeview, nested_card not_in_form = Card::Format.perms[homeview] == :none || # view configured not to keep # in form nested_card.structure || # not yet nesting structures nested_card.key.blank? # eg {{_self|type}} on new cards not_in_form ? :blank : :edit_in_form end;T;+To; ; F; ;,;;;I"+Card::Format::Nest#view_in_closed_mode;F;[[I" homeview;T0[I"nested_card;T0;[[@Pi;F;:view_in_closed_mode;;;[;{;IC;" ;T;@Q;.0;F;[;[; I";T;!0;'@P;(I"2def view_in_closed_mode homeview, nested_card;T;)T;*I"Sdef view_in_closed_mode homeview, nested_card approved_view = Card::Format.closed[homeview] case when approved_view == true then homeview when Card::Format.error_code[homeview] then homeview when approved_view then approved_view when !nested_card.known? then :closed_missing else :closed_content end end;T;+T;I@P;JIC;[;I@P;KIC;[;I@P;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Pi;F;: Nest;;;;;[;{;IC;" ;T;@P;.0;F;[;[; I";T;!0;'@-L;I"^@0{` ;F;+To;7;IC;[o; ; F; ;,;;;I"Card::Format::Render#page;F;[[I" view;T0[I"slot_opts;T0;[[I"lib/card/format/render.rb;Ti ;F;: page;;;[;{;IC;" ;T;@Q;.0;F;[;[; I";T;!0;'@Q;(I"def page view, slot_opts;T;)T;*I"ddef page view, slot_opts @card.run_callbacks :show_page do show view, slot_opts end end;T;+To; ; F; ;,;;;I" Card::Format::Render#render;F;[[I" view;T0[I" args;TI"{};T;[[@Qi;F;;;;;[;{;IC;" ;T;@Q;.0;F;[;[; I";T;!0;'@Q;(I"def render view, args={};T;)T;*I"def render view, args={} view = canonicalize_view view return if hidden_view? view, args view = ok_view view, args current_view(view) do args = default_render_args view, args with_nest_mode view do Card::ViewCache.fetch(self, view, args) do method = view_method view, args method.arity == 0 ? method.call : method.call(args) end end end rescue => e rescue_view e, view end;T;+To; ; F; ;,;;;I"%Card::Format::Render#view_method;F;[[I" view;T0[I" args;T0;[[@Qi ;F;:view_method;;;[;{;IC;" ;T;@Q;.0;F;[;[; I";T;!0;'@Q;(I"def view_method view, args;T;)T;*I"def view_method view, args method "_view_#{view}" rescue args[:unsupported_view] = view method '_view_unsupported_view' end;T;+To; ; F; ;,;;;I"+Card::Format::Render#canonicalize_view;F;[[I" view;T0;[[@Qi';F;;;;;[;{;IC;" ;T;@Q;.0;F;[;[; I";T;!0;'@Q;(I"def canonicalize_view view;T;)T;*I"def canonicalize_view view return if view.blank? view_key = view.to_viewname.key.to_sym DEPRECATED_VIEWS[view_key] || view_key end;T;+To; ; F; ;,;;;I"+Card::Format::Render#default_item_view;F;[;[[@Qi-;F;;;;;[;{;IC;" ;T;@Q;.0;F;[;[; I";T;!0;'@Q;(I"def default_item_view;T;)T;*I"&def default_item_view :name end;T;+To; ; F; ;,;;;I"&Card::Format::Render#hidden_view?;F;[[I" view;T0[I" args;T0;[[@Qi1;F;:hidden_view?;;;[;{;IC;" ;T;@ R;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@ R; I";T;!0;'@Q;(I" def hidden_view? view, args;T;)T;*I"Xdef hidden_view? view, args args.delete(:optional) && !show_view?(view, args) end;T;+To; ; F; ;,;;;I"$Card::Format::Render#show_view?;F;[[I" view;T0[I" args;T0;[[@Qi5;F;;;;;[;{;IC;" ;T;@!R;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@!R; I";T;!0;'@Q;(I"def show_view? view, args;T;)T;*I"def show_view? view, args default = args.delete(:default_visibility) || :show # FIXME: - ugly api_option = args["optional_#{view}".to_sym] case api_option # permanent visibility specified in code when :always then true when :never then false else # wagneer can override code settings contextual_setting = nest_arg_visibility(view, args) || api_option case contextual_setting when :show then true when :hide then false else default == :show end end end;T;+To; ; F; ;,;;;I"-Card::Format::Render#nest_arg_visibility;F;[[I" view;T0[I" args;T0;[[@QiH;F;:nest_arg_visibility;;;[;{;IC;" ;T;@7R;.0;F;[;[; I";T;!0;'@Q;(I"'def nest_arg_visibility view, args;T;)T;*I"def nest_arg_visibility view, args [:show, :hide].each do |setting| return setting if parse_view_visibility(args[setting]).member?(view) end false end;T;+To; ; F; ;,;;;I"/Card::Format::Render#parse_view_visibility;F;[[I"val;T0;[[@QiO;F;;;;;[;{;IC;" ;T;@HR;.0;F;[;[; I";T;!0;'@Q;(I""def parse_view_visibility val;T;)T;*I"def parse_view_visibility val case val when NilClass then [] when Array then val when String then val.split(/[\s,]+/) else raise Card::Error, "bad show/hide argument: #{val}" end.map { |view| canonicalize_view view } end;T;+To; ; F; ;,;;;I"-Card::Format::Render#default_render_args;F;[[I" view;T0[I"a;TI"nil;T;[[@Qi\;F;;;;;[;{;IC;" ;T;@WR;.0;F;[;[; I";T;!0;'@Q;(I"(def default_render_args view, a=nil;T;)T;*I"Pdef default_render_args view, a=nil args = case a when nil then {} when Hash then a.clone when Array then a[0].merge a[1] else raise Card::Error, "bad render args: #{a}" end default_method = "default_#{view}_args" send default_method, args if respond_to?(default_method) args end;T;+To; ; F; ;,;;;I"%Card::Format::Render#rescue_view;F;[[I"e;T0[I" view;T0;[[@Qin;F;;;;;[;{;IC;" ;T;@iR;.0;F;[;[; I";T;!0;'@Q;(I"def rescue_view e, view;T;)T;*I"Pdef rescue_view e, view raise e if Rails.env =~ /^cucumber|test$/ Rails.logger.info "\nError rendering #{error_cardname} / #{view}: "\ "#{e.class} : #{e.message}" Card::Error.current = e card.notable_exception_raised raise e if (debug = Card[:debugger]) && debug.content == 'on' rendering_error e, view end;T;+To; ; F; ;,;;;I"&Card::Format::Render#current_view;F;[[I" view;T0;[[@Qix;F;:current_view;;;[;{;IC;" ;T;@zR;.0;F;[;[; I";T;!0;'@Q;(I"def current_view view;T;)T;*I"zdef current_view view old_view = @current_view @current_view = view yield ensure @current_view = old_view end;T;+To; ; F; ;,;;;I"(Card::Format::Render#error_cardname;F;[;[[@Qi{;F;;;;;[;{;IC;" ;T;@R;.0;F;[;[; I";T;!0;'@Q;(I"def error_cardname;T;)T;*I"Udef error_cardname card && card.name.present? ? card.name : 'unknown card' end;T;+To; ; F; ;,;;;I")Card::Format::Render#rendering_error;F;[[I"_exception;T0[I" view;T0;[[@Qi;F;;;;;[;{;IC;" ;T;@R;.0;F;[;[; I";T;!0;'@Q;(I")def rendering_error _exception, view;T;)T;*I"cdef rendering_error _exception, view "Error rendering: #{error_cardname} (#{view} view)" end;T;+To; ; F; ;,;;;I"#Card::Format::Render#add_class;F;[[I" options;T0[I" klass;T0;[[@Qi;F;;;;;[;{;IC;" ;T;@R;.0;F;[;[; I";T;!0;'@Q;(I"!def add_class options, klass;T;)T;*I"hdef add_class options, klass options[:class] = [options[:class], klass].flatten.compact * ' ' end;T;+To; ; F; ;,;;;I"$Card::Format::Render#id_counter;F;[;[[@Qi;F;:id_counter;;;[;{;IC;" ;T;@R;.0;F;[;[; I";T;!0;'@Q;(I"def id_counter;T;)T;*I"edef id_counter return @parent.id_counter if @parent @id_counter ||= 0 @id_counter += 1 end;T;+To; ; F; ;,;;;I"#Card::Format::Render#unique_id;F;[;[[@Qi;F;;;;;[;{;IC;" ;T;@R;.0;F;[;[; I";T;!0;'@Q;(I"def unique_id;T;)T;*I"4def unique_id "#{card.key}-#{id_counter}" end;T;+T;I@Q;JIC;[;I@Q;KIC;[;I@Q;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Qi;F;: Render;;;;;[;{;IC;" ;T;@Q;.0;F;[;[; I";T;!0;'@-L;I" r;F;+To;7;IC;[ o; ; F; ;,;;;I"%Card::Format::Permission#ok_view;F;[[I" view;T0[I" args;TI"{};T;[[I""lib/card/format/permission.rb;Ti ;F;;;;;[;{;IC;" ;T;@R;.0;F;[;[; I";T;!0;'@R;(I"def ok_view view, args={};T;)T;*I"*def ok_view view, args={} return view if args.delete :skip_permissions approved_view = approved_view view, args args[:denied_view] = view if approved_view != view if focal? && (error_code = Card::Format.error_code[approved_view]) root.error_status = error_code end approved_view end;T;+To; ; F; ;,;;;I"+Card::Format::Permission#approved_view;F;[[I" view;T0[I" args;TI"{};T;[[@Ri;F;:approved_view;;;[;{;IC;" ;T;@R;.0;F;[;[; I";T;!0;'@R;(I"$def approved_view view, args={};T;)T;*I"*def approved_view view, args={} case when @depth >= Card.config.max_depth # prevent recursion. @depth tracks subformats :too_deep when Card::Format.perms[view] == :none # permission skipping specified in view definition view when args.delete(:skip_permissions) # permission skipping specified in args view when !card.known? && !tagged(view, :unknown_ok) # handle unknown cards (where view not exempt) view_for_unknown view, args else # run explicit permission checks permitted_view view, args end end;T;+To; ; F; ;,;;;I",Card::Format::Permission#permitted_view;F;[[I" view;T0[I" args;T0;[[@Ri';F;;;;;[;{;IC;" ;T;@ S;.0;F;[;[; I";T;!0;'@R;(I""def permitted_view view, args;T;)T;*I"wdef permitted_view view, args perms_required = Card::Format.perms[view] || :read args[:denied_task] = if perms_required.is_a? Proc :read unless perms_required.call(self) # read isn't quite right else [perms_required].flatten.find { |task| !ok? task } end if args[:denied_task] Card::Format.denial[view] || :denial else view end end;T;+To; ; F; ;,;;;I".Card::Format::Permission#view_for_unknown;F;[[I" _view;T0[I" _args;T0;[[@Ri7;F;;;;;[;{;IC;" ;T;@S;.0;F;[;[; I";T;!0;'@R;(I"&def view_for_unknown _view, _args;T;)T;*I"hdef view_for_unknown _view, _args # note: overridden in HTML focal? ? :not_found : :missing end;T;+To; ; F; ;,;;;I"!Card::Format::Permission#ok?;F;[[I" task;T0;[[@Ri<;F;;;;;[;{;IC;" ;T;@+S;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@+S; I";T;!0;'@R;(I"def ok? task;T;)T;*I"def ok? task task = :create if task == :update && card.new_card? @ok ||= {} @ok[task] = card.ok? task if @ok[task].nil? @ok[task] end;T;+T;I@R;JIC;[;I@R;KIC;[;I@R;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Ri;F;;;;;;;[;{;IC;" ;T;@R;.0;F;[;[; I";T;!0;'@-L;I"Card::Format::Permission;F;+T;I@-L;JIC;[;I@-L;KIC;[ o;S ;T0;U0;V0;;;'@-L;W@Q;X;Yo;S ;T0;U0;V0;;;'@-L;W@R;X;Yo;S ;T0;U0;V0;;;'@-L;W@P;X;Yo;S ;T0;UI"Card::Location;T;V@-L;: Location;'@;Wo;7;IC;[o; ; F; ;,;;;I"Card::Location#page_path;F;[[I" title;T0[I" opts;TI"{};T;[[I"lib/card/location.rb;Ti[I"lib/card/location.rb;Ti;T;:page_path;;;[;{;IC;" TESTME ;T;@XS;F;[;[; I" TESTME;T;!0;"o;#;$F;%i ;&i ;'@VS;(I""def page_path(title, opts={});T;)T;*I"def page_path title, opts={} Rails.logger.warn "Pass only Card::Name to page_path #{title.class}, #{title}" unless Card::Name===title format = opts[:format] ? ".#{opts.delete(:format)}" : '' action = opts[:action] ? "#{opts.delete(:action)}/" : '' query = opts.present? ? "?#{opts.to_param}" : '' card_path "#{action}#{title.to_name.url_key}#{format}#{query}" end;T;+To; ; F; ;,;;;I"Card::Location#card_path;F;[[I" rel_path;T0;[[@bSi[@dSi;F;:card_path;;;[;{;IC;" ;T;@nS;.0;F;[;[; I";T;!0;'@VS;(I"def card_path(rel_path);T;)T;*I"def card_path rel_path Rails.logger.warn "Pass only strings to card_path: #{rel_path.class}, #{rel_path}" unless String===rel_path if rel_path =~ /^\// rel_path else "#{ Card.config.relative_url_root }/#{ rel_path }" end end;T;+To; ; F; ;,;;;I"Card::Location#card_url;F;[[I"rel;T0;[[@bSi [@dSi;F;: card_url;;;[;{;IC;" ;T;@~S;.0;F;[;[; I";T;!0;'@VS;(I"def card_url(rel);T;)T;*I"def card_url rel if rel =~ /^https?\:/ rel else "#{ Card::Env[:protocol] }#{ Card::Env[:host] }#{ card_path rel }" end end;T;+T;I@VS;JIC;[o;S ;T0;U0;V0;;;'@;W@VS;X;Y;I@VS;KIC;[;I@VS;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@bSi[@dSi;F;;;;;;;[;{;IC;" ;T;@VS;.0;F;[;[; I";T;!0;'@;I"Card::Location;F;+T;X;Y;I@-L;LIC;M{; IC;M{;NT;,IC;M{ ;IC;M{;C@ML;D0;NT;IC;M{;C@[L;D0;NT;IC;M{;C@iL;D0;NT;IC;M{;C@wL;D0;NT;IC;M{;C@L;D@L;NT;IC;M{;C@L;D@L;NT;IC;M{;C@L;D@L;NT;IC;M{;C@iP;D@vP;NT;NT;NT;O{;P[;[ [@2Li [@Pi[@Qi[@Ri;F;;h;;;;;[;{;IC;" ;T;@-L;.0;F;[;[; I";T;!0;'@;I"Card::Format;F;Io;S ;T0;U0;V0;;J;'@;W@;X; ;+To; ;IC;[o;[;[[I"lib/card/mailer.rb;Ti [I"lib/card/mailer.rb;Ti ;F;:@@defaults;;;;;[;{;IC;" ;T;@S;.0;F;[;[; I";T;!0;'@S;I"Card::Mailer::@@defaults;F;(I"2@@defaults = Card.config.email_defaults || {};T;*I"2@@defaults = Card.config.email_defaults || {};T;6I"%Card.config.email_defaults || {};T;+To; ; F; ; ;;;I"Card::Mailer.new_mail;F;[[I" *args;T0[I" &block;T0;[[@Si[@Si;F;: new_mail;;;[;{;IC;" ;T;@S;.0;F;[;[; I";T;!0;'@S;(I" def new_mail(*args, &block);T;)T;*I"8def new_mail(*args, &block) mail = Mail.new(args, &block) method = Card::Mailer.delivery_method mail.delivery_method(method, Card::Mailer.send(:"#{method}_settings")) mail.perform_deliveries = Card::Mailer.perform_deliveries mail.raise_delivery_errors = Card::Mailer.raise_delivery_errors mail end;T;+To; ; F; ; ;;;I"Card::Mailer.layout;F;[[I" message;T0;[[@Si[@Si;F;: layout;;;[;{;IC;" ;T;@S;.0;F;[;[; I";T;!0;'@S;(I"def layout(message);T;)T;*I"}def layout message %{ #{message} } end;T;+T;I@S;JIC;[;I@S;KIC;[;I@S;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Si [@Si ;F;: Mailer;;;;;[;{;IC;" ;T;@S;.0;F;[;[; I";T;!0;'@;I"Card::Mailer;F;Io;S ;T0;UI"ActionMailer::Base;T;V@;;;'o;S ;T0;U0;V0;:ActionMailer;'@;W0;X0;W0;X; ;+To; ;IC;[!o; ; F; ;,;;;I"Card::Success#params;F;[;[[I"lib/card/success.rb;Ti [@ Tiu[I"lib/card/success.rb;Tiw;F;;;;;;[;{;IC;"*Returns the value of attribute params ;T;@T;.0;F;[;[; I"*Returns the value of attribute params;T;!0;'@T;(I"def params;T;)T;*I"def params @params end;T;+To; ; F; ;,;;;I"Card::Success#params=;F;[[I" value;T0;[[@ Ti ;F;: params=;;;[;{;IC;"Sets the attribute params ;T;@T;.0;F;[;[o;0 ;1I" param;F;2I".the value to set the attribute params to.;T;I" value;T;30;@T; I"USets the attribute params @param value the value to set the attribute params to.;T;!0;'@T;(I"def params=(value);T;*I"-def params=(value) @params = value end;T;+To; ; F; ;,;;;I"Card::Success#redirect;F;[;[[@ Ti ;F;: redirect;;;[;{;IC;",Returns the value of attribute redirect ;T;@(T;.0;F;[;[; I",Returns the value of attribute redirect;T;!0;'@T;(I"def redirect;T;*I"!def redirect @redirect end;T;+To; ; F; ;,;;;I"Card::Success#redirect=;F;[[I" value;T0;[[@ Ti ;F;:redirect=;;;[;{;IC;" Sets the attribute redirect ;T;@5T;.0;F;[;[o;0 ;1I" param;F;2I"0the value to set the attribute redirect to.;T;I" value;T;30;@5T; I"YSets the attribute redirect @param value the value to set the attribute redirect to.;T;!0;'@T;(I"def redirect=(value);T;*I"1def redirect=(value) @redirect = value end;T;+To; ; F; ;,;;;I"Card::Success#id;F;[;[[@ Ti ;F;:id;;;[;{;IC;"&Returns the value of attribute id ;T;@HT;.0;F;[;[; I"&Returns the value of attribute id;T;!0;'@T;(I" def id;T;*I"def id @id end;T;+To; ; F; ;,;;;I"Card::Success#id=;F;[[I"id;T0;[[@ Ti [@ Ti5[@ Ti1;F;:id=;;;[;{;IC;"Sets the attribute id ;T;@UT;.0;F;[;[o;0 ;1I" param;F;2I"*the value to set the attribute id to.;T;I" value;T;30;@UT; I"MSets the attribute id @param value the value to set the attribute id to.;T;!0;'@T;(I"def id=(id);T;)T;*I"%def id=(value) @id = value end;T;+To; ; F; ;,;;;I"Card::Success#name;F;[;[[@ Ti ;F;: name;;;[;{;IC;"(Returns the value of attribute name ;T;@jT;.0;F;[;[; I"(Returns the value of attribute name;T;!0;'@T;(I" def name;T;*I"def name @name end;T;+To; ; F; ;,;;;I"Card::Success#name=;F;[[I" value;T0;[[@ Ti ;F;;;;;[;{;IC;"Sets the attribute name ;T;@wT;.0;F;[;[o;0 ;1I" param;F;2I",the value to set the attribute name to.;T;I" value;T;30;@wT; I"QSets the attribute name @param value the value to set the attribute name to.;T;!0;'@T;(I"def name=(value);T;*I")def name=(value) @name = value end;T;+To; ; F; ;,;;;I"Card::Success#card;F;[[I"name_context;TI"@name_context;T;[[@ Ti [@ TiS[@ TiU;F;;;;;[;{;IC;"(Returns the value of attribute card ;T;@T;.0;F;[;[; I"(Returns the value of attribute card;T;!0;'@T;(I")def card(name_context=@name_context);T;)T;*I"def card @card end;T;+To; ; F; ;,;;;I"Card::Success#card=;F;[[I" value;T0;[[@ Ti ;F;: card=;;;[;{;IC;"Sets the attribute card ;T;@T;.0;F;[;[o;0 ;1I" param;F;2I",the value to set the attribute card to.;T;I" value;T;30;@T; I"QSets the attribute card @param value the value to set the attribute card to.;T;!0;'@T;(I"def card=(value);T;*I")def card=(value) @card = value end;T;+To; ; F; ;,;;;I"Card::Success#name_context;F;[;[[@ Ti ;F;:name_context;;;[;{;IC;"0Returns the value of attribute name_context ;T;@T;.0;F;[;[; I"0Returns the value of attribute name_context;T;!0;'@T;(I"def name_context;T;*I")def name_context @name_context end;T;+To; ; F; ;,;;;I" Card::Success#name_context=;F;[[I" value;T0;[[@ Ti ;F;:name_context=;;;[;{;IC;"$Sets the attribute name_context ;T;@T;.0;F;[;[o;0 ;1I" param;F;2I"4the value to set the attribute name_context to.;T;I" value;T;30;@T; I"aSets the attribute name_context @param value the value to set the attribute name_context to.;T;!0;'@T;(I"def name_context=(value);T;*I"9def name_context=(value) @name_context = value end;T;+To; ; F; ;,;;;I"Card::Success#initialize;F;[[I"name_context;TI"nil;T[I"success_params;TI"nil;T;[[@ Ti ;F;;C;;;[;{;IC;" ;T;@T;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of Success;T;0;3[I" Success;F;@T; I";T;!0;'@T;(I"9def initialize(name_context=nil, success_params=nil);T;)T;*I"Vdef initialize name_context=nil, success_params=nil @name_context = name_context @new_args = {} @params = OpenStruct.new case success_params when Hash apply(success_params) when /^REDIRECT:\s*(.+)/ @redirect=true self.target = $1 when nil ; self.name = '_self' else ; self.target = success_params end end;T;+To; ; F; ;,;;;I"Card::Success#<<;F;[[I" value;T0;[[@ Ti[@ Ti;F;;;;;[;{;IC;" ;T;@T;.0;F;[;[; I";T;!0;'@T;(I"def <<(value);T;)T;*I"ddef << value case value when Hash ; apply value else ; self.target = value end end;T;+To; ; F; ;,;;;I"!Card::Success#hard_redirect?;F;[;[[@ Ti#[@ Ti;F;:hard_redirect?;;;[;{;IC;" ;T;@T;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@T; I";T;!0;'@T;(I"def hard_redirect?;T;)T;*I"/def hard_redirect? @redirect == true end;T;+To; ; F; ;,;;;I"!Card::Success#soft_redirect?;F;[;[[@ Ti([@ Ti$;T;:soft_redirect?;;;[;{;IC;">reset card object and override params with success params ;T;@ U;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@ U; I">reset card object and override params with success params;T;!0;"o;#;$F;%i#;&i#;'@T;(I"def soft_redirect?;T;)T;*I"0def soft_redirect? @redirect == :soft end;T;+To; ; F; ;,;;;I"Card::Success#mark=;F;[[I" value;T0;[[@ Ti,[@ Ti(;F;: mark=;;;[;{;IC;" ;T;@U;.0;F;[;[; I";T;!0;'@T;(I"def mark=(value);T;)T;*I"def mark= value case value when Integer ; @id = value when String ; @name = value when Card ; @card = value else ; self.target = value end end;T;+To; ; F; ;,;;;I"Card::Success#type=;F;[[I" type;T0;[[@ Ti9[@ Ti5;F;;;;;[;{;IC;" ;T;@.U;.0;F;[;[; I";T;!0;'@T;(I"def type=(type);T;)T;*I"1def type= type @new_args[:type] = type end;T;+To; ; F; ;,;;;I"Card::Success#content=;F;[[I" content;T0;[[@ Ti=[@ Ti9;F;;X;;;[;{;IC;" ;T;@>U;.0;F;[;[; I";T;!0;'@T;(I"def content=(content);T;)T;*I"=def content= content @new_args[:content] = content end;T;+To; ; F; ;,;;;I"Card::Success#target=;F;[[I" value;T0;[[@ TiA[@ Ti=;F;: target=;;;[;{;IC;" ;T;@NU;.0;F;[;[; I";T;!0;'@T;(I"def target=(value);T;)T;*I"+def target= value @id = @name = @card = nil @target = case value when '*previous', :previous ; :previous when /^(http|\/)/ ; value when /^TEXT:\s*(.+)/ ; $1 when '' ; '' else ; self.mark = value end end;T;+To; ; F; ;,;;;I"Card::Success#apply;F;[[I" args;T0;[[@ TiM[@ TiO;F;: apply;;;[;{;IC;" ;T;@^U;.0;F;[;[; I";T;!0;'@T;(I"def apply(args);T;)T;*I"Tdef apply args args.each_pair do |key, value| self[key] = value end end;T;+To; ; F; ;,;;;I"Card::Success#target;F;[[I"name_context;TI"@name_context;T;[[@ Ti][@ Ti_;F;: target;;;[;{;IC;" ;T;@nU;.0;F;[;[; I";T;!0;'@T;(I"+def target(name_context=@name_context);T;)T;*I"def target name_context=@name_context card(name_context) || ( @target == :previous ? Card::Env.previous_location : @target ) || Card.fetch(name_context) end;T;+To; ; F; ;,;;;I"Card::Success#[]=;F;[[I"key;T0[I" value;T0;[[@ Tia[@ Tic;F;;:;;;[;{;IC;" ;T;@U;.0;F;[;[; I";T;!0;'@T;(I"def []=(key, value);T;)T;*I"def []= key, value if respond_to? "#{key}=" send "#{key}=", value elsif key.to_sym == :soft_redirect @redirect = :soft else @params.send "#{key}=", value end end;T;+To; ; F; ;,;;;I"Card::Success#[];F;[[I"key;T0;[[@ Tik[@ Tim;F;;9;;;[;{;IC;" ;T;@U;.0;F;[;[; I";T;!0;'@T;(I"def [](key);T;)T;*I"def [] key if respond_to? key.to_sym send key.to_sym elsif key.to_sym == :soft_redirect @redirect == :soft else @params.send key.to_sym end end;T;+To; ; F; ;,;;;I"Card::Success#to_url;F;[[I"name_context;TI"@name_context;T;[[@ Tiy[@ Ti{;F;: to_url;;;[;{;IC;" ;T;@U;.0;F;[;[; I";T;!0;'@T;(I"+def to_url(name_context=@name_context);T;)T;*I"def to_url name_context=@name_context case (target = target(name_context)) when Card page_path target.cardname, params else target end end;T;+To; ; F; ;,;;;I"!Card::Success#method_missing;F;[[I" method;T0[I" *args;T0;[[@ Ti}[@ Ti;F;;@;;;[;{;IC;" ;T;@U;.0;F;[;[; I";T;!0;'@T;(I"&def method_missing(method, *args);T;)T;*I"def method_missing method, *args case method when /^(\w+)=$/ self[$1.to_sym] = args[0] when /^(\w+)$/ self[$1.to_sym] else super end end;T;+To; ; F; ;,;;;I"Card::Success#session;F;[;[[@ Ti[@ Ti;F;;<;;;[;{;IC;" ;T;@U;.0;F;[;[; I";T;!0;'@T;(I"def session;T;)T;*I"(def session Card::Env.session end;T;+To; ; F; ;,;;;I"!Card::Success#process_target;F;[[I" value;T0;[[@ TiB;F;:process_target;;;[;{;IC;" ;T;@U;.0;F;[;[; I";T;!0;'@T;(I"def process_target value;T;)T;*I"Udef process_target value case value when '' then '' when '*previous', :previous then :previous when /^(http|\/)/ then value when /^TEXT:\s*(.+)/ then Regexp.last_match(1) when /^REDIRECT:\s*(.+)/ @redirect = true process_target Regexp.last_match(1) else self.mark = value end end;T;+T;I@T;JIC;[;I@T;KIC;[o;S ;T0;UI"Card::Location;T;V@T;;;'@;W@VS;X;Y;I@T;LIC;M{; IC;M{;NT;,IC;M{ ;;IC;M{;C@T;D@T;NT;$IC;M{;C@(T;D@5T;NT;&IC;M{;C@HT;D@UT;NT;(IC;M{;C@jT;D@wT;NT;IC;M{;C@T;D@T;NT;*IC;M{;C@T;D@T;NT;NT;NT;O{;P[;[[@ Ti;F;: Success;;;;;[;{;IC;" ;T;@T;.0;F;[;[; I";T;!0;'@;I"Card::Success;F;Io;S ;T0;U0;V0;;J;'@;W@;X; ;+To;7;IC;[o; ; F; ; ;;;I"Card::Version.release;F;[;[[I"lib/card/version.rb;Ti [I"lib/card/version.rb;Ti ;F;: release;;;[;{;IC;" ;T;@U;.0;F;[;[; I";T;!0;'@U;(I"def release;T;)T;*I"edef release @@version ||= File.read( File.expand_path '../../../VERSION', __FILE__ ).strip end;T;+T;I@U;JIC;[;I@U;KIC;[;I@U;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Vi;F;;;;;;;[;{;IC;" ;T;@U;.0;F;[;[; I";T;!0;'o;S ;T0;U0;V0;;d;'@;W@;X0;I"Card::Version;Fo; ;IC;[o; ; F; ;,;;;I"Card::Content#revision;F;[;[[I"lib/card/content.rb;Ti ;F;;y;;;[;{;IC;",Returns the value of attribute revision ;T;@V;.0;F;[;[; I",Returns the value of attribute revision;T;!0;'@V;(I"def revision;T;*I"!def revision @revision end;T;+To; ; F; ;,;;;I"Card::Content#format;F;[;[[@$Vi ;F;;`;;;[;{;IC;"*Returns the value of attribute format ;T;@-V;.0;F;[;[; I"*Returns the value of attribute format;T;!0;'@V;(I"def format;T;*I"def format @format end;T;+To; ; F; ;,;;;I"Card::Content#chunks;F;[;[[@$Vi ;F;: chunks;;;[;{;IC;"*Returns the value of attribute chunks ;T;@:V;.0;F;[;[; I"*Returns the value of attribute chunks;T;!0;'@V;(I"def chunks;T;*I"def chunks @chunks end;T;+To; ; F; ;,;;;I"Card::Content#opts;F;[;[[@$Vi ;F;: opts;;;[;{;IC;"(Returns the value of attribute opts ;T;@GV;.0;F;[;[; I"(Returns the value of attribute opts;T;!0;'@V;(I" def opts;T;*I"def opts @opts end;T;+To; ; F; ;,;;;I"Card::Content#initialize;F;[[I" content;T0[I"format_or_card;T0[I" opts;TI"{};T;[[@$Vi;F;;C;;;[;{;IC;" ;T;@TV;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of Content;T;0;3[I" Content;F;@TV; I";T;!0;'@V;(I"5def initialize(content, format_or_card, opts={});T;)T;*I"def initialize content, format_or_card, opts={} @format = if Card===format_or_card Format.new format_or_card, format: nil else format_or_card end @opts = opts || {} unless Array === content content = parse_content content end super content end;T;+To; ; F; ;,;;;I"Card::Content#card;F;[;[[@$Vi[I"lib/card/content.rb;Ti;F;;;;;[;{;IC;" ;T;@mV;.0;F;[;[; I";T;!0;'@V;(I" def card;T;)T;*I"def card format.card end;T;+To; ; F; ;,;;;I"Card::Content#chunk_list;F;[;[[@$Vi"[@sVi ;F;:chunk_list;;;[;{;IC;" ;T;@|V;.0;F;[;[; I";T;!0;'@V;(I"def chunk_list;T;)T;*I"Bdef chunk_list @opts[:chunk_list] || @format.chunk_list end;T;+To; ; F; ;,;;;I"Card::Content#to_s;F;[;[[@$Vi&[@sVi$;F;;;;;[;{;IC;" ;T;@V;.0;F;[;[; I";T;!0;'@V;(I" def to_s;T;)T;*I"def to_s case __getobj__ when Array; map(&:to_s)*'' when String; __getobj__ when NilClass; '' #raise "Nil Card::Content" else __getobj__.to_s end end;T;+To; ; F; ;,;;;I"Card::Content#inspect;F;[;[[@$Vi/[@sVi-;F;;;;;[;{;IC;" ;T;@V;.0;F;[;[; I";T;!0;'@V;(I"def inspect;T;)T;*I">def inspect "<#{__getobj__.class}:#{card}:#{self}>" end;T;+To; ; F; ;,;;;I"Card::Content#each_chunk;F;[;[[@$Vi3[@sVi1;F;:each_chunk;;;[;{;IC;" ;T;@V;.0;F;[;[; I";T;!0;'@V;(I"def each_chunk;T;)T;*I"def each_chunk return enum_for(:each_chunk) unless block_given? case __getobj__ when Hash; each { |k,v| yield v if Chunk::Abstract===v } when Array; each { |e| yield e if Chunk::Abstract===e } when String; # strings are all parsed in self, so no chunks in a String else Rails.logger.warn "error self is unrecognized type #{self.class} #{self.__getobj__.class}" end end;T;+To; ; F; ;,;;;I"Card::Content#find_chunks;F;[[I"chunk_type;T0;[[@$Vi>[@sVi=;F;:find_chunks;;;[;{;IC;" ;T;@V;.0;F;[;[; I";T;!0;'@V;(I" def find_chunks(chunk_type);T;)T;*I"^def find_chunks chunk_type each_chunk.select { |chunk| chunk.kind_of?(chunk_type) } end;T;+To; ; F; ;,;;;I")Card::Content#process_content_object;F;[[I" &block;T0;[[@$ViB;F;;;;;[;{;IC;" ;T;@V;.0;F;[;[; I";T;!0;'@V;(I"&def process_content_object &block;T;)T;*I"edef process_content_object &block each_chunk { |chunk| chunk.process_chunk &block } self end;T;+To; ; F; ;,;;;I" Card::Content#parse_content;F;[[I" content;T0;[[@$ViG;F;:parse_content;;;[;{;IC;" ;T;@V;.0;F;[;[; I";T;!0;'@V;(I"def parse_content content;T;)T;*I" def parse_content content @chunks = [] if String===content position = last_position = 0 prefix_regexp = Chunk.get_prefix_regexp chunk_list interval_string = '' while prefix_match = content[position..-1].match( prefix_regexp ) prefix = prefix_match[0] # prefix of matched chunk chunk_start = prefix_match.begin(0) + position # content index of beginning of chunk if prefix_match.begin(0) > 0 # if matched chunk is not beginning of test string interval_string += content[ position..chunk_start-1 ] # hold onto the non-chunk part of the string end chunk_class = Chunk.find_class_by_prefix prefix # get the chunk class from the prefix match, offset = chunk_class.full_match content[chunk_start..-1], prefix # see whether the full chunk actually matches (as opposed to bogus prefix) context_ok = chunk_class.context_ok? content, chunk_start # make sure there aren't contextual reasons for ignoring this chunk position = chunk_start # move scanning position up to beginning of chunk if match # we have a chunk match position += ( match.end(0) - offset.to_i ) # move scanning position up to end of chunk if context_ok # @chunks << interval_string if interval_string.size > 0 # add the nonchunk string to the chunk list @chunks << chunk_class.new( match, self ) # add the chunk to the chunk list interval_string = '' # reset interval string for next go-round last_position = position # note that the end of the chunk was the last place where a chunk was found (so far) end else position += 1 # no match. look at the next character end if !match || !context_ok interval_string += content[chunk_start..position-1] # moving beyond the alleged chunk. append failed string to "nonchunk" string end end end if chunks.any? if last_position < content.size remainder = content[ last_position..-1] # handle any leftover nonchunk string at the end of content @chunks << remainder end chunks else content end end;T;+To;4;[[@$Vi|[@sViF;F;:ALLOWED_TAGS;;;;;[;{;IC;" ;T;@V;.0;F;[;[; I";T;!0;'@V;I" Card::Content::ALLOWED_TAGS;F;(I"ALLOWED_TAGS = {};T;*I"ALLOWED_TAGS = {};T;6I"{};T;+To;4;[[@$Vi[@sVi_;F;:ATTR_VALUE_RE;;;;;[;{;IC;" ;T;@V;.0;F;[;[; I";T;!0;'@V;I"!Card::Content::ATTR_VALUE_RE;F;(I"MATTR_VALUE_RE = [/(?<=^')[^']+(?=')/, /(?<=^")[^"]+(?=")/, /\S+/].freeze;T;*I"MATTR_VALUE_RE = [/(?<=^')[^']+(?=')/, /(?<=^")[^"]+(?=")/, /\S+/].freeze;T;6I"=[/(?<=^')[^']+(?=')/, /(?<=^")[^"]+(?=")/, /\S+/].freeze;T;+To; ; F; ; ;;;I"Card::Content.clean!;F;[[I" string;T0[I" tags;TI"ALLOWED_TAGS;T;[[@$Vi[@sVig;T;: clean!;;;[;{;IC;"Qthis has been hacked for card to allow classes if the class begins with "w-" ;T;@V;F;[;[; I"Qthis has been hacked for card to allow classes if the class begins with "w-";T;!0;"o;#;$F;%ie;&if;'@V;(I"*def clean!(string, tags=ALLOWED_TAGS);T;)T;*I"Gdef clean!( string, tags = ALLOWED_TAGS ) string.gsub( /<(\/*)(\w+)([^>]*)>/ ) do raw = $~ tag = raw[2].downcase if attrs = tags[tag] "<#{raw[1]}#{ attrs.inject([tag]) do |pcs, attr| q='"' rest_value=nil if raw[3] =~ /\b#{attr}\s*=\s*(?=(.))/i rest_value = $' idx = %w{' "}.index($1) and q = $1 re = ATTR_VALUE_RE[ idx || 2 ] if match = rest_value.match(re) rest_value = match[0] if attr == 'class' rest_value = rest_value.split(/\s+/).find_all {|s| s=~/^w-/i}*' ' end end end pcs << "#{attr}=#{q}#{rest_value}#{q}" unless rest_value.blank? pcs end * ' ' }>" else " " end end.gsub(/<\!--.*?-->/, '') end;T;+To; ; F; ;,;;;I")Card::Content#clean_with_space_last!;F;[[I" string;T0[I" tags;TI"ALLOWED_TAGS;T;[[@$Vi[@sVi;F;:clean_with_space_last!;;;[;{;IC;" ;T;@W;.0;F;[;[; I";T;!0;'@V;(I":def clean_with_space_last!(string, tags=ALLOWED_TAGS);T;)T;*I"def clean_with_space_last! string, tags = ALLOWED_TAGS clean_without_space_last!(string, tags).gsub(/(?:^|\b) ((?: )+)/, '\1 ') end;T;+To; ; F; ; ;;;I"2Card::Content.truncatewords_with_closing_tags;F;[[I" input;T0[I" words;TI"25;T[I"_truncate_string;TI" '...';T;[[@$Vi[@sVi;F;:$truncatewords_with_closing_tags;;;[;{;IC;" ;T;@%W;.0;F;[;[; I";T;!0;'@V;(I"{def truncatewords_with_closing_tags(input, words=25, _truncate_string='...');T;)T;*I"def truncatewords_with_closing_tags(input, words = 25, truncate_string = "...") if input.nil? then return end wordlist = input.to_s.split l = words.to_i - 1 l = 0 if l < 0 wordstring = wordlist.length > l ? wordlist[0..l].join(" ") : input.to_s # nuke partial tags at end of snippet wordstring.gsub!(/(<[^\>]+)$/,'') tags = [] # match tags with or without self closing (ie. ) wordstring.scan(/\<([^\>\s\/]+)[^\>]*?\>/).each { |t| tags.unshift(t[0]) } # match tags with self closing and mark them as closed wordstring.scan(/\<([^\>\s\/]+)[^\>]*?\/\>/).each { |t| if !(x=tags.index(t[0])).nil? then tags.slice!(x) end } # match close tags wordstring.scan(/\<\/([^\>\s\/]+)[^\>]*?\>/).each { |t| if !(x=tags.rindex(t[0])).nil? then tags.slice!(x) end } tags.each {|t| wordstring += "" } wordstring +='...' if wordlist.length > l # wordstring += '...' if wordlist.length > l wordstring.gsub! /<[\/]?br[\s\/]*>/, ' ' ## Also a hack -- get rid of
's -- they make line view ugly. wordstring.gsub! /<[\/]?p[^>]*>/, ' ' ## Also a hack -- get rid of
's -- they make line view ugly. wordstring end;T;+To; ; F; ;,;;;I"%Card::Content#process_each_chunk;F;[[I" &block;T0;[[@sViA;F;:process_each_chunk;;;[;{;IC;" ;T;@;W;.0;F;[;[; I";T;!0;'@V;(I""def process_each_chunk &block;T;)T;*I"bdef process_each_chunk &block each_chunk { |chunk| chunk.process_chunk(&block) } self end;T;+To; ; F; ; ;;;I"$Card::Content.process_attribute;F;[[I" attr;T0[I"all_attributes;T0;[[@sVix;F;:process_attribute;;;[;{;IC;" ;T;@JW;.0;F;[;[; I";T;!0;'@V;(I"/def process_attribute attr, all_attributes;T;)T;*I"def process_attribute attr, all_attributes return ['"', nil] unless all_attributes =~ /\b#{attr}\s*=\s*(?=(.))/i q = '"' rest_value = $' (idx = %w(' ").index(Regexp.last_match(1))) && (q = Regexp.last_match(1)) re = ATTR_VALUE_RE[idx || 2] if (match = rest_value.match(re)) rest_value = match[0] if attr == 'class' rest_value = rest_value.split(/\s+/).select { |s| s =~ /^w-/i }.join(' ') end end [q, rest_value] end;T;+To; ; F; ; ;;;I";F;[[I"wordstring;T0;[[@sVi;F;:find_tags;;;[;{;IC;" ;T;@[W;.0;F;[;[; I";T;!0;'@V;(I"def find_tags wordstring;T;)T;*I"def find_tags wordstring tags = [] # match tags with or without self closing (ie. ) wordstring.scan(%r{\<([^\>\s/]+)[^\>]*?\>}).each do |t| tags.unshift(t[0]) end # match tags with self closing and mark them as closed wordstring.scan(%r{\<([^\>\s/]+)[^\>]*?/\>}).each do |t| next unless (x = tags.index(t[0])) tags.slice!(x) end # match close tags wordstring.scan(%r{\\s/]+)[^\>]*?\>}).each do |t| next unless (x = tags.rindex(t[0])) tags.slice!(x) end tags end;T;+To;7;IC;[ o;[;[[I"lib/card/content/chunk.rb;Ti;F;:@@raw_list;;;;;[;{;IC;" ;T;@lW;.0;F;[;[; I";T;!0;'@jW;I"%Card::Content::Chunk::@@raw_list;F;(I"@@raw_list = {};T;*I"@@raw_list = {};T;6I"{};T;+To;[;[[@oWi;F;:@@prefix_regexp_by_list;;;;;[;{;IC;" ;T;@zW;.0;F;[;[; I";T;!0;'@jW;I"2Card::Content::Chunk::@@prefix_regexp_by_list;F;(I"!@@prefix_regexp_by_list = {};T;*I"!@@prefix_regexp_by_list = {};T;6I"{};T;+To;[;[[@oWi;F;:@@prefix_map;;;;;[;{;IC;" ;T;@W;.0;F;[;[; I";T;!0;'@jW;I"'Card::Content::Chunk::@@prefix_map;F;(I"@@prefix_map = {};T;*I"@@prefix_map = {};T;6I"{};T;+To; ; F; ; ;;;I"(Card::Content::Chunk.register_class;F;[[I" klass;T0[I" hash;T0;[[@oWi;F;;;;;[;{;IC;" ;T;@W;.0;F;[;[; I";T;!0;'@jW;(I"#def register_class klass, hash;T;)T;*I"def register_class klass, hash klass.config = hash.merge class: klass prefix_index = hash[:idx_char] || :default # ^ this is gross and needs to be moved out. prefix_map[prefix_index] = klass.config end;T;+To; ; F; ; ;;;I"'Card::Content::Chunk.register_list;F;[[I"key;T0[I" list;T0;[[@oWi;F;;;;;[;{;IC;" ;T;@W;.0;F;[;[; I";T;!0;'@jW;(I" def register_list key, list;T;)T;*I";def register_list key, list raw_list[key] = list end;T;+To; ; F; ; ;;;I".Card::Content::Chunk.find_class_by_prefix;F;[[I" prefix;T0;[[@oWi#;F;;;;;[;{;IC;" ;T;@W;.0;F;[;[; I";T;!0;'@jW;(I"$def find_class_by_prefix prefix;T;)T;*I"def find_class_by_prefix prefix config = prefix_map[prefix[0, 1]] || prefix_map[prefix[-1, 1]] || prefix_map[:default] # prefix identified by first character, last character, or default. # a little ugly... config[:class] end;T;+To; ; F; ; ;;;I"+Card::Content::Chunk.get_prefix_regexp;F;[[I"chunk_list_key;T0;[[@oWi,;F;;;;;[;{;IC;" ;T;@W;.0;F;[;[; I";T;!0;'@jW;(I")def get_prefix_regexp chunk_list_key;T;)T;*I"def get_prefix_regexp chunk_list_key prefix_regexp_by_list[chunk_list_key] ||= begin prefix_res = raw_list[chunk_list_key].map do |chunkname| chunk_class = const_get chunkname chunk_class.config[:prefix_re] end /(?:#{ prefix_res * '|' })/m end end;T;+To; ;IC;[o; ; F; ;,;;;I"(Card::Content::Chunk::Abstract#text;F;[;[[@oWiB;F;;;;;[;{;IC;"(Returns the value of attribute text ;T;@W;.0;F;[;[; I"(Returns the value of attribute text;T;!0;'@W;(I" def text;T;*I"def text @text end;T;+To; ; F; ;,;;;I"1Card::Content::Chunk::Abstract#process_chunk;F;[;[[@oWiB;F;;;;;[;{;IC;"1Returns the value of attribute process_chunk ;T;@W;.0;F;[;[; I"1Returns the value of attribute process_chunk;T;!0;'@W;(I"def process_chunk;T;*I"+def process_chunk @process_chunk end;T;+To; ; F; ; ;;;I".Card::Content::Chunk::Abstract.full_match;F;[[I" content;T0[I" prefix;TI"nil;T;[[@oWiF;T;;;;;[;{;IC;"Hif the prefix regex matched check that chunk against the full regex ;T;@W;F;[;[; I"Hif the prefix regex matched check that chunk against the full regex;T;!0;"o;#;$F;%iE;&iE;'@W;(I"'def full_match content, prefix=nil;T;)T;*I"Kdef full_match content, prefix=nil content.match full_re(prefix) end;T;+To; ; F; ; ;;;I"+Card::Content::Chunk::Abstract.full_re;F;[[I" _prefix;T0;[[@oWiJ;F;;;;;[;{;IC;" ;T;@X;.0;F;[;[; I";T;!0;'@W;(I"def full_re _prefix;T;)T;*I"/def full_re _prefix config[:full_re] end;T;+To; ; F; ; ;;;I"/Card::Content::Chunk::Abstract.context_ok?;F;[[I" _content;T0[I"_chunk_start;T0;[[@oWiN;F;;;;;[;{;IC;" ;T;@X;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@X; I";T;!0;'@W;(I"+def context_ok? _content, _chunk_start;T;)T;*I"6def context_ok? _content, _chunk_start true end;T;+To; ; F; ;,;;;I"2Card::Content::Chunk::Abstract#reference_code;F;[;[[@oWiS;F;:reference_code;;;[;{;IC;" ;T;@(X;.0;F;[;[; I";T;!0;'@W;(I"def reference_code;T;)T;*I"!def reference_code 'I' end;T;+To; ; F; ;,;;;I".Card::Content::Chunk::Abstract#initialize;F;[[I" match;T0[I" content;T0;[[@oWiW;F;;C;;;[;{;IC;" ;T;@5X;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of Abstract;T;0;3[I" Abstract;F;@5X; I";T;!0;'@W;(I""def initialize match, content;T;)T;*I"~def initialize match, content @text = match[0] @processed = nil @content = content interpret match, content self end;T;+To; ; F; ;,;;;I"-Card::Content::Chunk::Abstract#interpret;F;[[I"_match_string;T0[I" _content;T0[I" _params;T0;[[@oWi_;F;;;;;[;{;IC;" ;T;@KX;.0;F;[;[; I";T;!0;'@W;(I"3def interpret _match_string, _content, _params;T;)T;*I"def interpret _match_string, _content, _params Rails.logger.info 'no #interpret method found for chunk class: ' \ "#{self.class}" end;T;+To; ; F; ;,;;;I"*Card::Content::Chunk::Abstract#format;F;[;[[@oWid;F;;`;;;[;{;IC;" ;T;@^X;.0;F;[;[; I";T;!0;'@W;(I"def format;T;)T;*I"%def format @content.format end;T;+To; ; F; ;,;;;I"(Card::Content::Chunk::Abstract#card;F;[;[[@oWih;F;;;;;[;{;IC;" ;T;@kX;.0;F;[;[; I";T;!0;'@W;(I" def card;T;)T;*I"!def card @content.card end;T;+To; ; F; ;,;;;I"(Card::Content::Chunk::Abstract#to_s;F;[;[[@oWil;F;;;;;[;{;IC;" ;T;@xX;.0;F;[;[; I";T;!0;'@W;(I" def to_s;T;)T;*I"9def to_s @process_chunk || @processed || @text end;T;+To; ; F; ;,;;;I"+Card::Content::Chunk::Abstract#inspect;F;[;[[@oWip;F;;;;;[;{;IC;" ;T;@X;.0;F;[;[; I";T;!0;'@W;(I"def inspect;T;)T;*I"1def inspect "<##{self.class}##{self}>" end;T;+To; ; F; ;,;;;I"+Card::Content::Chunk::Abstract#as_json;F;[[I" _options;TI"{};T;[[@oWit;F;;;;;[;{;IC;" ;T;@X;.0;F;[;[; I";T;!0;'@W;(I"def as_json _options={};T;)T;*I"ydef as_json _options={} @process_chunk || @processed || "not rendered #{self.class}, #{card && card.name}" end;T;+T;I@W;JIC;[;I@W;KIC;[;I@W;LIC;M{; IC;M{;NT;,IC;M{;IC;M{;C@W;D0;NT;IC;M{;C@W;D0;NT;NT;NT;O{;P[;[[@oWi@;F;;.;;;;;[;{;IC;" ;T;@W;.0;F;[;[; I";T;!0;'@jW;I"#Card::Content::Chunk::Abstract;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+T;I@jW;JIC;[;I@jW;KIC;[;I@jW;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@oWi;T;;;;;;;[;{;IC;"A chunk is a pattern of text that can be protected and interrogated by a format. Each Chunk class has a +pattern+ that states what sort of text it matches. Chunks are initalized by passing in the result of a match by its pattern. ;T;@jW;F;[;[; I"A chunk is a pattern of text that can be protected and interrogated by a format. Each Chunk class has a +pattern+ that states what sort of text it matches. Chunks are initalized by passing in the result of a match by its pattern.;T;!0;"o;#;$F;%i ;&i;'@V;I" QG;F;+To; ;IC;[o; ; F; ;,;;;I"%Card::Content::Parser#initialize;F;[[I"chunk_list;T0;[[I"lib/card/content/parser.rb;Ti ;F;;C;;;[;{;IC;" ;T;@X;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of Parser;T;0;3[I" Parser;F;@X; I";T;!0;'@X;(I"def initialize chunk_list;T;)T;*I"=def initialize chunk_list @chunk_list = chunk_list end;T;+To; ; F; ;,;;;I" Card::Content::Parser#parse;F;[[I" content;T0[I"content_object;T0;[[@Xi;F;: parse;;;[;{;IC;" ;T;@X;.0;F;[;[; I";T;!0;'@X;(I"&def parse content, content_object;T;)T;*I"def parse content, content_object chunks = [] return chunks unless content.is_a? String position = last_position = 0 prefix_regexp = Chunk.get_prefix_regexp @chunk_list interval_string = '' while (prefix_match = content[position..-1].match(prefix_regexp)) prefix = prefix_match[0] # prefix of matched chunk chunk_start = prefix_match.begin(0) + position # content index of beginning of chunk if prefix_match.begin(0) > 0 # if matched chunk is not beginning of test string interval_string += content[position..chunk_start - 1] # hold onto the non-chunk part of the string end chunk_class = Chunk.find_class_by_prefix prefix # get the chunk class from the prefix match, offset = chunk_class.full_match content[chunk_start..-1], prefix # see whether the full chunk actually matches # (as opposed to bogus prefix) context_ok = chunk_class.context_ok? content, chunk_start # make sure there aren't contextual reasons for ignoring this chunk position = chunk_start # move scanning position up to beginning of chunk if match # we have a chunk match position += (match.end(0) - offset.to_i) # move scanning position up to end of chunk if context_ok chunks << interval_string unless interval_string.empty? # add the nonchunk string to the chunk list chunks << chunk_class.new(match, content_object) # add the chunk to the chunk list interval_string = '' # reset interval string for next go-round last_position = position # note that the end of the chunk was the last place where a # chunk was found (so far) end else position += 1 # no match. look at the next character end next unless !match || !context_ok interval_string += content[chunk_start..position - 1] # moving beyond the alleged chunk. # append failed string to "nonchunk" string end if chunks.any? && last_position < content.size remainder = content[last_position..-1] # handle any leftover nonchunk string at the end of content chunks << remainder end chunks end;T;+T;I@X;JIC;[;I@X;KIC;[;I@X;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Xi ;F;: Parser;;;;;[;{;IC;" ;T;@X;.0;F;[;[; I";T;!0;'@V;I"header: { content: St;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+T;I@V;JIC;[;I@V;KIC;[;I@V;LIC;M{; IC;M{;NT;,IC;M{ ;yIC;M{;C@V;D0;NT;`IC;M{;C@-V;D0;NT;6IC;M{;C@:V;D0;NT;7IC;M{;C@GV;D0;NT;NT;NT;O{;P[;[[@$Vi [@oWi [@Xi ;F;;b;;;;;[;{;IC;" ;T;@V;.0;F;[;[; I";T;!0;'@;I"Card::Content;F;Io;S ;T0;U0;V0;:SimpleDelegator;'@;W0;X; ;+To; ;IC;[o;[;[[I"lib/card/codename.rb;Ti [I"lib/card/codename.rb;Ti ;F;:@@codehash;;;;;[;{;IC;" ;T;@Y;.0;F;[;[; I";T;!0;'@Y;I"Card::Codename::@@codehash;F;(I"@@codehash = nil;T;*I"@@codehash = nil;T;6I"nil;T;+To; ; F; ; ;;;I"Card::Codename.[];F;[[I"key;T0;[[@Yi[@Yi;T;;9;;;[;{;IC;"Mreturns codename for id and vice versa. not in love with this api --efm ;T;@(Y;F;[;[; I"Mreturns codename for id and vice versa. not in love with this api --efm;T;!0;"o;#;$F;%i;&i;'@Y;(I"def [](key);T;)T;*I"ddef [] key if !key.nil? key = key.to_sym unless Integer===key codehash[key] end end;T;+To; ; F; ; ;;;I"Card::Codename.codehash;F;[;[[@Yi[@Yi;F;: codehash;;;[;{;IC;" ;T;@9Y;.0;F;[;[; I";T;!0;'@Y;(I"def codehash;T;)T;*I"/def codehash @@codehash || load_hash end;T;+To; ; F; ; ;;;I"Card::Codename.reset_cache;F;[;[[@Yi[@Yi;F;:reset_cache;;;[;{;IC;" ;T;@GY;.0;F;[;[; I";T;!0;'@Y;(I"def reset_cache;T;)T;*I"Idef reset_cache @@codehash = nil cache.write 'CODEHASH', nil end;T;+To; ; F; ; ;;;I"Card::Codename.bootdata;F;[[I" hash;T0;[[@Yi"[@Yi ;T;: bootdata;;;[;{;IC;"only used in migration ;T;@UY;F;[;[; I"only used in migration;T;!0;"o;#;$F;%i;&i;'@Y;(I"def bootdata(hash);T;)T;*I".def bootdata hash @@codehash = hash end;T;+To; ; F; ; ;;;I"Card::Codename.cache;F;[;[[@Yi)[@Yi&;F;;;;;[;{;IC;" ;T;@fY;.0;F;[;[; I";T;!0;'@Y;(I"def cache;T;)T;*I"*def cache Card::Cache[Codename] end;T;+To; ; F; ; ;;;I"Card::Codename.load_hash;F;[;[[@Yi-[@Yi8;F;:load_hash;;;[;{;IC;" ;T;@tY;.0;F;[;[; I";T;!0;'@Y;(I"def load_hash;T;)T;*I"Ndef load_hash @@codehash = cache.read('CODEHASH') || begin codehash = {} sql = 'select id, codename from cards where codename is not NULL' ActiveRecord::Base.connection.select_all(sql).each do |row| #FIXME: remove duplicate checks, put them in other tools code, cid = row['codename'].to_sym, row['id'].to_i if codehash.has_key?(code) or codehash.has_key?(cid) warn "dup code ID:#{cid} (#{codehash[code]}), CD:#{code} (#{codehash[cid]})" end codehash[code] = cid; codehash[cid] = code end cache.write 'CODEHASH', codehash end end;T;+To; ; F; ; ;;;I"'Card::Codename.each_codenamed_card;F;[;[[@Yi*;F;:each_codenamed_card;;;[;{;IC;" ;T;@Y;.0;F;[;[; I";T;!0;'@Y;(I"def each_codenamed_card;T;)T;*I"def each_codenamed_card sql = 'select id, codename from cards where codename is not NULL' ActiveRecord::Base.connection.select_all(sql).each do |row| yield row['codename'].to_sym, row['id'].to_i end end;T;+To; ; F; ; ;;;I"$Card::Codename.check_duplicates;F;[[I" codehash;T0[I" codename;T0[I" card_id;T0;[[@Yi1;F;:check_duplicates;;;[;{;IC;" ;T;@Y;.0;F;[;[; I";T;!0;'@Y;(I"5def check_duplicates codehash, codename, card_id;T;)T;*I")def check_duplicates codehash, codename, card_id # FIXME: remove duplicate checks here; should be caught upon creation return unless codehash.key?(codename) || codehash.key?(card_id) warn "dup code ID:#{card_id} (#{codehash[codename]}), " \ "CD:#{codename} (#{codehash[card_id]})" end;T;+T;I@Y;JIC;[;I@Y;KIC;[;I@Y;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Yi ;F;: Codename;;;;;[;{;IC;" ;T;@Y;.0;F;[;[; I";T;!0;'@;I"Card::Codename;F;Io;S ;T0;U0;V0;;J;'@;W@;X; ;+To; ; F; ; ;;;I"Card.const_missing;F;[[I" const;T0;[[@YiA[@YiF;F;:const_missing;;;[;{;IC;" ;T;@Y;.0;F;[;[; I";T;!0;'@;(I"def const_missing(const);T;)T;*I"def self.const_missing const if const.to_s =~ /^([A-Z]\S*)ID$/ and code=$1.underscore.to_sym if card_id = Codename[code] const_set const, card_id else raise "Missing codename #{code} (#{const})" end else super end end;T;+T@VSo; ;IC;[o; ; F; ; ;;;I"Card::Migration.type;F;[;[[I"lib/card/migration.rb;Ti[I"lib/card/migration.rb;Ti;T;: type;;;[;{;IC;"Rake tasks use class methods, migrations use instance methods. To avoid repetition a lot of instance methods here just call class methods. The subclass Card::CoreMigration needs a different @type so we can't use a class variable @@type. It has to be a class instance variable. Migrations are subclasses of Card::Migration or Card::CoreMigration but they don't inherit the @type. The method below solves this problem. ;T;@Y;F;[;[; I"Rake tasks use class methods, migrations use instance methods. To avoid repetition a lot of instance methods here just call class methods. The subclass Card::CoreMigration needs a different @type so we can't use a class variable @@type. It has to be a class instance variable. Migrations are subclasses of Card::Migration or Card::CoreMigration but they don't inherit the @type. The method below solves this problem.;T;!0;"o;#;$F;%i ;&i;'@Y;(I" def type;T;)T;*I"@def type @type || (ancestors[1] && ancestors[1].type) end;T;+To; ; F; ; ;;;I"%Card::Migration.find_unused_name;F;[[I"base_name;T0;[[@Yi[@Yi;F;:find_unused_name;;;[;{;IC;" ;T;@Y;.0;F;[;[; I";T;!0;'@Y;(I"$def find_unused_name(base_name);T;)T;*I"def find_unused_name base_name test_name = base_name add = 1 while Card.exists?(test_name) do test_name = "#{base_name}#{add}" add +=1 end test_name end;T;+To; ; F; ; ;;;I"$Card::Migration.migration_paths;F;[[I" mig_type;TI" type;T;[[@Yi![@Yi";F;:migration_paths;;;[;{;IC;" ;T;@Y;.0;F;[;[; I";T;!0;'@Y;(I"'def migration_paths(mig_type=type);T;)T;*I"Ldef migration_paths mig_type=type Cardio.migration_paths mig_type end;T;+To; ; F; ; ;;;I"Card::Migration.schema;F;[[I" mig_type;TI" type;T;[[@Yi%[@Yi&;F;: schema;;;[;{;IC;" ;T;@Y;.0;F;[;[; I";T;!0;'@Y;(I"def schema(mig_type=type);T;)T;*I":def schema mig_type=type Cardio.schema mig_type end;T;+To; ; F; ; ;;;I""Card::Migration.schema_suffix;F;[[I" mig_type;TI" type;T;[[@Yi)[@Yi*;F;:schema_suffix;;;[;{;IC;" ;T;@Z;.0;F;[;[; I";T;!0;'@Y;(I"%def schema_suffix(mig_type=type);T;)T;*I"Hdef schema_suffix mig_type=type Cardio.schema_suffix mig_type end;T;+To; ; F; ; ;;;I" Card::Migration.schema_mode;F;[[I" mig_type;TI" type;T;[[@Yi-[@Yi.;F;:schema_mode;;;[;{;IC;" ;T;@Z;.0;F;[;[o;0 ;1I" yield;F;2I";T;0;3[I" paths;T;@Z; I";T;!0;'@Y;(I"#def schema_mode(mig_type=type);T;)T;*I"Xdef schema_mode mig_type=type new_suffix = schema_suffix mig_type original_suffix = ActiveRecord::Base.table_name_suffix ActiveRecord::Base.table_name_suffix = new_suffix ActiveRecord::SchemaMigration.reset_table_name yield ActiveRecord::Base.table_name_suffix = original_suffix ActiveRecord::SchemaMigration.reset_table_name end;T;+To; ; F; ; ;;;I"1Card::Migration.assume_migrated_upto_version;F;[;[[@Yi8[@Yi:;F;:!assume_migrated_upto_version;;;[;{;IC;" ;T;@/Z;.0;F;[;[; I";T;!0;'@Y;(I"%def assume_migrated_upto_version;T;)T;*I"def assume_migrated_upto_version schema_mode do ActiveRecord::Schema.assume_migrated_upto_version schema, migration_paths end end;T;+To; ; F; ; ;;;I"Card::Migration.data_path;F;[[I" filename;TI"nil;T;[[@Yi>[@YiA;F;:data_path;;;[;{;IC;" ;T;@=Z;.0;F;[;[; I";T;!0;'@Y;(I" def data_path(filename=nil);T;)T;*I"def data_path filename=nil path = migration_paths.first File.join( [ migration_paths.first, 'data', filename ].compact ) end;T;+To; ; F; ;,;;;I" Card::Migration#contentedly;F;[;[[@YiE[@YiG;F;:contentedly;;;[;{;IC;" ;T;@NZ;.0;F;[;[; I";T;!0;'@Y;(I"def contentedly;T;)T;*I"def contentedly &block Card::Cache.reset_global Cardio.schema_mode '' do Card::Auth.as_bot do ActiveRecord::Base.transaction do begin yield ensure Card::Cache.reset_global end end end end end;T;+To; ; F; ;,;;;I" Card::Migration#import_json;F;[[I" filename;T0[I"merge_opts;TI"{};T;[[@YiT[@YiV;F;:import_json;;;[;{;IC;" ;T;@\Z;.0;F;[;[; I";T;!0;'@Y;(I"-def import_json(filename, merge_opts={});T;)T;*I"def import_json filename, merge_opts={} Card.config.action_mailer.perform_deliveries = false merge_opts.reverse_merge! output_file: File.join(data_path,"unmerged_#{ filename }") Card.merge_list read_json(filename), merge_opts end;T;+To; ; F; ;,;;;I"Card::Migration#read_json;F;[[I" filename;T0;[[@YiZ[@Yi];F;:read_json;;;[;{;IC;" ;T;@oZ;.0;F;[;[; I";T;!0;'@Y;(I"def read_json(filename);T;)T;*I"|def read_json filename raw_json = File.read( data_path filename ) json = JSON.parse raw_json json["card"]["value"] end;T;+To; ; F; ;,;;;I"Card::Migration#data_path;F;[[I" filename;TI"nil;T;[[@Yi`[@Yic;F;;[;;;[;{;IC;" ;T;@Z;.0;F;[;[; I";T;!0;'@Y;(I" def data_path(filename=nil);T;)T;*I"Cdef data_path filename=nil self.class.data_path filename end;T;+To; ; F; ;,;;;I" Card::Migration#schema_mode;F;[;[[@Yid[@Yig;F;;Y;;;[;{;IC;" ;T;@Z;.0;F;[;[; I";T;!0;'@Y;(I"def schema_mode;T;)T;*I"=def schema_mode Cardio.schema_mode self.class.type end;T;+To; ; F; ;,;;;I"$Card::Migration#migration_paths;F;[;[[@Yih[@Yik;F;;V;;;[;{;IC;" ;T;@Z;.0;F;[;[; I";T;!0;'@Y;(I"def migration_paths;T;)T;*I";def migration_paths Cardio.paths self.class.type end;T;+To; ; F; ;,;;;I"#Card::Migration#exec_migration;F;[[I" conn;T0[I"direction;T0;[[@Yin[@Yiq;T;:exec_migration;;;[;{;IC;"jExecute this migration in the named direction copied from ActiveRecord to wrap 'up' in 'contentendly' ;T;@Z;F;[;[; I"jExecute this migration in the named direction copied from ActiveRecord to wrap 'up' in 'contentendly';T;!0;"o;#;$F;%io;&ip;'@Y;(I"(def exec_migration(conn, direction);T;)T;*I"def exec_migration(conn, direction) @connection = conn if respond_to?(:change) if direction == :down revert { change } else change end else contentedly { send(direction) } end ensure @connection = nil end;T;+To; ; F; ;,;;;I"Card::Migration#down;F;[;[[@Yi~[@Yi{;F;: down;;;[;{;IC;" ;T;@Z;.0;F;[;[o;0 ;1I" raise;F;2I";T;0;3[I"(ActiveRecord::IrreversibleMigration;T;@Z; I";T;!0;'@Y;(I" def down;T;)T;*I"=def down raise ActiveRecord::IrreversibleMigration end;T;+To; ; F; ;,;;;I"*Card::Migration#update_machine_output;F;[;[[@Yi;F;;G;;;[;{;IC;" ;T;@Z;.0;F;[;[; I";T;!0;'@Y;(I"def update_machine_output;T;)T;*I"fdef update_machine_output Card.search(right: { codename: 'machine_output' }).each(&:delete) end;T;+T;I@Y;JIC;[;I@Y;KIC;[o;S ;T0;UI"Card::ActiveRecordHelper;T;V@Y;:ActiveRecordHelper;'@;Wo;7;IC;[ o; ; F; ;,;;;I")Card::ActiveRecordHelper#create_card;F;[[I" args;T0;[[I"%lib/card/active_record_helper.rb;Ti;F;:create_card;;;[;{;IC;" ;T;@Z;.0;F;[;[; I";T;!0;'@Z;(I"def create_card args;T;)T;*I"Ndef create_card args resolve_name_conflict args Card.create! args end;T;+To; ; F; ;,;;;I"*Card::ActiveRecordHelper#create_card!;F;[[I" args;T0;[[@Zi;T;:create_card!;;;[;{;IC;"9if card with same name exists move it out of the way ;T;@Z;F;[;[; I"9if card with same name exists move it out of the way;T;!0;"o;#;$F;%i ;&i ;'@Z;(I"def create_card! args;T;)T;*I"Ydef create_card! args create_card args.reverse_merge(rename_if_conflict: :old) end;T;+To; ; F; ;,;;;I")Card::ActiveRecordHelper#update_card;F;[[I" name;T0[I" args;T0;[[@Zi;F;:update_card;;;[;{;IC;" ;T;@[;.0;F;[;[; I";T;!0;'@Z;(I"def update_card name, args;T;)T;*I"edef update_card name, args resolve_name_conflict args Card[name].update_attributes! args end;T;+To; ; F; ;,;;;I"*Card::ActiveRecordHelper#update_card!;F;[[I" args;T0;[[@Zi;F;:update_card!;;;[;{;IC;" ;T;@[;.0;F;[;[; I";T;!0;'@Z;(I"def update_card! args;T;)T;*I"Ydef update_card! args update_card args.reverse_merge(rename_if_conflict: :new) end;T;+To; ; F; ;,;;;I".Card::ActiveRecordHelper#create_or_update;F;[[I"name_or_args;T0[I" args;TI"{};T;[[@Zi;F;:create_or_update;;;[;{;IC;" ;T;@%[;.0;F;[;[; I";T;!0;'@Z;(I"/def create_or_update name_or_args, args={};T;)T;*I" def create_or_update name_or_args, args={} if name_or_args.is_a?(Hash) name = name_or_args.delete :name args = name_or_args else name = name_or_args end if Card[name] update_card name, args else create_card args.merge(name: name) end end;T;+To; ; F; ;,;;;I"/Card::ActiveRecordHelper#create_or_update!;F;[[I"name_or_args;T0[I" args;TI"nil;T;[[@Zi);F;:create_or_update!;;;[;{;IC;" ;T;@7[;.0;F;[;[; I";T;!0;'@Z;(I"1def create_or_update! name_or_args, args=nil;T;)T;*I"def create_or_update! name_or_args, args=nil if name_or_args.is_a?(Hash) name = name_or_args.delete(:name) args = name_or_args else name = name_or_args args ||= {} end create_or_update name, args.reverse_merge(rename_if_conflict: :new) end;T;+To; ; F; ;,;;;I"3Card::ActiveRecordHelper#resolve_name_conflict;F;[[I" args;T0;[[@Zi4;F;:resolve_name_conflict;;;[;{;IC;" ;T;@I[;.0;F;[;[; I";T;!0;'@Z;(I"#def resolve_name_conflict args;T;)T;*I"def resolve_name_conflict args rename = args.delete :rename_if_conflict return unless rename args[:name] = Card.uniquify_name args[:name], rename end;T;+T;I@Z;JIC;[;I@Z;KIC;[;I@Z;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Zi;F;;a;;;;;[;{;IC;" ;T;@Z;.0;F;[;[; I";T;!0;'@;I"Card::ActiveRecordHelper;F;+T;X;Y;I@Y;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Yi;F;:Migration;;;;;[;{;IC;" ;T;@Y;.0;F;[;[; I";T;!0;'o;S ;T0;U0;V0;;d;'@;W@;X0;I"Card::Migration;F;Io;S ;T0;UI"ActiveRecord::Migration;T;V@;;i;'o;S ;T0;U0;V0;:ActiveRecord;'@;Wo;7;IC;[o;7;IC;[ o; ;IC;[o; ; F; ;,;;;I"ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#match;F;[[I" string;T0;[[@[i[@[i;F;;k;;;[;{;IC;" ;T;@[;.0;F;[;[; I";T;!0;'@[;(I"def match(string);T;)T;*I"+def match(string) "~* #{string}" end;T;+T;I@[;JIC;[;I@[;KIC;[;I@[;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@[i[@[i;F;:PostgreSQLAdapter;;;;;[;{;IC;" ;T;@[;.0;F;[;[; I";T;!0;'@|[;I"8ActiveRecord::ConnectionAdapters::PostgreSQLAdapter;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+To;7;IC;[o; ; F; ;,;;;I"8ActiveRecord::ConnectionAdapters::MysqlCommon#match;F;[[I" string;T0;[[@[i[@[i;F;;k;;;[;{;IC;" ;T;@[;.0;F;[;[; I";T;!0;'@[;(I"def match(string);T;)T;*I"/def match(string) "REGEXP #{string}" end;T;+To; ; F; ;,;;;I"DActiveRecord::ConnectionAdapters::MysqlCommon#custom_cast_types;F;[;[[@[i#[@[i";F;;m;;;[;{;IC;" ;T;@[;.0;F;[;[; I";T;!0;'@[;(I"def custom_cast_types;T;)T;*I"def custom_cast_types { string: { name: 'char' }, integer: { name: 'signed' }, text: { name: 'char' }, float: { name: 'decimal' }, binary: { name: 'binary' } } end;T;+T;I@[;JIC;[;I@[;KIC;[;I@[;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@[i[@[i;F;:MysqlCommon;;;;;[;{;IC;" ;T;@[;.0;F;[;[; I";T;!0;'@|[;I"2ActiveRecord::ConnectionAdapters::MysqlCommon;F;+To; ;IC;[;I@\;JIC;[;I@\;KIC;[o;S ;T0;U0;V0;;p;'@|[;W@[;X;Y;I@\;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@[i,[@[i+;F;:MysqlAdapter;;;;;[;{;IC;" ;T;@\;.0;F;[;[; I";T;!0;'@|[;I"3ActiveRecord::ConnectionAdapters::MysqlAdapter;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+To; ;IC;[;I@*\;JIC;[;I@*\;KIC;[o;S ;T0;U0;V0;;p;'@|[;W@[;X;Y;I@*\;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@[i0[@[i/;F;:Mysql2Adapter;;;;;[;{;IC;" ;T;@*\;.0;F;[;[; I";T;!0;'@|[;I"4ActiveRecord::ConnectionAdapters::Mysql2Adapter;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+To; ;IC;[o; ; F; ;,;;;I":ActiveRecord::ConnectionAdapters::SQLiteAdapter#match;F;[[I" string;T0;[[@[i5[@[i4;F;;k;;;[;{;IC;" ;T;@A\;.0;F;[;[; I";T;!0;'@?\;(I"def match(string);T;)T;*I"/def match(string) "REGEXP #{string}" end;T;+T;I@?\;JIC;[;I@?\;KIC;[;I@?\;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@[i4[@[i3;F;:SQLiteAdapter;;;;;[;{;IC;" ;T;@?\;.0;F;[;[; I";T;!0;'@|[;I"4ActiveRecord::ConnectionAdapters::SQLiteAdapter;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+T;I@|[;JIC;[;I@|[;KIC;[;I@|[;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@[i [@[i;F;:ConnectionAdapters;;;;;[;{;IC;" ;T;@|[;.0;F;[;[; I";T;!0;'@z[;I"%ActiveRecord::ConnectionAdapters;F;+To;7;IC;[o; ; F; ;,;;;I"AActiveRecord::Transactions#with_transaction_returning_status;F;[;[[@[iA[@[i@;T;;;;;[;{;IC;" FIXME!! the following code is already in Rails 4 (see https://github.com/rails/rails/commit/c8792c7b2ea4f5fe7a5610225433ea8dd8d0f83e) it allows manual rollbacks in after_save (eg store events) to reset the object correctly hopefully we can soon get rid of this code! ;T;@v\;F;[;[; I" FIXME!! the following code is already in Rails 4 (see https://github.com/rails/rails/commit/c8792c7b2ea4f5fe7a5610225433ea8dd8d0f83e) it allows manual rollbacks in after_save (eg store events) to reset the object correctly hopefully we can soon get rid of this code!;T;!0;"o;#;$F;%i;;&i>;'@t\;(I"*def with_transaction_returning_status;T;)T;*I"]def with_transaction_returning_status status = nil self.class.transaction do add_to_transaction begin status = yield rescue ActiveRecord::Rollback @_start_transaction_state[:level] = (@_start_transaction_state[:level] || 0) - 1 status = nil end raise ActiveRecord::Rollback unless status end status end;T;+T;I@t\;JIC;[;I@t\;KIC;[;I@t\;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@[i;[@[i:;F;:Transactions;;;;;[;{;IC;" ;T;@t\;.0;F;[;[; I";T;!0;'@z[;I"ActiveRecord::Transactions;F;+T;I@z[;JIC;[;I@z[;KIC;[;I@z[;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@[i;F;;j;;;;;[;{;IC;" ;T;@z[;.0;F;[;[; I";T;!0;'@;I"ActiveRecord;F;X0;W0;X; o; ;IC;[ o;[;[[I"lib/card/view_name.rb;Ti ;F;:@@name2viewnameobject;;;;;[;{;IC;" ;T;@\;.0;F;[;[; I";T;!0;'@\;I"*Card::ViewName::@@name2viewnameobject;F;(I"@@name2viewnameobject = {};T;*I"@@name2viewnameobject = {};T;6I"{};T;+To; ; F; ; ;;;I"Card::ViewName.new;F;[[I"obj;T0;[[@\i;F;;;;;[;{;IC;" ;T;@\;.0;F;[;[; I";T;!0;'@\;(I"def new(obj);T;)T;*I"def new obj return obj if self.class===obj str = Array===obj ? obj*joint : obj.to_s if known_name = @@name2viewnameobject[str] known_name else super str.strip end end;T;+To; ; F; ;,;;;I"Card::ViewName#initialize;F;[[I"str;T0;[[@\i;F;;C;;;[;{;IC;" ;T;@\;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of ViewName;T;0;3[I" ViewName;F;@\; I";T;!0;'@\;(I"def initialize(str);T;)T;*I"def initialize str @s = str.to_s.strip @s = @s.encode('UTF-8') if RUBYENCODING @key = if @s.index(self.class.joint) @parts = @s.split(/\s*#{JOINT_RE}\s*/) @parts << '' if @s[-1,1] == self.class.joint @simple = false @parts.map { |p| p.to_name.key } * self.class.joint else @parts = [str] @simple = true str.empty? ? '' : simple_key end @@name2viewnameobject[str] = self end;T;+To; ; F; ;,;;;I"Card::ViewName#simple_key;F;[;[[@\i+;F;:simple_key;;;[;{;IC;" ;T;@\;.0;F;[;[; I";T;!0;'@\;(I"def simple_key;T;)T;*I"jdef simple_key decoded.underscore.gsub(/[^#{OK4KEY_RE}]+/,'_').split(/_+/).reject(&:empty?)*'_' end;T;+To; ; F; ;,;;;I"Card::ViewName#to_viewname;F;[;[[@\i/;F;;O;;;[;{;IC;" ;T;@\;.0;F;[;[; I";T;!0;'@\;(I"def to_viewname;T;)T;*I"def to_viewname() self end;T;+T;I@\;JIC;[;I@\;KIC;[;I@\;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@\i ;F;: ViewName;;;;;[;{;IC;" ;T;@\;.0;F;[;[; I";T;!0;'@;I"Card::ViewName;F;Io;S ;T0;U0;V0;;:;'@;W0;X; ;+To; ;IC;[o; ; F; ;,;;;I"Card::Reference#referencer;F;[;[[I"lib/card/reference.rb;Ti ;F;:referencer;;;[;{;IC;" ;T;@];.0;F;[;[; I";T;!0;'@];(I"def referencer;T;)T;*I"*def referencer Card[referer_id] end;T;+To; ; F; ;,;;;I"Card::Reference#referencee;F;[;[[@ ]i ;F;:referencee;;;[;{;IC;" ;T;@];.0;F;[;[; I";T;!0;'@];(I"def referencee;T;)T;*I"*def referencee Card[referee_id] end;T;+To; ; F; ; ;;;I"$Card::Reference.delete_all_from;F;[[I" card;T0;[[@ ]i;F;:delete_all_from;;;[;{;IC;" ;T;@!];.0;F;[;[; I";T;!0;'@];(I"def delete_all_from card;T;)T;*I"Bdef delete_all_from card delete_all referer_id: card.id end;T;+To; ; F; ; ;;;I""Card::Reference.delete_all_to;F;[[I" card;T0;[[@ ]i;F;:delete_all_to;;;[;{;IC;" ;T;@0];.0;F;[;[; I";T;!0;'@];(I"def delete_all_to card;T;)T;*I"edef delete_all_to card where( referee_id: card.id ).update_all present: 0, referee_id: nil end;T;+To; ; F; ; ;;;I"(Card::Reference.update_existing_key;F;[[I" card;T0[I" name;TI"nil;T;[[@ ]i;F;:update_existing_key;;;[;{;IC;" ;T;@?];.0;F;[;[; I";T;!0;'@];(I"+def update_existing_key card, name=nil;T;)T;*I"def update_existing_key card, name=nil key = (name || card.name).to_name.key where( referee_key: key ).update_all present: 1, referee_id: card.id end;T;+To; ; F; ; ;;;I"%Card::Reference.update_on_rename;F;[[I" card;T0[I" newname;T0[I"update_referers;TI" false;T;[[@ ]i ;F;:update_on_rename;;;[;{;IC;" ;T;@Q];.0;F;[;[; I";T;!0;'@];(I">def update_on_rename card, newname, update_referers=false;T;)T;*I"def update_on_rename card, newname, update_referers=false if update_referers # not currentlt needed because references are deleted and re-created in the process of adding new revision #where( referee_id: card.id ).update_all referee_key: newname.to_name.key else delete_all_to card end #Rails.logger.warn "update on rename #{card.inspect}, #{newname}, #{update_referers}" update_existing_key card, newname end;T;+To; ; F; ; ;;;I"%Card::Reference.update_on_delete;F;[[I" card;T0;[[@ ]i+;F;:update_on_delete;;;[;{;IC;" ;T;@e];.0;F;[;[; I";T;!0;'@];(I"def update_on_delete card;T;)T;*I"Ndef update_on_delete card delete_all_from card delete_all_to card end;T;+To; ; F; ; ;;;I",Card::Reference.repair_missing_referees;F;[;[[@ ]i0;F;:repair_missing_referees;;;[;{;IC;" ;T;@t];.0;F;[;[; I";T;!0;'@];(I" def repair_missing_referees;T;)T;*I"def repair_missing_referees joins('LEFT JOIN cards ON card_references.referee_id = cards.id').where('(cards.id IS NULL OR cards.trash IS TRUE) AND referee_id IS NOT NULL').update_all referee_id: nil end;T;+To; ; F; ; ;;;I",Card::Reference.delete_missing_referers;F;[;[[@ ]i4;F;:delete_missing_referers;;;[;{;IC;" ;T;@];.0;F;[;[; I";T;!0;'@];(I" def delete_missing_referers;T;)T;*I"def delete_missing_referers joins('LEFT JOIN cards ON card_references.referer_id = cards.id').where('cards.id IS NULL OR cards.trash IS TRUE').delete_all end;T;+To; ; F; ; ;;;I"Card::Reference.repair_all;F;[;[[I"lib/card/reference.rb;Ti:[@ ]i8;T;:repair_all;;;[;{;IC;"}repair references one by one (delete, create, delete, create...) slower, but better than #repair_all for use on running sites ;T;@];F;[;[; I"}repair references one by one (delete, create, delete, create...) slower, but better than #repair_all for use on running sites;T;!0;"o;#;$F;%i8;&i9;'@];(I"def repair_all;T;)T;*I"def repair_all delete_missing_referers Card.where(trash: false).find_each do |card| Rails.logger.info "\nRepairing references for '#{card.name}' (id: #{card.id}) ... " card.update_references end end;T;+To; ; F; ; ;;;I" Card::Reference.mass_insert;F;[[I" array;T0;[[@]i;T;:mass_insert;;;[;{;IC;"{bulk insert improves performance considerably array takes form [ [referer_id, referee_id, referee_key, ref_type], ...] ;T;@];F;[;[; I"{bulk insert improves performance considerably array takes form [ [referer_id, referee_id, referee_key, ref_type], ...];T;!0;"o;#;$F;%i ;&i;'@];(I"def mass_insert array;T;)T;*I")def mass_insert array return if array.empty? value_statements = array.map { |values| "\n(#{values.join ', '})" } sql = 'INSERT into card_references '\ '(referer_id, referee_id, referee_key, ref_type) '\ "VALUES #{value_statements.join ', '}" Card.connection.execute sql end;T;+To; ; F; ; ;;;I"!Card::Reference.map_referees;F;[[I"referee_key;T0[I"referee_id;T0;[[@]i;T;:map_referees;;;[;{;IC;"2map existing reference to name to card via id ;T;@];F;[;[; I"2map existing reference to name to card via id;T;!0;"o;#;$F;%i;&i;'@];(I"-def map_referees referee_key, referee_id;T;)T;*I"udef map_referees referee_key, referee_id where(referee_key: referee_key).update_all referee_id: referee_id end;T;+To; ; F; ; ;;;I"#Card::Reference.unmap_referees;F;[[I"referee_id;T0;[[@]i;T;:unmap_referees;;;[;{;IC;"5references no longer refer to card, so remove id ;T;@];F;[;[; I"5references no longer refer to card, so remove id;T;!0;"o;#;$F;%i;&i;'@];(I""def unmap_referees referee_id;T;)T;*I"adef unmap_referees referee_id where(referee_id: referee_id).update_all referee_id: nil end;T;+To; ; F; ; ;;;I"-Card::Reference.unmap_if_referee_missing;F;[;[[@]i#;T;:unmap_if_referee_missing;;;[;{;IC;"Efind all references to missing (eg deleted) cards and reset them ;T;@];F;[;[; I"Efind all references to missing (eg deleted) cards and reset them;T;!0;"o;#;$F;%i";&i";'@];(I"!def unmap_if_referee_missing;T;)T;*I"def unmap_if_referee_missing joins( 'LEFT JOIN cards ON card_references.referee_id = cards.id' ).where( '(cards.id IS NULL OR cards.trash IS TRUE) AND referee_id IS NOT NULL' ).update_all referee_id: nil end;T;+To; ; F; ; ;;;I".Card::Reference.delete_if_referer_missing;F;[;[[@]i,;T;:delete_if_referer_missing;;;[;{;IC;":remove all references from missing (eg deleted) cards ;T;@];F;[;[; I":remove all references from missing (eg deleted) cards;T;!0;"o;#;$F;%i+;&i+;'@];(I""def delete_if_referer_missing;T;)T;*I"Ydef delete_if_referer_missing joins( 'LEFT JOIN cards ON card_references.referer_id = cards.id' ).where( 'cards.id IS NULL' ).find_in_batches do |group| # used to be .delete_all here, but that was failing on large dbs puts 'deleting batch of references' where("id in (#{group.map(&:id).join ','})").delete_all end end;T;+To; ; F; ; ;;;I"!Card::Reference.recreate_all;F;[;[[@]iE;T;:recreate_all;;;[;{;IC;"delete all references, then recreate them one by one faster than #repair_all, but not recommended for use on running sites ;T;@];F;[;[; I"delete all references, then recreate them one by one faster than #repair_all, but not recommended for use on running sites;T;!0;"o;#;$F;%iC;&iD;'@];(I"def recreate_all;T;)T;*I"def recreate_all delete_all Card.where(trash: false).find_each do |card| Rails.logger.info "updating references from #{card}" card.include_set_modules card.create_references_out end end;T;+To; ; F; ;,;;;I"  f ;F;[;[[@]iP;T;: referer;;;[;{;IC;"card that refers ;T;@];F;[;[; I"card that refers;T;!0;"o;#;$F;%iO;&iO;'@];(I"def referer;T;)T;*I"'def referer Card[referer_id] end;T;+To; ; F; ;,;;;I"^@U{@ ;F;[;[[@]iU;T;: referee;;;[;{;IC;"card that is referred to ;T;@^;F;[;[; I"card that is referred to;T;!0;"o;#;$F;%iT;&iT;'@];(I"def referee;T;)T;*I"'def referee Card[referee_id] end;T;+T;I@];JIC;[;I@];KIC;[;I@];LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@]i [@ ]i;T;:Reference;;;;;[;{;IC;"da Reference is a directional relationship from one card (the referer) to another (the referee). ;T;@];F;[;[; I"da Reference is a directional relationship from one card (the referer) to another (the referee).;T;!0;"o;#;$F;%i ;&i ;'o;S ;T0;U0;V0;;d;'@;W@;X0;I"Card::Reference;F;Io;S ;T0;UI"ActiveRecord::Base;T;V@'^;;;'o;S ;T0;U0;V0;;j;'@;W@z[;X0;W0;X; ;+To; ;IC;[5o; ;IC;[#o; ; F; ;,;;;I"!Card::Query::Join#conditions;F;[;[[I"lib/card/query/join.rb;Ti ;F;:conditions;;;[;{;IC;".Returns the value of attribute conditions ;T;@0^;.0;F;[;[; I".Returns the value of attribute conditions;T;!0;'@.^;(I"def conditions;T;*I"%def conditions @conditions end;T;+To; ; F; ;,;;;I""Card::Query::Join#conditions=;F;[[I" value;T0;[[@5^i ;F;:conditions=;;;[;{;IC;""Sets the attribute conditions ;T;@>^;.0;F;[;[o;0 ;1I" param;F;2I"2the value to set the attribute conditions to.;T;I" value;T;30;@>^; I"]Sets the attribute conditions @param value the value to set the attribute conditions to.;T;!0;'@.^;(I"def conditions=(value);T;*I"5def conditions=(value) @conditions = value end;T;+To; ; F; ;,;;;I"Card::Query::Join#side;F;[;[[@5^i [@5^i.[I"lib/card/query/join.rb;Ti6;F;: side;;;[;{;IC;"(Returns the value of attribute side ;T;@Q^;.0;F;[;[; I"(Returns the value of attribute side;T;!0;'@.^;(I" def side;T;)T;*I"def side @side end;T;+To; ; F; ;,;;;I"Card::Query::Join#side=;F;[[I" value;T0;[[@5^i ;F;: side=;;;[;{;IC;"Sets the attribute side ;T;@a^;.0;F;[;[o;0 ;1I" param;F;2I",the value to set the attribute side to.;T;I" value;T;30;@a^; I"QSets the attribute side @param value the value to set the attribute side to.;T;!0;'@.^;(I"def side=(value);T;*I")def side=(value) @side = value end;T;+To; ; F; ;,;;;I"Card::Query::Join#from;F;[;[[@5^i ;F;: from;;;[;{;IC;"(Returns the value of attribute from ;T;@t^;.0;F;[;[; I"(Returns the value of attribute from;T;!0;'@.^;(I" def from;T;*I"def from @from end;T;+To; ; F; ;,;;;I"Card::Query::Join#from=;F;[[I" value;T0;[[@5^i ;F;: from=;;;[;{;IC;"Sets the attribute from ;T;@^;.0;F;[;[o;0 ;1I" param;F;2I",the value to set the attribute from to.;T;I" value;T;30;@^; I"QSets the attribute from @param value the value to set the attribute from to.;T;!0;'@.^;(I"def from=(value);T;*I")def from=(value) @from = value end;T;+To; ; F; ;,;;;I"Card::Query::Join#to;F;[;[[@5^i ;F;:to;;;[;{;IC;"&Returns the value of attribute to ;T;@^;.0;F;[;[; I"&Returns the value of attribute to;T;!0;'@.^;(I" def to;T;*I"def to @to end;T;+To; ; F; ;,;;;I"Card::Query::Join#to=;F;[[I" value;T0;[[@5^i ;F;:to=;;;[;{;IC;"Sets the attribute to ;T;@^;.0;F;[;[o;0 ;1I" param;F;2I"*the value to set the attribute to to.;T;I" value;T;30;@^; I"MSets the attribute to @param value the value to set the attribute to to.;T;!0;'@.^;(I"def to=(value);T;*I"%def to=(value) @to = value end;T;+To; ; F; ;,;;;I"!Card::Query::Join#from_table;F;[;[[@5^i ;F;:from_table;;;[;{;IC;".Returns the value of attribute from_table ;T;@^;.0;F;[;[; I".Returns the value of attribute from_table;T;!0;'@.^;(I"def from_table;T;*I"%def from_table @from_table end;T;+To; ; F; ;,;;;I""Card::Query::Join#from_table=;F;[[I" value;T0;[[@5^i ;F;:from_table=;;;[;{;IC;""Sets the attribute from_table ;T;@^;.0;F;[;[o;0 ;1I" param;F;2I"2the value to set the attribute from_table to.;T;I" value;T;30;@^; I"]Sets the attribute from_table @param value the value to set the attribute from_table to.;T;!0;'@.^;(I"def from_table=(value);T;*I"5def from_table=(value) @from_table = value end;T;+To; ; F; ;,;;;I"Card::Query::Join#to_table;F;[;[[@5^i ;F;: to_table;;;[;{;IC;",Returns the value of attribute to_table ;T;@^;.0;F;[;[; I",Returns the value of attribute to_table;T;!0;'@.^;(I"def to_table;T;*I"!def to_table @to_table end;T;+To; ; F; ;,;;;I" Card::Query::Join#to_table=;F;[[I" value;T0;[[@5^i ;F;:to_table=;;;[;{;IC;" Sets the attribute to_table ;T;@^;.0;F;[;[o;0 ;1I" param;F;2I"0the value to set the attribute to_table to.;T;I" value;T;30;@^; I"YSets the attribute to_table @param value the value to set the attribute to_table to.;T;!0;'@.^;(I"def to_table=(value);T;*I"1def to_table=(value) @to_table = value end;T;+To; ; F; ;,;;;I"!Card::Query::Join#from_alias;F;[;[[@5^i ;F;:from_alias;;;[;{;IC;".Returns the value of attribute from_alias ;T;@^;.0;F;[;[; I".Returns the value of attribute from_alias;T;!0;'@.^;(I"def from_alias;T;*I"%def from_alias @from_alias end;T;+To; ; F; ;,;;;I""Card::Query::Join#from_alias=;F;[[I" value;T0;[[@5^i ;F;:from_alias=;;;[;{;IC;""Sets the attribute from_alias ;T;@_;.0;F;[;[o;0 ;1I" param;F;2I"2the value to set the attribute from_alias to.;T;I" value;T;30;@_; I"]Sets the attribute from_alias @param value the value to set the attribute from_alias to.;T;!0;'@.^;(I"def from_alias=(value);T;*I"5def from_alias=(value) @from_alias = value end;T;+To; ; F; ;,;;;I"Card::Query::Join#to_alias;F;[;[[@5^i ;F;: to_alias;;;[;{;IC;",Returns the value of attribute to_alias ;T;@_;.0;F;[;[; I",Returns the value of attribute to_alias;T;!0;'@.^;(I"def to_alias;T;*I"!def to_alias @to_alias end;T;+To; ; F; ;,;;;I" Card::Query::Join#to_alias=;F;[[I" value;T0;[[@5^i ;F;:to_alias=;;;[;{;IC;" Sets the attribute to_alias ;T;@!_;.0;F;[;[o;0 ;1I" param;F;2I"0the value to set the attribute to_alias to.;T;I" value;T;30;@!_; I"YSets the attribute to_alias @param value the value to set the attribute to_alias to.;T;!0;'@.^;(I"def to_alias=(value);T;*I"1def to_alias=(value) @to_alias = value end;T;+To; ; F; ;,;;;I"!Card::Query::Join#from_field;F;[;[[@5^i ;F;:from_field;;;[;{;IC;".Returns the value of attribute from_field ;T;@4_;.0;F;[;[; I".Returns the value of attribute from_field;T;!0;'@.^;(I"def from_field;T;*I"%def from_field @from_field end;T;+To; ; F; ;,;;;I""Card::Query::Join#from_field=;F;[[I" value;T0;[[@5^i ;F;:from_field=;;;[;{;IC;""Sets the attribute from_field ;T;@A_;.0;F;[;[o;0 ;1I" param;F;2I"2the value to set the attribute from_field to.;T;I" value;T;30;@A_; I"]Sets the attribute from_field @param value the value to set the attribute from_field to.;T;!0;'@.^;(I"def from_field=(value);T;*I"5def from_field=(value) @from_field = value end;T;+To; ; F; ;,;;;I"Card::Query::Join#to_field;F;[;[[@5^i ;F;: to_field;;;[;{;IC;",Returns the value of attribute to_field ;T;@T_;.0;F;[;[; I",Returns the value of attribute to_field;T;!0;'@.^;(I"def to_field;T;*I"!def to_field @to_field end;T;+To; ; F; ;,;;;I" Card::Query::Join#to_field=;F;[[I" value;T0;[[@5^i ;F;:to_field=;;;[;{;IC;" Sets the attribute to_field ;T;@a_;.0;F;[;[o;0 ;1I" param;F;2I"0the value to set the attribute to_field to.;T;I" value;T;30;@a_; I"YSets the attribute to_field @param value the value to set the attribute to_field to.;T;!0;'@.^;(I"def to_field=(value);T;*I"1def to_field=(value) @to_field = value end;T;+To; ; F; ;,;;;I"!Card::Query::Join#initialize;F;[[I" opts;TI"{};T;[[@5^i[@X^i;F;;C;;;[;{;IC;" ;T;@t_;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of Join;T;0;3[I" Join;F;@t_; I";T;!0;'@.^;(I"def initialize(opts={});T;)T;*I"def initialize opts={} from_and_to opts opts.each do |key, value| send "#{key}=", value if value.present? end @from_field ||= :id @to_field ||= :id on = SqlCond.new "#{from_alias}.#{from_field} = #{to_alias}.#{to_field}" @conditions = [[:cond, on]] end;T;+To; ; F; ;,;;;I""Card::Query::Join#from_and_to;F;[[I" opts;T0;[[@5^i[@X^i ;F;:from_and_to;;;[;{;IC;" ;T;@_;.0;F;[;[; I";T;!0;'@.^;(I"def from_and_to(opts);T;)T;*I"def from_and_to opts [:from, :to].each do |side| object = opts[side] case object when nil; next when Array { table: object.shift, alias: object.shift, field: object.shift } when Card::Query { table: 'cards', alias: object.table_alias } when Card::Query::Reference { table: 'card_references', alias: object.table_alias } else raise "invalid #{side} option: #{object}" end.map do |key, value| opts[:"#{side}_#{key}"] ||= value end end end;T;+To; ; F; ;,;;;I"Card::Query::Join#to_sql;F;[;[[@5^i2;F;: to_sql;;;[;{;IC;" ;T;@_;.0;F;[;[; I";T;!0;'@.^;(I"def to_sql;T;)T;*I"def to_sql @to_table = "(#{@to_table.sql})" if Card::Query===@to_table [ side, 'JOIN', to_table, to_alias, 'ON', on_clause ].compact * ' ' end;T;+To; ; F; ;,;;;I" Card::Query::Join#on_clause;F;[;[[@5^i7;F;:on_clause;;;[;{;IC;" ;T;@_;.0;F;[;[; I";T;!0;'@.^;(I"def on_clause;T;)T;*I"wdef on_clause @conditions.map do |condition| field, val = condition val.to_sql field end * ' AND ' end;T;+To; ; F; ;,;;;I" Card::Query::Join#superjoin;F;[;[[@X^i ;F;:superjoin;;;[;{;IC;"-Returns the value of attribute superjoin ;T;@_;.0;F;[;[; I"-Returns the value of attribute superjoin;T;!0;'@.^;(I"def superjoin;T;*I"#def superjoin @superjoin end;T;+To; ; F; ;,;;;I"!Card::Query::Join#superjoin=;F;[[I" value;T0;[[@X^i ;F;:superjoin=;;;[;{;IC;"!Sets the attribute superjoin ;T;@_;.0;F;[;[o;0 ;1I" param;F;2I"1the value to set the attribute superjoin to.;T;I" value;T;30;@_; I"[Sets the attribute superjoin @param value the value to set the attribute superjoin to.;T;!0;'@.^;(I"def superjoin=(value);T;*I"3def superjoin=(value) @superjoin = value end;T;+To; ; F; ;,;;;I"Card::Query::Join#subjoins;F;[;[[@X^i ;F;: subjoins;;;[;{;IC;",Returns the value of attribute subjoins ;T;@_;.0;F;[;[; I",Returns the value of attribute subjoins;T;!0;'@.^;(I"def subjoins;T;*I"!def subjoins @subjoins end;T;+To; ; F; ;,;;;I" Card::Query::Join#subjoins=;F;[[I" value;T0;[[@X^i ;F;:subjoins=;;;[;{;IC;" Sets the attribute subjoins ;T;@_;.0;F;[;[o;0 ;1I" param;F;2I"0the value to set the attribute subjoins to.;T;I" value;T;30;@_; I"YSets the attribute subjoins @param value the value to set the attribute subjoins to.;T;!0;'@.^;(I"def subjoins=(value);T;*I"1def subjoins=(value) @subjoins = value end;T;+To; ; F; ;,;;;I"::@{@ ;F;[;[[@X^i?;F;: left?;;;[;{;IC;" ;T;@_;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@_; I";T;!0;'@.^;(I"def left?;T;)T;*I"#def left? side == 'LEFT' end;T;+To; ; F; ;,;;;I"Card::Query::Join#in_left?;F;[;[[@X^iC;F;: in_left?;;;[;{;IC;" ;T;@`;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@`; I";T;!0;'@.^;(I"def in_left?;T;)T;*I"def in_left? if !@in_left.nil? @in_left else @in_left = left? || (!@superjoin.nil? && @superjoin.in_left?) end end;T;+T;I@.^;JIC;[;I@.^;KIC;[;I@.^;LIC;M{; IC;M{;NT;,IC;M{;IC;M{;C@0^;D@>^;NT;IC;M{;C@Q^;D@a^;NT;IC;M{;C@t^;D@^;NT;IC;M{;C@^;D@^;NT;IC;M{;C@^;D@^;NT;IC;M{;C@^;D@^;NT;IC;M{;C@^;D@_;NT;IC;M{;C@_;D@!_;NT;IC;M{;C@4_;D@A_;NT;IC;M{;C@T_;D@a_;NT;IC;M{;C@_;D@_;NT;IC;M{;C@_;D@_;NT;NT;NT;O{;P[;[[@5^i;F;: Join;;;;;[;{;IC;" ;T;@.^;.0;F;[;[; I";T;!0;'@,^;I"Card::Query::Join;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+To; ;IC;[ o; ; F; ;,;;;I"Card::Query::Value#query;F;[;[[I"lib/card/query/value.rb;Ti [I"lib/card/query/value.rb;Ti ;F;;t;;;[;{;IC;")Returns the value of attribute query ;T;@7`;.0;F;[;[; I")Returns the value of attribute query;T;!0;'@5`;(I"def query;T;*I"def query @query end;T;+To; ; F; ;,;;;I" Card::Query::Value#operator;F;[;[[@<`i [@>`i ;F;: operator;;;[;{;IC;",Returns the value of attribute operator ;T;@G`;.0;F;[;[; I",Returns the value of attribute operator;T;!0;'@5`;(I"def operator;T;*I"!def operator @operator end;T;+To; ; F; ;,;;;I"Card::Query::Value#value;F;[;[[@<`i [@>`i ;F;: value;;;[;{;IC;")Returns the value of attribute value ;T;@U`;.0;F;[;[; I")Returns the value of attribute value;T;!0;'@5`;(I"def value;T;*I"def value @value end;T;+To; ; F; ;,;;;I""Card::Query::Value#initialize;F;[[I" rawvalue;T0[I" query;T0;[[@<`i[@>`i ;F;;C;;;[;{;IC;" ;T;@c`;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of Value;T;0;3[I" Value;F;@c`; I";T;!0;'@5`;(I"$def initialize(rawvalue, query);T;)T;*I"{def initialize rawvalue, query @query = query @operator, @value = parse_value rawvalue canonicalize_operator end;T;+To; ; F; ;,;;;I"#Card::Query::Value#parse_value;F;[[I" rawvalue;T0;[[@<`i[@>`i;F;:parse_value;;;[;{;IC;" ;T;@z`;.0;F;[;[; I";T;!0;'@5`;(I"def parse_value(rawvalue);T;)T;*I"def parse_value rawvalue operator = case rawvalue when Array; rawvalue.shift when String; '=' when Integer; '=' else raise("Invalid Condition Clause #{rawvalue}.inspect}") end [operator, rawvalue] end;T;+To; ; F; ;,;;;I"-Card::Query::Value#canonicalize_operator;F;[;[[@<`i[@>`i;F;:canonicalize_operator;;;[;{;IC;" ;T;@`;.0;F;[;[; I";T;!0;'@5`;(I"def canonicalize_operator;T;)T;*I"def canonicalize_operator if target = OPERATORS[@operator.to_s] @operator = target else raise "Invalid Operator #{@operator}" end end;T;+To; ; F; ;,;;;I"Card::Query::Value#sqlize;F;[[I"v;T0;[[@<`i([@>`i#;F;: sqlize;;;[;{;IC;" ;T;@`;.0;F;[;[; I";T;!0;'@5`;(I"def sqlize(v);T;)T;*I"def sqlize v case v when Query, SqlCond; v.to_sql when Array; "(" + v.flatten.collect {|x| sqlize(x)}.join(',') + ")" else quote(v.to_s) end end;T;+To; ; F; ;,;;;I"Card::Query::Value#to_sql;F;[[I" field;T0;[[@<`i0[@>`i+;F;;;;;[;{;IC;" ;T;@`;.0;F;[;[; I";T;!0;'@5`;(I"def to_sql(field);T;)T;*I"def to_sql field op,v = @operator, @value table = @query.table_alias field, v = case field.to_s when "cond" return "(#{sqlize(v)})" when "name" ["#{table}.key", [v].flatten.map(&:to_name).map(&:key)] when "content" ["#{table}.db_content", v] else ["#{table}.#{safe_sql field}", v] end v = v[0] if Array===v && v.length==1 && op != 'in' if op=='~' cxn, v = match_prep(v) %{#{field} #{cxn.match(sqlize(v))}} else "#{field} #{op} #{sqlize(v)}" end end;T;+T;I@5`;JIC;[;I@5`;KIC;[o;S ;T0;U0;V0;: Clause;'o;S ;T0;UI"Card::Query;T;V@;: Query;'@;W@,^;X0;Wo;7;IC;[o; ; F; ;,;;;I"!Card::Query::Clause#safe_sql;F;[[I"txt;T0;[[I"lib/card/query/clause.rb;Ti ;T;: safe_sql;;;[;{;IC;"attr_accessor :clause ;T;@`;F;[;[; I" attr_accessor :clause;T;!0;"o;#;$F;%i;&i;'@`;(I"def safe_sql(txt);T;)T;*I"def safe_sql(txt) txt = txt.to_s txt.match( /[^\w\*\(\)\s\.\,]/ ) ? raise( "WQL contains disallowed characters: #{txt}" ) : txt end;T;+To; ; F; ;,;;;I"Card::Query::Clause#quote;F;[[I"v;T0;[[@`i;F;: quote;;;[;{;IC;" ;T;@`;.0;F;[;[; I";T;!0;'@`;(I"def quote(v);T;)T;*I">def quote(v) ActiveRecord::Base.connection.quote(v) end;T;+To; ; F; ;,;;;I"#Card::Query::Clause#match_prep;F;[[I"v;T0;[[@`i[I"lib/card/query/clause.rb;Ti;F;:match_prep;;;[;{;IC;" ;T;@`;.0;F;[;[; I";T;!0;'@`;(I"def match_prep(v);T;)T;*I"Mdef match_prep(v) cxn ||= ActiveRecord::Base.connection [cxn, v] end;T;+T;I@`;JIC;[;I@`;KIC;[;I@`;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@`i;F;;;;;;;[;{;IC;" ;T;@`;.0;F;[;[; I";T;!0;'@`;I"Card::Query::Clause;F;X;Y;I@5`;LIC;M{; IC;M{;NT;,IC;M{;tIC;M{;C@7`;D0;NT;IC;M{;C@G`;D0;NT;IC;M{;C@U`;D0;NT;NT;NT;O{;P[;[[@<`i;F;: Value;;;;;[;{;IC;" ;T;@5`;.0;F;[;[; I";T;!0;'@,^;I"Card::Query::Value;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+T@`o; ;IC;[o;4;[[I" lib/card/query/reference.rb;Ti [I" lib/card/query/reference.rb;Ti;F;:DEFINITIONS;;;;;[;{;IC;" ;T;@a;.0;F;[;[; I";T;!0;'@a;I"(Card::Query::Reference::DEFINITIONS;F;(I"DEFINITIONS = {;T;*I"PDEFINITIONS = { # syntax: # wql query key => [ direction, {reference_type} ] # direction = :out | :in # reference_type = 'L' | 'I' | 'P' refer_to: [:out, 'L', 'I'], referred_to_by: [:in, 'L', 'I'], link_to: [:out, 'L'], linked_to_by: [:in, 'L'], include: [:out, 'I'], included_by: [:in, 'I'] }.freeze;T;6I"B{ # syntax: # wql query key => [ direction, {reference_type} ] # direction = :out | :in # reference_type = 'L' | 'I' | 'P' refer_to: [:out, 'L', 'I'], referred_to_by: [:in, 'L', 'I'], link_to: [:out, 'L'], linked_to_by: [:in, 'L'], include: [:out, 'I'], included_by: [:in, 'I'] }.freeze;T;+To;4;[[@ai[@ai;F;: FIELDMAP;;;;;[;{;IC;" ;T;@$a;.0;F;[;[; I";T;!0;'@a;I"%Card::Query::Reference::FIELDMAP;F;(I"FIELDMAP = {;T;*I"_FIELDMAP = { out: [:referer_id, :referee_id], in: [:referee_id, :referer_id] }.freeze;T;6I"T{ out: [:referer_id, :referee_id], in: [:referee_id, :referer_id] }.freeze;T;+To; ; F; ;,;;;I"&Card::Query::Reference#conditions;F;[;[[@ai[@ai;F;;;;;[;{;IC;".Returns the value of attribute conditions ;T;@2a;.0;F;[;[; I".Returns the value of attribute conditions;T;!0;'@a;(I"def conditions;T;*I"%def conditions @conditions end;T;+To; ; F; ;,;;;I"'Card::Query::Reference#conditions=;F;[[I" value;T0;[[@ai[@ai;F;;;;;[;{;IC;""Sets the attribute conditions ;T;@@a;.0;F;[;[o;0 ;1I" param;F;2I"2the value to set the attribute conditions to.;T;I" value;T;30;@@a; I"]Sets the attribute conditions @param value the value to set the attribute conditions to.;T;!0;'@a;(I"def conditions=(value);T;*I"5def conditions=(value) @conditions = value end;T;+To; ; F; ;,;;;I"%Card::Query::Reference#cardquery;F;[;[[@ai[@ai;F;:cardquery;;;[;{;IC;"-Returns the value of attribute cardquery ;T;@Ta;.0;F;[;[; I"-Returns the value of attribute cardquery;T;!0;'@a;(I"def cardquery;T;*I"#def cardquery @cardquery end;T;+To; ; F; ;,;;;I"&Card::Query::Reference#cardquery=;F;[[I" value;T0;[[@ai[@ai;F;:cardquery=;;;[;{;IC;"!Sets the attribute cardquery ;T;@ba;.0;F;[;[o;0 ;1I" param;F;2I"1the value to set the attribute cardquery to.;T;I" value;T;30;@ba; I"[Sets the attribute cardquery @param value the value to set the attribute cardquery to.;T;!0;'@a;(I"def cardquery=(value);T;*I"3def cardquery=(value) @cardquery = value end;T;+To; ; F; ;,;;;I"#Card::Query::Reference#infield;F;[;[[@ai[@ai;F;: infield;;;[;{;IC;"+Returns the value of attribute infield ;T;@va;.0;F;[;[; I"+Returns the value of attribute infield;T;!0;'@a;(I"def infield;T;*I"def infield @infield end;T;+To; ; F; ;,;;;I"$Card::Query::Reference#infield=;F;[[I" value;T0;[[@ai[@ai;F;: infield=;;;[;{;IC;"Sets the attribute infield ;T;@a;.0;F;[;[o;0 ;1I" param;F;2I"/the value to set the attribute infield to.;T;I" value;T;30;@a; I"WSets the attribute infield @param value the value to set the attribute infield to.;T;!0;'@a;(I"def infield=(value);T;*I"/def infield=(value) @infield = value end;T;+To; ; F; ;,;;;I"$Card::Query::Reference#outfield;F;[;[[@ai[@ai;F;: outfield;;;[;{;IC;",Returns the value of attribute outfield ;T;@a;.0;F;[;[; I",Returns the value of attribute outfield;T;!0;'@a;(I"def outfield;T;*I"!def outfield @outfield end;T;+To; ; F; ;,;;;I"%Card::Query::Reference#outfield=;F;[[I" value;T0;[[@ai[@ai;F;:outfield=;;;[;{;IC;" Sets the attribute outfield ;T;@a;.0;F;[;[o;0 ;1I" param;F;2I"0the value to set the attribute outfield to.;T;I" value;T;30;@a; I"YSets the attribute outfield @param value the value to set the attribute outfield to.;T;!0;'@a;(I"def outfield=(value);T;*I"1def outfield=(value) @outfield = value end;T;+To; ; F; ;,;;;I"'Card::Query::Reference#table_alias;F;[;[[@ai[@ai;F;:table_alias;;;[;{;IC;" ;T;@a;.0;F;[;[; I";T;!0;'@a;(I"def table_alias;T;)T;*I"Ndef table_alias @table_alias ||= "cr#{@parent.table_id force=true}" end;T;+To; ; F; ;,;;;I"&Card::Query::Reference#initialize;F;[[I"key;T0[I"val;T0[I" parent;T0;[[@ai [@ai;F;;C;;;[;{;IC;" ;T;@a;.0;F;[;[o;0 ;1I" return;F;2I" a new instance of Reference;T;0;3[I"Reference;F;@a; I";T;!0;'@a;(I"%def initialize(key, val, parent);T;)T;*I"def initialize key, val, parent key, val, @parent = key, val, parent @conditions = [] direction, *reftype = DEFINITIONS[ key.to_sym ] @infield, @outfield = FIELDMAP[ direction ] if reftype.present? operator = (reftype.size==1 ? '=' : 'IN') quoted_letters = reftype.map { |letter| "'#{letter}'" } * ', ' @conditions << "ref_type #{operator} (#{quoted_letters})" end if val == '_none' @conditions << "present = 0" else @cardquery = val end self end;T;+T;I@a;JIC;[;I@a;KIC;[;I@a;LIC;M{; IC;M{;NT;,IC;M{ ;IC;M{;C@2a;D@@a;NT;IC;M{;C@Ta;D@ba;NT;IC;M{;C@va;D@a;NT;IC;M{;C@a;D@a;NT;NT;NT;O{;P[;[[@ai;F;;;;;;;[;{;IC;" ;T;@a;.0;F;[;[; I";T;!0;'@,^;I"Card::Query::Reference;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+To;7;IC;[-o;4;[[I"!lib/card/query/attributes.rb;Ti [I"!lib/card/query/attributes.rb;Ti ;F;:SORT_JOIN_TO_ITEM_MAP;;;;;[;{;IC;" ;T;@a;.0;F;[;[; I";T;!0;'@a;I"3Card::Query::Attributes::SORT_JOIN_TO_ITEM_MAP;F;(I"JSORT_JOIN_TO_ITEM_MAP = { left: 'left_id', right: 'right_id' }.freeze;T;*I"JSORT_JOIN_TO_ITEM_MAP = { left: 'left_id', right: 'right_id' }.freeze;T;6I"2{ left: 'left_id', right: 'right_id' }.freeze;T;+To; ; F; ;,;;;I"!Card::Query::Attributes#type;F;[[I"val;T0;[[@ai[@ai;T;;T;;;[;{;IC;"~~~~~~ RELATIONAL ;T;@b;F;[;[; I"~~~~~~ RELATIONAL;T;!0;"o;#;$F;%i ;&i ;'@a;(I"def type(val);T;)T;*I".def type val restrict :type_id, val end;T;+To; ; F; ;,;;;I"!Card::Query::Attributes#part;F;[[I"val;T0;[[@ai[@ai;F;: part;;;[;{;IC;" ;T;@b;.0;F;[;[; I";T;!0;'@a;(I"def part(val);T;)T;*I"idef part val right_val = Integer===val ? val : val.clone any( :left=>val, :right=>right_val) end;T;+To; ; F; ;,;;;I"!Card::Query::Attributes#left;F;[[I"val;T0;[[@ai[@ai;F;;;;;[;{;IC;" ;T;@)b;.0;F;[;[; I";T;!0;'@a;(I"def left(val);T;)T;*I".def left val restrict :left_id, val end;T;+To; ; F; ;,;;;I""Card::Query::Attributes#right;F;[[I"val;T0;[[@ai[@ai;F;;;;;[;{;IC;" ;T;@9b;.0;F;[;[; I";T;!0;'@a;(I"def right(val);T;)T;*I"0def right val restrict :right_id, val end;T;+To; ; F; ;,;;;I"&Card::Query::Attributes#editor_of;F;[[I"val;T0;[[@ai [@ai;F;:editor_of;;;[;{;IC;" ;T;@Ib;.0;F;[;[; I";T;!0;'@a;(I"def editor_of(val);T;)T;*I"}def editor_of val acts_alias, actions_alias = "a#{table_id force=true}", "an#{table_id force=true}" joins << Join.new( from: self, to: ['card_acts', acts_alias, 'actor_id' ] ) joins << Join.new( from: ['card_acts', acts_alias], to: ['card_actions', actions_alias, 'card_act_id'] ) join_cards val, from_alias: actions_alias, from_field: 'card_id' end;T;+To; ; F; ;,;;;I"&Card::Query::Attributes#edited_by;F;[[I"val;T0;[[@ai.[@ai-;F;:edited_by;;;[;{;IC;" ;T;@Yb;.0;F;[;[; I";T;!0;'@a;(I"def edited_by(val);T;)T;*I"def edited_by val acts_alias, actions_alias = "a#{table_id force=true}", "an#{table_id force=true}" joins << Join.new( from: self, to: ['card_actions', actions_alias, 'card_id' ] ) joins << Join.new( from: ['card_actions', actions_alias, 'card_act_id' ], to: ['card_acts', acts_alias] ) join_cards val, from_alias: acts_alias, from_field: 'actor_id' end;T;+To; ; F; ;,;;;I"+Card::Query::Attributes#last_editor_of;F;[[I"val;T0;[[@ai<[@ai;;F;:last_editor_of;;;[;{;IC;" ;T;@ib;.0;F;[;[; I";T;!0;'@a;(I"def last_editor_of(val);T;)T;*I"Idef last_editor_of val join_cards val, :to_field=>'updater_id' end;T;+To; ; F; ;,;;;I"+Card::Query::Attributes#last_edited_by;F;[[I"val;T0;[[@ai@[@ai?;F;:last_edited_by;;;[;{;IC;" ;T;@yb;.0;F;[;[; I";T;!0;'@a;(I"def last_edited_by(val);T;)T;*I";def last_edited_by val restrict :updater_id, val end;T;+To; ; F; ;,;;;I"'Card::Query::Attributes#creator_of;F;[[I"val;T0;[[@aiD[@aiC;F;:creator_of;;;[;{;IC;" ;T;@b;.0;F;[;[; I";T;!0;'@a;(I"def creator_of(val);T;)T;*I"Edef creator_of val join_cards val, :to_field=>'creator_id' end;T;+To; ; F; ;,;;;I"'Card::Query::Attributes#created_by;F;[[I"val;T0;[[@aiH[@aiG;F;:created_by;;;[;{;IC;" ;T;@b;.0;F;[;[; I";T;!0;'@a;(I"def created_by(val);T;)T;*I"7def created_by val restrict :creator_id, val end;T;+To; ; F; ;,;;;I"&Card::Query::Attributes#member_of;F;[[I"val;T0;[[@aiL[@aiK;F;:member_of;;;[;{;IC;" ;T;@b;.0;F;[;[; I";T;!0;'@a;(I"def member_of(val);T;)T;*I"Qdef member_of val interpret :right_plus => [RolesID, {:refer_to=>val}] end;T;+To; ; F; ;,;;;I"#Card::Query::Attributes#member;F;[[I"val;T0;[[@aiP[@aiO;F;: member;;;[;{;IC;" ;T;@b;.0;F;[;[; I";T;!0;'@a;(I"def member(val);T;)T;*I"Udef member val interpret :referred_to_by => {:left=>val, :right=>RolesID } end;T;+To; ; F; ;,;;;I"&Card::Query::Attributes#left_plus;F;[[I"val;T0;[[@aiW[@aiU;T;:left_plus;;;[;{;IC;"~~~~~~ PLUS RELATIONAL ;T;@b;F;[;[; I"~~~~~~ PLUS RELATIONAL;T;!0;"o;#;$F;%iS;&iS;'@a;(I"def left_plus(val);T;)T;*I"0def left_plus val junction :left, val end;T;+To; ; F; ;,;;;I"'Card::Query::Attributes#right_plus;F;[[I"val;T0;[[@ai[[@aiY;F;:right_plus;;;[;{;IC;" ;T;@b;.0;F;[;[; I";T;!0;'@a;(I"def right_plus(val);T;)T;*I"2def right_plus val junction :right, val end;T;+To; ; F; ;,;;;I"!Card::Query::Attributes#plus;F;[[I"val;T0;[[@ai_[@ai];F;: plus;;;[;{;IC;" ;T;@b;.0;F;[;[; I";T;!0;'@a;(I"def plus(val);T;)T;*I"Odef plus val any( { :left_plus=>val, :right_plus=>val.deep_clone } ) end;T;+To; ; F; ;,;;;I"%Card::Query::Attributes#junction;F;[[I"val;T0[I" side;T0[I" to_field;T0;[[@aic[@aia;F;: junction;;;[;{;IC;" ;T;@b;.0;F;[;[; I";T;!0;'@a;(I"&def junction(val, side, to_field);T;)T;*I"def junction side, val part_clause, junction_clause = val.is_a?(Array) ? val : [ val, {} ] junction_val = clause_to_hash(junction_clause).merge side=>part_clause join_cards junction_val, :to_field=>"#{ side==:left ? :right : :left}_id" end;T;+To; ; F; ;,;;;I"%Card::Query::Attributes#found_by;F;[[I"val;T0;[[@aii[@aim;T;: found_by;;;[;{;IC;"~~~~~~ SPECIAL ;T;@c;F;[;[; I"~~~~~~ SPECIAL;T;!0;"o;#;$F;%ig;&ig;'@a;(I"def found_by(val);T;)T;*I"def found_by val #binding.pry found_by_cards(val).compact.each do |c| if c && [SearchTypeID, SetID].include?(c.type_id) #FIXME - move this check to set mods! statement = c.get_query.symbolize_keys.merge( return: :condition, context: c.name ) sq = subquery statement else raise BadQuery, '"found_by" value must be valid Search, ' + "but #{c.name} is a #{c.type_name}" end end end;T;+To; ; F; ;,;;;I"+Card::Query::Attributes#found_by_cards;F;[[I"val;T0;[[@ai[@aiy;F;:found_by_cards;;;[;{;IC;" ;T;@c;.0;F;[;[; I";T;!0;'@a;(I"def found_by_cards(val);T;)T;*I"def found_by_cards val if Hash===val Query.run val else Array.wrap(val).map do |v| Card.fetch val.to_name.to_absolute(context), :new=>{} end end end;T;+To; ; F; ;,;;;I""Card::Query::Attributes#match;F;[[I"val;T0;[[@ai[@ai~;F;;k;;;[;{;IC;" ;T;@/c;.0;F;[;[; I";T;!0;'@a;(I"def match(val);T;)T;*I"def match(val) cxn, val = match_prep val val.gsub! /[^#{Card::Name::OK4KEY_RE}]+/, ' ' return nil if val.strip.empty? val_list = val.split(/\s+/).map do |v| name_or_content = [ "replace(#{self.table_alias}.name,'+',' ')", "#{self.table_alias}.db_content" ].map do |field| %{#{field} #{ cxn.match quote("[[:<:]]#{v}[[:>:]]") }} end "(#{name_or_content.join ' OR '})" end add_condition "(#{val_list.join ' AND '})" end;T;+To; ; F; ;,;;;I"%Card::Query::Attributes#complete;F;[[I"val;T0;[[@ai[@ai;F;;;;;;[;{;IC;" ;T;@?c;.0;F;[;[; I";T;!0;'@a;(I"def complete(val);T;)T;*I"def complete(val) no_plus_card = (val =~ /\+/ ? '' : "and right_id is null") # FIXME -- this should really be more nuanced -- # it breaks down after one plus add_condition( " lower(name) LIKE lower(#{quote(val.to_s+'%')}) #{no_plus_card}" ) end;T;+To; ; F; ;,;;;I"+Card::Query::Attributes#extension_type;F;[[I" _val;T0;[[@ai[@ai;F;:extension_type;;;[;{;IC;" ;T;@Oc;.0;F;[;[; I";T;!0;'@a;(I"def extension_type(_val);T;)T;*I"def extension_type val # DEPRECATED LONG AGO!!! Rails.logger.info "using DEPRECATED extension_type in WQL" interpret :right_plus => AccountID end;T;+To; ; F; ;,;;;I",Card::Query::Attributes#join_references;F;[[I"key;T0[I"val;T0;[[@ai[@ai;T;:join_references;;;[;{;IC;"ATTRIBUTE HELPERS ;T;@_c;F;[;[; I"ATTRIBUTE HELPERS;T;!0;"o;#;$F;%i;&i;'@a;(I""def join_references(key, val);T;)T;*I"def join_references key, val r = Reference.new( key, val, self ) joins << Join.new(:from=>self, :to=>r, :to_field=>r.infield) s = nil if r.cardquery s = join_cards r.cardquery, from_alias: r.table_alias, from_field: r.outfield end if r.conditions.any? s ||= subquery s.add_condition( r.conditions.map do |condition| "#{r.table_alias}.#{condition}" end * ' AND ') end end;T;+To; ; F; ;,;;;I"(Card::Query::Attributes#conjunction;F;[[I"val;T0;[[@ai[@ai;F;:conjunction;;;[;{;IC;" ;T;@rc;.0;F;[;[; I";T;!0;'@a;(I"def conjunction(val);T;)T;*I"gdef conjunction val if [String, Symbol].member? val.class CONJUNCTIONS[val.to_sym] end end;T;+To; ; F; ;,;;;I"!Card::Query::Attributes#sort;F;[[I"val;T0;[[@ai[@ai;F;: sort;;;[;{;IC;" ;T;@c;.0;F;[;[; I";T;!0;'@a;(I"def sort(val);T;)T;*I"def sort val return nil if @superquery sort_field = val[:return] || 'db_content' item = val.delete(:item) || 'left' if sort_field == 'count' sort_by_count val, item else if join_field = SORT_JOIN_TO_ITEM_MAP[item.to_sym] sq = join_cards val, to_field: join_field, side: 'LEFT', conditions_on_join: true @mods[:sort] ||= "#{sq.table_alias}.#{sort_field}" else raise BadQuery, "sort item: #{item} not yet implemented" end end end;T;+To; ; F; ;,;;;I"*Card::Query::Attributes#sort_by_count;F;[[I"val;T0[I" item;T0;[[@ai[@ai;T;:sort_by_count;;;[;{;IC;"EXPERIMENTAL! ;T;@c;F;[;[; I"EXPERIMENTAL!;T;!0;"o;#;$F;%i;&i;'@a;(I"!def sort_by_count(val, item);T;)T;*I"def sort_by_count val, item if item == 'referred_to' @mods[:sort] = "coalesce(count,0)" # needed for postgres cs = Query.new( :return=>'count', :group=>'sort_join_field', :superquery=>self ) subselect = Query.new(val.merge return: 'id', superquery: self) cs.add_condition "referer_id in (#{subselect.sql})" # FIXME - SQL generated before SQL phase cs.joins << Join.new( from: cs, to:['card_references', 'wr', 'referee_id'] ) cs.mods[:sort_join_field] = "#{cs.table_alias}.id as sort_join_field" #HACK! @joins << Join.new( from: self, to: [cs, 'srtbl', 'sort_join_field'] ) else raise BadQuery, "count with item: #{item} not yet implemented" end end;T;+To; ; F; ;,;;;I"(Card::Query::Attributes#table_alias;F;[;[[@ai[@ai;F;;;;;[;{;IC;" ;T;@c;.0;F;[;[; I";T;!0;'@a;(I"def table_alias;T;)T;*I"def table_alias @table_alias ||= begin if @statement[:return] == :condition && @superquery @superquery.table_alias else "c#{table_id}" end end end;T;+To; ; F; ;,;;;I"%Card::Query::Attributes#table_id;F;[[I" force;TI" false;T;[[@ai[@ai;F;: table_id;;;[;{;IC;" ;T;@c;.0;F;[;[; I";T;!0;'@a;(I"def table_id(force=false);T;)T;*I"odef table_id force=false if force tick_table_seq! else @table_id ||= tick_table_seq! end end;T;+To; ; F; ;,;;;I",Card::Query::Attributes#tick_table_seq!;F;[;[[@ai[@ai;F;:tick_table_seq!;;;[;{;IC;" ;T;@c;.0;F;[;[; I";T;!0;'@a;(I"def tick_table_seq!;T;)T;*I"Gdef tick_table_seq! root.table_seq = root.table_seq.to_i + 1 end;T;+To; ; F; ;,;;;I"'Card::Query::Attributes#join_cards;F;[[I"val;T0[I" opts;TI"{};T;[[@ai [@ai;F;:join_cards;;;[;{;IC;" ;T;@c;.0;F;[;[; I";T;!0;'@a;(I"!def join_cards(val, opts={});T;)T;*I"def join_cards val, opts={} conditions_on_join = opts.delete(:conditions_on_join) s = subquery s.joins << Join.new( { from: self, to: s }.merge opts ) s.conditions_on_join = conditions_on_join s.interpret val s end;T;+To; ; F; ;,;;;I" Card::Query::Attributes#all;F;[[I"val;T0;[[@ai[@ai ;T;:all;;;[;{;IC;"~~~~~~~ CONJUNCTION ;T;@c;F;[;[; I"~~~~~~~ CONJUNCTION;T;!0;"o;#;$F;%i;&i;'@a;(I"def all(val);T;)T;*I"(def all val conjoin val, :and end;T;+To; ; F; ;,;;;I" Card::Query::Attributes#and;F;[;[[@ai[@ai ;F;:and;;;[;{;IC;"~~~~~~~ CONJUNCTION;T;@c;.0;F;[;[; I"~~~~~~~ CONJUNCTION ;T;!0;"0;'@a;(@c;*I"(def all val conjoin val, :and end;T;+To; ; F; ;,;;;I" Card::Query::Attributes#any;F;[[I"val;T0;[[@ai[@ai;F;:any;;;[;{;IC;" ;T;@d;.0;F;[;[; I";T;!0;'@a;(I"def any(val);T;)T;*I"'def any val conjoin val, :or end;T;+To; ; F; ;,;;;I"Card::Query::Attributes#or;F;[;[[@ai[@ai;F;:or;;;[;{;IC;";T;@d;.0;F;[;[; I" ;T;!0;"0;'@a;(@d;*I"'def any val conjoin val, :or end;T;+To; ; F; ;,;;;I"Card::Query::Attributes#in;F;[;[[@ai[@ai;F;:in;;;[;{;IC;";T;@ d;.0;F;[;[; I" ;T;!0;"0;'@a;(@d;*I"'def any val conjoin val, :or end;T;+To; ; F; ;,;;;I"$Card::Query::Attributes#conjoin;F;[[I"val;T0[I" conj;T0;[[@ai [@ai;F;: conjoin;;;[;{;IC;" ;T;@-d;.0;F;[;[; I";T;!0;'@a;(I"def conjoin(val, conj);T;)T;*I"def conjoin val, conj sq = subquery( return: :condition, conj: conj ) unless Array===val val = clause_to_hash(val).map { |key, value| { key => value } } end val.each do |val_item| sq.interpret val_item end end;T;+To; ; F; ;,;;;I" Card::Query::Attributes#not;F;[[I"val;T0;[[@ai*[@ai;F;:not;;;[;{;IC;" ;T;@?d;.0;F;[;[; I";T;!0;'@a;(I"def not(val);T;)T;*I"def not val subselect = Query.new clause_to_hash(val).merge( return: :id ) join_alias = "not#{table_id force=true}" @joins << Join.new( from: self, to_table: subselect, to_alias: join_alias, side: 'LEFT' ) add_condition "#{join_alias}.id is null" end;T;+To; ; F; ;,;;;I"%Card::Query::Attributes#restrict;F;[[I" id_field;T0[I"val;T0;[[@ai6[@ai$;F;: restrict;;;[;{;IC;" ;T;@Od;.0;F;[;[; I";T;!0;'@a;(I" def restrict(id_field, val);T;)T;*I"def restrict id_field, val if id = id_from_val(val) interpret id_field => id else join_cards val, from_field: id_field end end;T;+To; ; F; ;,;;;I"(Card::Query::Attributes#id_from_val;F;[[I"val;T0;[[@ai>[@ai,;F;:id_from_val;;;[;{;IC;" ;T;@ad;.0;F;[;[; I";T;!0;'@a;(I"def id_from_val(val);T;)T;*I"fdef id_from_val val case val when Integer ; val when String ; Card.fetch_id(val) end end;T;+To; ; F; ;,;;;I"/Card::Query::Attributes#restrict_reference;F;[[I"ref;T0[I" refjoin;T0;[[@ai;F;:restrict_reference;;;[;{;IC;" ;T;@qd;.0;F;[;[; I";T;!0;'@a;(I"(def restrict_reference ref, refjoin;T;)T;*I"def restrict_reference ref, refjoin val = ref.cardquery if (id = id_from_val(val)) add_condition "#{ref.table_alias}.#{ref.outfield} = #{id}" else join_cards val, from: refjoin, from_field: ref.outfield end end;T;+T;I@a;JIC;[;I@a;KIC;[;I@a;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{@c;@d;@ d;;P[;[[@ai ;F;:Attributes;;;;;[;{;IC;" ;T;@a;.0;F;[;[; I";T;!0;'@,^;I"Card::Query::Attributes;F;+To; ;IC;[o; ; F; ;,;;;I")Card::Query::SqlStatement#initialize;F;[[I" query;TI"nil;T;[[I"$lib/card/query/sql_statement.rb;Ti [I"$lib/card/query/sql_statement.rb;Ti ;F;;C;;;[;{;IC;" ;T;@d;.0;F;[;[o;0 ;1I" return;F;2I"#a new instance of SqlStatement;T;0;3[I"SqlStatement;F;@d; I";T;!0;'@d;(I"def initialize(query=nil);T;)T;*I"Cdef initialize query @query = query @mods = query.mods end;T;+To; ; F; ;,;;;I"$Card::Query::SqlStatement#build;F;[;[[@di[@di;F;: build;;;[;{;IC;" ;T;@d;.0;F;[;[; I";T;!0;'@d;(I"def build;T;)T;*I"def build @fields = fields @tables = tables @joins = joins @query @where = where @group = group @order = order @limit_and_offset = limit_and_offset self end;T;+To; ; F; ;,;;;I"#Card::Query::SqlStatement#to_s;F;[;[[@di[@di;F;;;;;[;{;IC;" ;T;@d;.0;F;[;[; I";T;!0;'@d;(I" def to_s;T;)T;*I"def to_s ['SELECT DISTINCT', @fields, 'FROM', @tables, @joins, @where, @group, @order, @limit_and_offset ].compact * ' ' end;T;+To; ; F; ;,;;;I"%Card::Query::SqlStatement#tables;F;[;[[@di"[@di*;F;: tables;;;[;{;IC;" ;T;@d;.0;F;[;[; I";T;!0;'@d;(I"def tables;T;)T;*I"3def tables "cards #{@query.table_alias}" end;T;+To; ; F; ;,;;;I"%Card::Query::SqlStatement#fields;F;[;[[@di&[@di.;F;;;;;[;{;IC;" ;T;@d;.0;F;[;[; I";T;!0;'@d;(I"def fields;T;)T;*I"def fields table = @query.table_alias field = @mods[:return] field = field.blank? ? :card : field.to_sym field = case field when :raw; "#{table}.*" when :card; "#{table}.name" when :count; "coalesce(count(*),0) as count" when :content; "#{table}.db_content" else if ATTRIBUTES[field.to_sym]==:basic "#{table}.#{field}" else safe_sql field end end [ field, @mods[:sort_join_field] ].compact * ', ' end;T;+To; ; F; ;,;;;I"$Card::Query::SqlStatement#joins;F;[[I"join_list;T0;[[@di<[@diF;F;: joins;;;[;{;IC;" ;T;@d;.0;F;[;[; I";T;!0;'@d;(I"def joins(join_list);T;)T;*I"ndef joins query [ join_clause(query), query.subqueries.map { |sq| joins sq } ].flatten * "\n" end;T;+To; ; F; ;,;;;I"*Card::Query::SqlStatement#join_clause;F;[[I" join;T0;[[@diB[@diY;F;:join_clause;;;[;{;IC;" ;T;@d;.0;F;[;[; I";T;!0;'@d;(I"def join_clause(join);T;)T;*I"def join_clause query query.joins.map do |join| j = join.to_sql j += " AND #{standard_conditions query}" if join.to_table == 'cards' j end end;T;+To; ; F; ;,;;;I"$Card::Query::SqlStatement#where;F;[;[[@diJ[@diw;F;: where;;;[;{;IC;" ;T;@e;.0;F;[;[; I";T;!0;'@d;(I"def where;T;)T;*I"def where conditions = [ query_conditions(@query), standard_conditions(@query) ] conditions = conditions.reject( &:blank? ).join " AND \n " where = "WHERE #{conditions}" unless conditions.blank? end;T;+To; ; F; ;,;;;I"/Card::Query::SqlStatement#query_conditions;F;[[I" query;T0;[[@diP[@di};F;:query_conditions;;;[;{;IC;" ;T;@e;.0;F;[;[; I";T;!0;'@d;(I" def query_conditions(query);T;)T;*I"8def query_conditions query cond_list = basic_conditions query cond_list += query.subqueries.map do |query| query_conditions query end cond_list.reject! &:blank? if cond_list.size > 1 "(#{ cond_list.join " #{ query.current_conjunction.upcase }\n" })" else cond_list.join end end;T;+To; ; F; ;,;;;I"/Card::Query::SqlStatement#basic_conditions;F;[[I"conditions;T0;[[@di_[@di;F;:basic_conditions;;;[;{;IC;" ;T;@"e;.0;F;[;[; I";T;!0;'@d;(I"%def basic_conditions(conditions);T;)T;*I"def basic_conditions query query.conditions.map do |condition| field, val = condition val.to_sql field end end;T;+To; ; F; ;,;;;I"2Card::Query::SqlStatement#standard_conditions;F;[[I" query;T0;[[@dif[@di;F;:standard_conditions;;;[;{;IC;" ;T;@2e;.0;F;[;[; I";T;!0;'@d;(I"#def standard_conditions(query);T;)T;*I"qdef standard_conditions query [trash_condition(query), permission_conditions(query)].compact * ' AND ' end;T;+To; ; F; ;,;;;I".Card::Query::SqlStatement#trash_condition;F;[[I" table;T0;[[@dij[@di;F;:trash_condition;;;[;{;IC;" ;T;@Be;.0;F;[;[; I";T;!0;'@d;(I"def trash_condition(table);T;)T;*I"Jdef trash_condition query "#{query.table_alias}.trash is false" end;T;+To; ; F; ;,;;;I"4Card::Query::SqlStatement#permission_conditions;F;[[I" table;T0;[[@din[@di;F;:permission_conditions;;;[;{;IC;" ;T;@Re;.0;F;[;[; I";T;!0;'@d;(I"%def permission_conditions(table);T;)T;*I"def permission_conditions query unless Auth.always_ok? read_rules = Auth.as_card.read_rules read_rule_list = read_rules.nil? ? 1 : read_rules.join(',') "#{query.table_alias}.read_rule_id IN (#{ read_rule_list })" end end;T;+To; ; F; ;,;;;I"$Card::Query::SqlStatement#group;F;[;[[@div[@di;F;: group;;;[;{;IC;" ;T;@be;.0;F;[;[; I";T;!0;'@d;(I"def group;T;)T;*I"]def group group = @mods[:group] "GROUP BY #{ safe_sql group }" if group.present? end;T;+To; ; F; ;,;;;I"/Card::Query::SqlStatement#limit_and_offset;F;[;[[@di{[@di;F;:limit_and_offset;;;[;{;IC;" ;T;@pe;.0;F;[;[; I";T;!0;'@d;(I"def limit_and_offset;T;)T;*I"def limit_and_offset full_syntax do limit, offset = @mods[:limit], @mods[:offset] if limit.to_i > 0 string = "LIMIT #{ limit.to_i } " string += "OFFSET #{ offset.to_i } " if offset.present? string end end end;T;+To; ; F; ;,;;;I"*Card::Query::SqlStatement#full_syntax;F;[;[[@di[@di;F;:full_syntax;;;[;{;IC;" ;T;@~e;.0;F;[;[; I";T;!0;'@d;(I"def full_syntax;T;)T;*I"^def full_syntax unless @query.superquery or @mods[:return]=='count' yield end end;T;+To; ; F; ;,;;;I"$Card::Query::SqlStatement#order;F;[;[[@di[@di;F;: order;;;[;{;IC;" ;T;@e;.0;F;[;[; I";T;!0;'@d;(I"def order;T;)T;*I"def order full_syntax do order_key ||= @mods[:sort].blank? ? "update" : @mods[:sort] order_directives = [order_key].flatten.map do |key| dir = if @mods[:dir].blank? DEFAULT_ORDER_DIRS[key.to_sym] || 'asc' else safe_sql @mods[:dir] end sort_field key, @mods[:sort_as], dir end.join ', ' "ORDER BY #{order_directives}" end end;T;+To; ; F; ;,;;;I")Card::Query::SqlStatement#sort_field;F;[[I"key;T0[I"as;T0[I"dir;T0;[[@di[@di;F;:sort_field;;;[;{;IC;" ;T;@e;.0;F;[;[; I";T;!0;'@d;(I"!def sort_field(key, as, dir);T;)T;*I"1def sort_field key, as, dir table = @query.table_alias order_field = case key when "id"; "#{table}.id" when "update"; "#{table}.updated_at" when "create"; "#{table}.created_at" when /^(name|alpha)$/; "LOWER( #{table}.key )" when 'content'; "#{table}.db_content" when "relevance"; "#{table}.updated_at" #deprecated else safe_sql(key) end order_field = "CAST(#{order_field} AS #{cast_type(safe_sql as)})" if as @fields += ", #{order_field}" "#{order_field} #{dir}" end;T;+To; ; F; ;,;;;I"'Card::Query::SqlStatement#safe_sql;F;[[I"txt;T0;[[@di[@di;F;;;;;[;{;IC;" ;T;@e;.0;F;[;[; I";T;!0;'@d;(I"def safe_sql(txt);T;)T;*I"def safe_sql(txt) txt = txt.to_s txt.match( /[^\w\*\(\)\s\.\,]/ ) ? raise( "WQL contains disallowed characters: #{txt}" ) : txt end;T;+To; ; F; ;,;;;I"(Card::Query::SqlStatement#cast_type;F;[[I" type;T0;[[@di[@di;F;:cast_type;;;[;{;IC;" ;T;@e;.0;F;[;[; I";T;!0;'@d;(I"def cast_type(type);T;)T;*I"def cast_type(type) cxn ||= ActiveRecord::Base.connection (val = cxn.cast_types[type.to_sym]) ? val[:name] : safe_sql(type) end;T;+To; ; F; ;,;;;I"&Card::Query::SqlStatement#comment;F;[;[[@di%;F;: comment;;;[;{;IC;" ;T;@e;.0;F;[;[; I";T;!0;'@d;(I"def comment;T;)T;*I"odef comment return nil unless Card.config.sql_comments && @query.comment "/* #{@query.comment} */" end;T;+To; ; F; ;,;;;I")Card::Query::SqlStatement#full_field;F;[[I" table;T0[I" field;T0;[[@di6;F;:full_field;;;[;{;IC;" ;T;@e;.0;F;[;[; I";T;!0;'@d;(I" def full_field table, field;T;)T;*I"^def full_field table, field case field when :raw then "#{table}.*" when :card then "#{table}.name" when :content then "#{table}.db_content" when :count "coalesce(count( distinct #{table}.id),0) as count" else if ATTRIBUTES[field.to_sym] == :basic "#{table}.#{field}" else safe_sql field end end end;T;+To; ; F; ;,;;;I"-Card::Query::SqlStatement#join_on_clause;F;[[I" join;T0;[[@diO;F;:join_on_clause;;;[;{;IC;" ;T;@e;.0;F;[;[; I";T;!0;'@d;(I"def join_on_clause join;T;)T;*I"Vdef join_on_clause join [join_clause(join), 'ON', on_clause(join)].join ' ' end;T;+To; ; F; ;,;;;I"+Card::Query::SqlStatement#deeper_joins;F;[[I" join;T0;[[@diS;F;:deeper_joins;;;[;{;IC;" ;T;@e;.0;F;[;[; I";T;!0;'@d;(I"def deeper_joins join;T;)T;*I"def deeper_joins join deeper_joins = join.subjoins deeper_joins += join.to.all_joins if join.to.is_a? Card::Query deeper_joins end;T;+To; ; F; ;,;;;I"(Card::Query::SqlStatement#on_clause;F;[[I" join;T0;[[@dig;F;;;;;[;{;IC;" ;T;@ f;.0;F;[;[; I";T;!0;'@d;(I"def on_clause join;T;)T;*I"def on_clause join on_conditions = join.conditions on_ids = [ "#{join.from_alias}.#{join.from_field}", "#{join.to_alias}.#{join.to_field}" ].join ' = ' on_conditions.unshift on_ids if join.to.is_a? Card::Query if join.to.conditions_on_join == join on_conditions.push query_conditions(join.to) end on_conditions.push standard_conditions(join.to) end basic_conditions(on_conditions) * ' AND ' end;T;+T;I@d;JIC;[;I@d;KIC;[;I@d;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@di;F;:SqlStatement;;;;;[;{;IC;" ;T;@d;.0;F;[;[; I";T;!0;'@,^;I"Card::Query::SqlStatement;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+To; ;IC;[o; ; F; ;,;;;I" Card::Query::SqlCond#to_sql;F;[[I" *args;T0;[[@di;F;;;;;[;{;IC;" ;T;@,f;.0;F;[;[; I";T;!0;'@*f;(I"def to_sql *args;T;)T;*I" def to_sql *args self end;T;+T;I@*f;JIC;[;I@*f;KIC;[;I@*f;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@di;F;: SqlCond;;;;;[;{;IC;" ;T;@*f;.0;F;[;[; I";T;!0;'@,^;I"Card::Query::SqlCond;F;Io;S ;T0;U0;V0;: String;'@,^;W0;X; ;+To;4;[[I"lib/card/query.rb;Ti7[I"lib/card/query.rb;Ti3[I"lib/card/query.rb;Ti4;F;:ATTRIBUTES;;;;;[;{;IC;" ;T;@Lf;.0;F;[;[; I";T;!0;'@,^;I"Card::Query::ATTRIBUTES;F;(I"ATTRIBUTES = {;T;*I"pATTRIBUTES = { basic: %w( id name key type_id content left_id right_id creator_id updater_id codename read_rule_id ), relational: %w( type part left right editor_of edited_by last_editor_of last_edited_by creator_of created_by member_of member ), plus_relational: %w( plus left_plus right_plus ), ref_relational: %w( refer_to referred_to_by link_to linked_to_by include included_by ), conjunction: %w( and or all any ), special: %w( found_by not sort match complete extension_type ), ignore: %w( prepend append view params vars size ) }.inject({}) { |h, pair| pair[1].each { |v| h[v.to_sym] = pair[0] }; h };T;6I"c{ basic: %w( id name key type_id content left_id right_id creator_id updater_id codename read_rule_id ), relational: %w( type part left right editor_of edited_by last_editor_of last_edited_by creator_of created_by member_of member ), plus_relational: %w( plus left_plus right_plus ), ref_relational: %w( refer_to referred_to_by link_to linked_to_by include included_by ), conjunction: %w( and or all any ), special: %w( found_by not sort match complete extension_type ), ignore: %w( prepend append view params vars size ) }.inject({}) { |h, pair| pair[1].each { |v| h[v.to_sym] = pair[0] }; h };T;+To;4;[[@OfiE[@QfiA[@SfiC;F;:CONJUNCTIONS;;;;;[;{;IC;" ;T;@^f;.0;F;[;[; I";T;!0;'@,^;I"Card::Query::CONJUNCTIONS;F;(I"OCONJUNCTIONS = { any: :or, in: :or, or: :or, all: :and, and: :and }.freeze;T;*I"OCONJUNCTIONS = { any: :or, in: :or, or: :or, all: :and, and: :and }.freeze;T;6I"@{ any: :or, in: :or, or: :or, all: :and, and: :and }.freeze;T;+To;4;[[@OfiG[@QfiC[@SfiE;F;:MODIFIERS;;;;;[;{;IC;" ;T;@mf;.0;F;[;[; I";T;!0;'@,^;I"Card::Query::MODIFIERS;F;(I"FMODIFIERS = %w( conj return sort sort_as group dir limit offset );T;*I"rMODIFIERS = %w( conj return sort sort_as group dir limit offset ) .inject({}) { |h, v| h[v.to_sym] = nil; h };T;6I"f%w( conj return sort sort_as group dir limit offset ) .inject({}) { |h, v| h[v.to_sym] = nil; h };T;+To;4;[[@OfiJ[@QfiF[@SfiH;F;:OPERATORS;;;;;[;{;IC;" ;T;@|f;.0;F;[;[; I";T;!0;'@,^;I"Card::Query::OPERATORS;F;(I"QOPERATORS = %w( != = =~ < > in ~ ).inject({}) { |h, v| h[v] = v; h }.merge({;T;*I"OPERATORS = %w( != = =~ < > in ~ ).inject({}) { |h, v| h[v] = v; h }.merge({ eq: '=', gt: '>', lt: '<', match: '~', ne: '!=', 'not in' => nil }.stringify_keys);T;6I"%w( != = =~ < > in ~ ).inject({}) { |h, v| h[v] = v; h }.merge({ eq: '=', gt: '>', lt: '<', match: '~', ne: '!=', 'not in' => nil }.stringify_keys);T;+To;4;[[@OfiN[@QfiJ[@SfiL;F;:DEFAULT_ORDER_DIRS;;;;;[;{;IC;" ;T;@f;.0;F;[;[; I";T;!0;'@,^;I"$Card::Query::DEFAULT_ORDER_DIRS;F;(I"FDEFAULT_ORDER_DIRS = { update: 'desc', relevance: 'desc' }.freeze;T;*I"FDEFAULT_ORDER_DIRS = { update: 'desc', relevance: 'desc' }.freeze;T;6I"1{ update: 'desc', relevance: 'desc' }.freeze;T;+To; ; F; ;,;;;I"Card::Query#statement;F;[;[[@OfiP[@QfiL[@SfiN;F;:statement;;;[;{;IC;"-Returns the value of attribute statement ;T;@f;.0;F;[;[; I"-Returns the value of attribute statement;T;!0;'@,^;(I"def statement;T;*I"#def statement @statement end;T;+To; ; F; ;,;;;I"Card::Query#mods;F;[;[[@OfiP[@QfiL[@SfiN;F;: mods;;;[;{;IC;"(Returns the value of attribute mods ;T;@f;.0;F;[;[; I"(Returns the value of attribute mods;T;!0;'@,^;(I" def mods;T;*I"def mods @mods end;T;+To; ; F; ;,;;;I"Card::Query#conditions;F;[;[[@OfiP[@QfiL[@SfiN;F;;;;;[;{;IC;".Returns the value of attribute conditions ;T;@f;.0;F;[;[; I".Returns the value of attribute conditions;T;!0;'@,^;(I"def conditions;T;*I"%def conditions @conditions end;T;+To; ; F; ;,;;;I"Card::Query#subqueries;F;[;[[@OfiP[@QfiL[@SfiN;F;:subqueries;;;[;{;IC;".Returns the value of attribute subqueries ;T;@f;.0;F;[;[; I".Returns the value of attribute subqueries;T;!0;'@,^;(I"def subqueries;T;*I"%def subqueries @subqueries end;T;+To; ; F; ;,;;;I"Card::Query#superquery;F;[;[[@OfiP[@QfiL[@SfiN;F;:superquery;;;[;{;IC;".Returns the value of attribute superquery ;T;@f;.0;F;[;[; I".Returns the value of attribute superquery;T;!0;'@,^;(I"def superquery;T;*I"%def superquery @superquery end;T;+To; ; F; ;,;;;I"Card::Query#joins;F;[;[[@OfiR[@QfiN[@SfiP;F;;;;;[;{;IC;")Returns the value of attribute joins ;T;@f;.0;F;[;[; I")Returns the value of attribute joins;T;!0;'@,^;(I"def joins;T;*I"def joins @joins end;T;+To; ; F; ;,;;;I"Card::Query#joins=;F;[[I" value;T0;[[@OfiR[@QfiN[@SfiP;F;: joins=;;;[;{;IC;"Sets the attribute joins ;T;@f;.0;F;[;[o;0 ;1I" param;F;2I"-the value to set the attribute joins to.;T;I" value;T;30;@f; I"SSets the attribute joins @param value the value to set the attribute joins to.;T;!0;'@,^;(I"def joins=(value);T;*I"+def joins=(value) @joins = value end;T;+To; ; F; ;,;;;I"Card::Query#table_seq;F;[;[[@OfiR[@QfiN[@SfiP;F;:table_seq;;;[;{;IC;"-Returns the value of attribute table_seq ;T;@ g;.0;F;[;[; I"-Returns the value of attribute table_seq;T;!0;'@,^;(I"def table_seq;T;*I"#def table_seq @table_seq end;T;+To; ; F; ;,;;;I"Card::Query#table_seq=;F;[[I" value;T0;[[@OfiR[@QfiN[@SfiP;F;:table_seq=;;;[;{;IC;"!Sets the attribute table_seq ;T;@g;.0;F;[;[o;0 ;1I" param;F;2I"1the value to set the attribute table_seq to.;T;I" value;T;30;@g; I"[Sets the attribute table_seq @param value the value to set the attribute table_seq to.;T;!0;'@,^;(I"def table_seq=(value);T;*I"3def table_seq=(value) @table_seq = value end;T;+To; ; F; ;,;;;I"#Card::Query#conditions_on_join;F;[;[ [@OfiR[@Ofi[@QfiN[@Qfi[I"lib/card/query.rb;Ti[I"lib/card/query.rb;Ti[@SfiP;F;:conditions_on_join;;;[;{;IC;"6Returns the value of attribute conditions_on_join ;T;@-g;.0;F;[;[; I"6Returns the value of attribute conditions_on_join;T;!0;'@,^;(I"def conditions_on_join;T;)T;*I"5def conditions_on_join @conditions_on_join end;T;+To; ; F; ;,;;;I"$Card::Query#conditions_on_join=;F;[[I" value;T0;[[@OfiR[@QfiN[@SfiP;F;:conditions_on_join=;;;[;{;IC;"*Sets the attribute conditions_on_join ;T;@Bg;.0;F;[;[o;0 ;1I" param;F;2I":the value to set the attribute conditions_on_join to.;T;I" value;T;30;@Bg; I"mSets the attribute conditions_on_join @param value the value to set the attribute conditions_on_join to.;T;!0;'@,^;(I"#def conditions_on_join=(value);T;*I"Edef conditions_on_join=(value) @conditions_on_join = value end;T;+To; ; F; ;,;;;I"Card::Query#initialize;F;[[I"statement;T0[I" comment;TI"nil;T;[[@OfiT[@QfiP[@SfiR;F;;C;;;[;{;IC;" ;T;@Wg;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of Query;T;0;3[I" Query;F;@Wg; I";T;!0;'@,^;(I"+def initialize(statement, comment=nil);T;)T;*I"Qdef initialize statement @subqueries, @joins, @conditions = [], [], [] @mods = {} @statement = statement.clone @context = @statement.delete(:context) || nil @superquery = @statement.delete(:superquery) || nil @vars = @statement.delete(:vars) || {} @vars.symbolize_keys! interpret @statement self end;T;+To; ; F; ; ;;;I"Card::Query.run;F;[[I"statement;T0[I" comment;TI"nil;T;[ [@Ofij[@Qfif[@8gii[@Sfio;T;:run;;;[;{;IC;"Query Execution By default a query returns card objects. This is accomplished by returning a card identifier from SQL and then hooking into our caching system (see Card::Fetch) ;T;@pg;F;[;[; I"Query Execution By default a query returns card objects. This is accomplished by returning a card identifier from SQL and then hooking into our caching system (see Card::Fetch);T;!0;"o;#;$F;%ij;&im;'@,^;(I"$def run(statement, comment=nil);T;)T;*I"Cdef self.run statement query = new statement query.run end;T;+To; ; F; ;,;;;I"Card::Query#run;F;[;[ [@8gip[@Ofio[@Qfik[@Sfiu;T;;;;;[;{;IC;"run the current query ;T;@g;F;[;[o;0 ;1I" return;F;2I"%array of card objects by default;T;0;30;@g; I"Crun the current query @return array of card objects by default;T;!0;"o;#;$F;%is;⁢'@,^;(I" def run;T;)T;*I"def run retrn = statement[:return].present? ? statement[:return].to_s : 'card' if retrn == 'card' get_results('name').map do |name| Card.fetch name, new: {} end else get_results retrn end end;T;+To; ; F; ;,;;;I"Card::Query#get_results;F;[[I" retrn;T0;[ [@6gi{[@Ofiz[@Qfiv[@8gi|[@Sfi|;T;:get_results;;;[;{;IC;" ;T;@g;F;[;[o;0 ;1I" return;F;2I"?Integer for :count, otherwise Array of Strings or Integers;T;0;30;@g; I"G@return Integer for :count, otherwise Array of Strings or Integers;T;!0;"o;#;$F;%i{;&i{;'@,^;(I"def get_results(retrn);T;)T;*I"def get_results retrn rows = run_sql if retrn == 'name' && (statement[:prepend] || statement[:append]) rows.map do |row| [ statement[:prepend], row['name'], statement[:append] ].compact * '+' end else case retrn when 'count' ; rows.first['count'].to_i when 'raw' ; rows when /id$/ ; rows.map { |row| row[retrn].to_i } else ; rows.map { |row| row[retrn] } end end end;T;+To; ; F; ;,;;;I"Card::Query#run_sql;F;[;[ [@Ofi[@Qfi[@6gi[@8gi[@Sfi;F;: run_sql;;;[;{;IC;" ;T;@g;.0;F;[;[; I";T;!0;'@,^;(I"def run_sql;T;)T;*I"~def run_sql #puts "\nstatement = #{@statement}" #puts "sql = #{sql}" ActiveRecord::Base.connection.select_all( sql ) end;T;+To; ; F; ;,;;;I"Card::Query#sql;F;[;[ [@Ofi[@Qfi[@6gi[@8gi[@Sfi;F;:sql;;;[;{;IC;" ;T;@g;.0;F;[;[; I";T;!0;'@,^;(I" def sql;T;)T;*I"=def sql @sql ||= SqlStatement.new(self).build.to_s end;T;+To; ; F; ;,;;;I"Card::Query#root;F;[;[ [@Ofi[@Qfi[@6gi[@8gi[@Sfi;T;;;;;[;{;IC;"Query Hierarchy @root, @subqueries, and @superquery are used to track a hierarchy of query objects. This nesting allows to find, for example, cards that link to cards that link to cards.... ;T;@g;F;[;[; I"Query Hierarchy @root, @subqueries, and @superquery are used to track a hierarchy of query objects. This nesting allows to find, for example, cards that link to cards that link to cards....;T;!0;"o;#;$F;%i;&i;'@,^;(I" def root;T;)T;*I"Cdef root @root ||= @superquery ? @superquery.root : self end;T;+To; ; F; ;,;;;I"Card::Query#subquery;F;[[I" opts;TI"{};T;[ [@Ofi[@Qfi[@6gi[@8gi[@Sfi;F;: subquery;;;[;{;IC;" ;T;@g;.0;F;[;[; I";T;!0;'@,^;(I"def subquery(opts={});T;)T;*I"wdef subquery opts={} subquery = Query.new opts.merge(:superquery=>self) @subqueries << subquery subquery end;T;+To; ; F; ;,;;;I"Card::Query#interpret;F;[[I" clause;T0;[ [@Ofi[@Qfi[@6gi[@8gi[@Sfi;T;;;;;[;{;IC;"0normalize and extract meaning from a clause ;T;@g;F;[;[o;0 ;1I" param;F;2I"statement or chunk thereof;T;I" clause;T;3[I" Hash;TI" String;TI" Integer;T;@g; I"qnormalize and extract meaning from a clause @param clause [Hash, String, Integer] statement or chunk thereof;T;!0;"o;#;$F;%i;&i;'@,^;(I"def interpret(clause);T;)T;*I"Idef interpret clause interpret_by_key normalize_clause(clause) end;T;+To; ; F; ;,;;;I"!Card::Query#normalize_clause;F;[[I" clause;T0;[ [@Ofi[@Qfi[@6gi[@8gi[@Sfi;F;:normalize_clause;;;[;{;IC;" ;T;@h;.0;F;[;[; I";T;!0;'@,^;(I"!def normalize_clause(clause);T;)T;*I"def normalize_clause clause clause = clause_to_hash clause clause.symbolize_keys! clause.each do |key,val| clause[key] = normalize_value val end clause end;T;+To; ; F; ;,;;;I"Card::Query#clause_to_hash;F;[[I" clause;T0;[ [@Ofi[@Qfi[@6gi[@8gi[@Sfi;F;:clause_to_hash;;;[;{;IC;" ;T;@(h;.0;F;[;[; I";T;!0;'@,^;(I"def clause_to_hash(clause);T;)T;*I"def clause_to_hash clause case clause when Hash; clause when String; { :key => clause.to_name.key } when Integer; { :id => clause } else raise BadQuery, "Invalid query args #{clause.inspect}" end end;T;+To; ; F; ;,;;;I" Card::Query#normalize_value;F;[[I"val;T0;[ [@Ofi[@Qfi[@6gi[@8gi[@Sfi;F;:normalize_value;;;[;{;IC;" ;T;@;h;.0;F;[;[; I";T;!0;'@,^;(I"def normalize_value(val);T;)T;*I"def normalize_value val case val when Integer, Float, Symbol, Hash ; val when String, Card::Name ; normalize_string_value val when Array ; val.map { |v| normalize_value v } else raise BadQuery, "unknown WQL value type: #{val.class}" end end;T;+To; ; F; ;,;;;I"'Card::Query#normalize_string_value;F;[[I"val;T0;[ [@Ofi[@Qfi[@6gi[@8gi[@Sfi;F;:normalize_string_value;;;[;{;IC;" ;T;@Nh;.0;F;[;[; I";T;!0;'@,^;(I"$def normalize_string_value(val);T;)T;*I"def normalize_string_value val case val.to_s when /^\$(\w+)$/ # replace from @vars @vars[$1.to_sym].to_s.strip when /\b_/ # absolutize based on @context val.to_name.to_absolute(context) else val end end;T;+To; ; F; ;,;;;I"Card::Query#context;F;[;[ [@Ofi[@Qfi[@6gi[@8gi[@Sfi;F;: context;;;[;{;IC;" ;T;@ah;.0;F;[;[; I";T;!0;'@,^;(I"def context;T;)T;*I"xdef context if !@context.nil? @context else @context = @superquery ? @superquery.context : '' end end;T;+To; ; F; ;,;;;I"!Card::Query#interpret_by_key;F;[[I" clause;T0;[ [@Ofi[@Qfi[@6gi[@8gi[@Sfi;F;:interpret_by_key;;;[;{;IC;" ;T;@rh;.0;F;[;[; I";T;!0;'@,^;(I"!def interpret_by_key(clause);T;)T;*I"def interpret_by_key clause clause.each do |key,val| case when OPERATORS.has_key?(key.to_s) && !ATTRIBUTES[key] # eg "match" is both operator and attribute; # interpret as attribute when "match" is key interpret content: [key,val] when MODIFIERS.has_key?(key) && !clause[key].is_a?(Hash) # eg when "sort" is hash, it can have subqueries # and must be interpreted like an attribute @mods[key] = Array === val ? val : val.to_s else interpret_attributes key, val end end end;T;+To; ; F; ;,;;;I"Card::Query#add_condition;F;[[I" *args;T0;[ [@Ofi[@Qfi[@6gi[@8gi[@Sfi;F;:add_condition;;;[;{;IC;" ;T;@h;.0;F;[;[; I";T;!0;'@,^;(I"def add_condition(*args);T;)T;*I"def add_condition *args cond = conditions_on_join ? joins.last.conditions : @conditions cond << if args.size > 1 [ args.shift, Value.new(args.shift, self) ] else [ :cond, SqlCond.new(args[0]) ] end end;T;+To; ; F; ;,;;;I"%Card::Query#interpret_attributes;F;[[I"key;T0[I"val;T0;[ [@Ofi[@Qfi[@6gi[@8gi[@Sfi;F;:interpret_attributes;;;[;{;IC;" ;T;@h;.0;F;[;[; I";T;!0;'@,^;(I"'def interpret_attributes(key, val);T;)T;*I"def interpret_attributes key, val case ATTRIBUTES[key] when :basic ; add_condition key, val when :conjunction ; send key, val when :relational, :special ; relate key, val when :ref_relational ; relate key, val, method: :join_references when :plus_relational ; relate_compound key, val when :ignore ; #noop else ; raise BadQuery, "Invalid attribute #{key}" end end;T;+To; ; F; ;,;;;I" Card::Query#relate_compound;F;[[I"key;T0[I"val;T0;[ [@Ofi[@Qfi[@6gi[@8gi;F;:relate_compound;;;[;{;IC;" ;T;@h;.0;F;[;[; I";T;!0;'@,^;(I""def relate_compound(key, val);T;)T;*I"def relate_compound key, val has_multiple_values = Array===val && ( Array===val.first || !!conjunction(val.first) ) relate key, val, multiple: has_multiple_values end;T;+To; ; F; ;,;;;I"Card::Query#relate;F;[[I"key;T0[I"val;T0[I" opts;TI"{};T;[ [@Ofi[@Qfi[@6gi [@8gi ;F;: relate;;;[;{;IC;" ;T;@h;.0;F;[;[; I";T;!0;'@,^;(I""def relate(key, val, opts={});T;)T;*I"def relate key, val, opts={} multiple = opts[:multiple].nil? ? Array===val : opts[:multiple] method = opts[:method] || :send if multiple conj = conjunction( val.first ) ? conjunction( val.shift ) : :and if conj == current_conjunction # same conjunction as container, no need for subcondition val.each { |v| send method, key, v } else send conj, val.map { |v| { key => v } } end else send method, key, val end end;T;+To; ; F; ;,;;;I"$Card::Query#current_conjunction;F;[;[ [@Ofi[@Qfi[@6gi[@8gi;F;:current_conjunction;;;[;{;IC;" ;T;@h;.0;F;[;[; I";T;!0;'@,^;(I"def current_conjunction;T;)T;*I"Ldef current_conjunction @mods[:conj].blank? ? :and : @mods[:conj] end;T;+To; ; F; ;,;;;I"p;F;[;[[@SfiN;F;;;;;[;{;IC;"+Returns the value of attribute comment ;T;@h;.0;F;[;[; I"+Returns the value of attribute comment;T;!0;'@,^;(I"def comment;T;*I"def comment @comment end;T;+To; ; F; ;,;;;I"_cache_for_user(user;F;[;[[@SfiP;F;: unjoined;;;[;{;IC;",Returns the value of attribute unjoined ;T;@h;.0;F;[;[; I",Returns the value of attribute unjoined;T;!0;'@,^;(I"def unjoined;T;*I"!def unjoined @unjoined end;T;+To; ; F; ;,;;;I" F0 ;F;[[I" value;T0;[[@SfiP;F;:unjoined=;;;[;{;IC;" Sets the attribute unjoined ;T;@i;.0;F;[;[o;0 ;1I" param;F;2I"0the value to set the attribute unjoined to.;T;I" value;T;30;@i; I"YSets the attribute unjoined @param value the value to set the attribute unjoined to.;T;!0;'@,^;(I"def unjoined=(value);T;*I"1def unjoined=(value) @unjoined = value end;T;+To; ; F; ;,;;;I" Card::Query#default_comment;F;[;[[@Sfie;F;:default_comment;;;[;{;IC;" ;T;@i;.0;F;[;[; I";T;!0;'@,^;(I"def default_comment;T;)T;*I"bdef default_comment return if @superquery || !Card.config.sql_comments statement.to_s end;T;+To; ; F; ;,;;;I" 7籽;F;[;[[@Sfi;F;:all_joins;;;[;{;IC;" ;T;@"i;.0;F;[;[; I";T;!0;'@,^;(I"def all_joins;T;)T;*I"ldef all_joins @all_joins ||= (joins + subqueries.select(&:unjoined).map(&:all_joins)).flatten end;T;+T;I@,^;JIC;[;I@,^;KIC;[o;S ;T0;U0;V0;;;'@,^;W@a;X;Yo;S ;T0;U0;V0;;;'@`;W@`;X;Y;I@,^;LIC;M{; IC;M{;NT;,IC;M{;IC;M{;C@f;D0;NT;IC;M{;C@f;D0;NT;IC;M{;C@f;D0;NT;IC;M{;C@f;D0;NT;IC;M{;C@f;D0;NT;IC;M{;C@f;D@f;NT;IC;M{;C@ g;D@g;NT;IC;M{;C@-g;D@Bg;NT;IC;M{;C@h;D0;NT;IC;M{;C@h;D@i;NT;NT;NT;O{;P[;[ [@Qfi%[@5^i[@<`i[@ai[@ai[@di[@Ofi);T;;;;;;;[;{;IC;"Card::Query is for finding implicit lists (or counts of lists) of cards. Search and Set cards use Card::Query to query the database, and it's also frequently used directly in code. Query "statements" (objects, really) are made in WQL (Wagn Query Language). Because WQL is used by Wagneers, the primary language documentation is on wagn.org. (http://wagn.org/WQL_Syntax). Note that the examples there are in JSON, like Search card content, but statements in Card::Query are in ruby form. In Wagn's current form, Card::Query generates and executes SQL statements. However, the SQL generation is largely (not yet fully) separated from the WQL statement interpretation. The most common way to use Card::Query is as follows: list_of_cards = Card::Query.run(statement) This is equivalent to: query = Card::Query.new(statement) list_of_cards = query.run Upon initiation, the query is interpreted, and the following key objects are populated: - @join - an Array of Card::Query::Join objects - @conditions - an Array of conditions - @mod - a Hash of other query-altering keys - @subqueries - a list of other queries nested within this one Each condition is either a SQL-ready string (boo) or an Array in this form: [ field_string_or_sym, Card::Value::Query object ] ;T;@,^;F;[;[; I"Card::Query is for finding implicit lists (or counts of lists) of cards. Search and Set cards use Card::Query to query the database, and it's also frequently used directly in code. Query "statements" (objects, really) are made in WQL (Wagn Query Language). Because WQL is used by Wagneers, the primary language documentation is on wagn.org. (http://wagn.org/WQL_Syntax). Note that the examples there are in JSON, like Search card content, but statements in Card::Query are in ruby form. In Wagn's current form, Card::Query generates and executes SQL statements. However, the SQL generation is largely (not yet fully) separated from the WQL statement interpretation. The most common way to use Card::Query is as follows: list_of_cards = Card::Query.run(statement) This is equivalent to: query = Card::Query.new(statement) list_of_cards = query.run Upon initiation, the query is interpreted, and the following key objects are populated: - @join - an Array of Card::Query::Join objects - @conditions - an Array of conditions - @mod - a Hash of other query-altering keys - @subqueries - a list of other queries nested within this one Each condition is either a SQL-ready string (boo) or an Array in this form: [ field_string_or_sym, Card::Value::Query object ];T;!0;"o;#;$F;%i ;&i(;'@;I"Card::Query;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+To;7;IC;[o;4;[[I"lib/card/view_cache.rb;Ti ;F;: SIZE;;;;;[;{;IC;" ;T;@Ui;.0;F;[;[; I";T;!0;'@Si;I"Card::ViewCache::SIZE;F;(I"SIZE = 500;T;*I"SIZE = 500;T;6I"500;T;+To;4;[[@Xii ;T;: LIMIT;;;;;[;{;IC;"2reduce cache size to SIZE if LIMIT is reached ;T;@ci;F;[;[; I"2reduce cache size to SIZE if LIMIT is reached;T;!0;"o;#;$F;%i ;&i ;'@Si;I"Card::ViewCache::LIMIT;F;(I"ALIMIT = 1000 # reduce cache size to SIZE if LIMIT is reached;T;*I"LIMIT = 1000;T;6I" 1000;T;+To;4;[[@Xii ;F;: CNT_KEY;;;;;[;{;IC;" ;T;@qi;.0;F;[;[; I";T;!0;'@Si;I"Card::ViewCache::CNT_KEY;F;(I"&CNT_KEY = 'view_cache_cnt'.freeze;T;*I"&CNT_KEY = 'view_cache_cnt'.freeze;T;6I"'view_cache_cnt'.freeze;T;+To;4;[[@Xii ;F;:FREQUENCY_KEY;;;;;[;{;IC;" ;T;@~i;.0;F;[;[; I";T;!0;'@Si;I"#Card::ViewCache::FREQUENCY_KEY;F;(I"2FREQUENCY_KEY = 'view_cache_frequency'.freeze;T;*I"2FREQUENCY_KEY = 'view_cache_frequency'.freeze;T;6I""'view_cache_frequency'.freeze;T;+To; ; F; ; ;;;I"Card::ViewCache.cache;F;[;[[@Xii;F;;;;;[;{;IC;" ;T;@i;.0;F;[;[; I";T;!0;'@Si;(I"def cache;T;)T;*I"1def cache Card::Cache[Card::ViewCache] end;T;+To; ; F; ; ;;;I""Card::ViewCache.increment_cnt;F;[;[[@Xii;F;:increment_cnt;;;[;{;IC;" ;T;@i;.0;F;[;[; I";T;!0;'@Si;(I"def increment_cnt;T;)T;*I":def increment_cnt cache.write(CNT_KEY, count+1) end;T;+To; ; F; ; ;;;I"Card::ViewCache.count;F;[;[[@Xii;F;;s;;;[;{;IC;" ;T;@i;.0;F;[;[; I";T;!0;'@Si;(I"def count;T;)T;*I"-def count cache.read(CNT_KEY) || 0 end;T;+To; ; F; ; ;;;I"!Card::ViewCache.reduce_cache;F;[;[[@Xii[I"lib/card/view_cache.rb;Ti9;F;:reduce_cache;;;[;{;IC;" ;T;@i;.0;F;[;[; I";T;!0;'@Si;(I"def reduce_cache;T;)T;*I"Mdef reduce_cache update_frequency do |freq| cnts_with_key = freq.keys.map { |key| [freq[key], key] } index = 1 SortedSet.new(cnts_with_key).each do |cnt, key| if index < (LIMIT - SIZE) cache.delete(key) freq.delete(key) else freq[key] = 0 end index += 1 end end end;T;+To; ; F; ; ;;;I"%Card::ViewCache.update_frequency;F;[;[[@Xii*[@iiI;F;:update_frequency;;;[;{;IC;" ;T;@i;.0;F;[;[o;0 ;1I" yield;F;2I";T;0;3[I" freq;T;@i; I";T;!0;'@Si;(I"def update_frequency;T;)T;*I"wdef update_frequency freq = cache.read(FREQUENCY_KEY) || {} yield(freq) cache.write(FREQUENCY_KEY, freq) end;T;+To; ; F; ; ;;;I"Card::ViewCache.fetch;F;[ [I" format;T0[I" view;T0[I" args;T0[I" &block;T0;[[@Xii0[@ii;F;;;;;[;{;IC;" ;T;@i;.0;F;[;[; I";T;!0;'@Si;(I"*def fetch(format, view, args, &block);T;)T;*I"def fetch(format, view, args, &block) if !Card.config.view_cache || !format.view_caching? || !format.main? || (view != :open && view != :content) || format.class != HtmlFormat return block.call end roles = Card::Auth.current.all_roles.sort.join '_' key = "view_#{view}_#{format.card.key}_args_#{Card::Cache.obj_to_key(args)}_roles_#{roles}" if !cache.exist?(key) increment_cnt reduce_cache if count > LIMIT end update_frequency do |freq| freq[key] ||= 0 freq[key] += 1 end if Card.config.view_cache == 'debug' if cache.exist? key "fetched from view cache: #{cache.read key}" else "written to view cache: #{cache.fetch(key, &block)}" end else cache.fetch(key, &block) end end;T;+To; ; F; ; ;;;I"Card::ViewCache.reset;F;[;[[@XiiM[@ii#;F;;8;;;[;{;IC;" ;T;@i;.0;F;[;[; I";T;!0;'@Si;(I"def reset;T;)T;*I"0def reset hard=false cache.reset hard end;T;+To; ; F; ; ;;;I""Card::ViewCache.verbose_fetch;F;[;[[@ii);F;:verbose_fetch;;;[;{;IC;" ;T;@i;.0;F;[;[; I";T;!0;'@Si;(I"def verbose_fetch;T;)T;*I"def verbose_fetch if cache.exist? key "fetched from view cache: #{cache.read key}" else "written to view cache: #{cache.fetch(key, &block)}" end end;T;+To; ; F; ; ;;;I"/Card::ViewCache.increment_cached_views_cnt;F;[;[[@ii1;F;:increment_cached_views_cnt;;;[;{;IC;" ;T;@j;.0;F;[;[; I";T;!0;'@Si;(I"#def increment_cached_views_cnt;T;)T;*I"Tdef increment_cached_views_cnt cache.write(CNT_KEY, cached_views_cnt + 1) end;T;+To; ; F; ; ;;;I"%Card::ViewCache.cached_views_cnt;F;[;[[@ii5;F;:cached_views_cnt;;;[;{;IC;" ;T;@j;.0;F;[;[; I";T;!0;'@Si;(I"def cached_views_cnt;T;)T;*I"8def cached_views_cnt cache.read(CNT_KEY) || 0 end;T;+To; ; F; ; ;;;I"(Card::ViewCache.increment_frequency;F;[[I"key;T0;[[@iiO;F;:increment_frequency;;;[;{;IC;" ;T;@j;.0;F;[;[; I";T;!0;'@Si;(I" def increment_frequency key;T;)T;*I"ndef increment_frequency key update_frequency do |freq| freq[key] ||= 0 freq[key] += 1 end end;T;+To; ; F; ; ;;;I"Card::ViewCache.cache_key;F;[[I" view;T0[I" format;T0[I" args;T0;[[@iiV;F;;;;;[;{;IC;" ;T;@.j;.0;F;[;[; I";T;!0;'@Si;(I"%def cache_key view, format, args;T;)T;*I"def cache_key view, format, args roles_key = Card::Auth.current.all_roles.sort.join '_' args_key = Card::Cache.obj_to_key(args) '%s#%s__args__%s__roles__%s' % [format.card.key, view, args_key, roles_key] end;T;+To; ; F; ; ;;;I"$Card::ViewCache.cacheable_view?;F;[[I" view;T0[I" format;T0;[[@ii];F;:cacheable_view?;;;[;{;IC;" ;T;@Aj;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@Aj; I";T;!0;'@Si;(I"%def cacheable_view? view, format;T;)T;*I"def cacheable_view? view, format !Card.config.view_cache || !format.view_caching? || !format.main? || (view != :open && view != :content) || format.class != HtmlFormat end;T;+T;I@Si;JIC;[;I@Si;KIC;[;I@Si;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Xii;F;;|;;;;;[;{;IC;" ;T;@Si;.0;F;[;[; I";T;!0;'@;I"Card::ViewCache;F;+To;7;IC;[ o;7;IC;[o; ; F; ;,;;;I"/Card::Generators::ClassMethods#source_root;F;[[I" path;TI"nil;T;[[I"lib/generators/card.rb;Ti[I"lib/generators/card.rb;Ti;F;:source_root;;;[;{;IC;" ;T;@kj;.0;F;[;[; I";T;!0;'@ij;(I"def source_root(path=nil);T;)T;*I"def source_root(path = nil) if path @_card_source_root = path else @_card_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'card', generator_name, 'templates')) end end;T;+To; ; F; ;,;;;I"*Card::Generators::ClassMethods#banner;F;[;[[@sji[@uji;T;: banner;;;[;{;IC;">Override Rails default banner (wagn is the command name). ;T;@~j;F;[;[; I">Override Rails default banner (wagn is the command name).;T;!0;"o;#;$F;%i;&i;'@ij;(I"def banner;T;)T;*I"pdef banner "wagn generate #{namespace} #{self.arguments.map(&:usage)*' '} [options]".gsub(/\s+/, ' ') end;T;+T;I@ij;JIC;[;I@ij;KIC;[;I@ij;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@sji ;F;;;;;;;[;{;IC;" ;T;@ij;.0;F;[;[; I";T;!0;'@gj;I"#Card::Generators::ClassMethods;F;+To; ;IC;[;I@j;JIC;[o;S ;T0;U0;V0;;;'@gj;W@ij;X;Y;I@j;KIC;[;I@j;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@sji[@uji;F;:NamedBase;;;;;[;{;IC;" ;T;@j;.0;F;[;[; I";T;!0;'@gj;I" Card::Generators::NamedBase;F;Io;S ;T0;UI"!Rails::Generators::NamedBase;T;V@;;(;'o;S ;T0;UI"Rails::Generators;T;V@;:Generators;'o;S ;T0;U0;V0;: Rails;'@;W0;X0;W0;X0;W0;X; ;+To; ;IC;[;I@j;JIC;[o;S ;T0;U0;V0;;;'@gj;W@ij;X;Y;I@j;KIC;[;I@j;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@sji [@uji;F;:MigrationBase;;;;;[;{;IC;" ;T;@j;.0;F;[;[; I";T;!0;'@gj;I"$Card::Generators::MigrationBase;F;Io;S ;T0;UI"#ActiveRecord::Generators::Base;T;V@;;;'o;S ;T0;UI"ActiveRecord::Generators;T;V@;;);'o;S ;T0;U0;V0;;j;'@;W@z[;X0;W0;X0;W0;X; ;+To; ;IC;[o; ; F; ;,;;;I"0Card::Generators::SetGenerator#create_files;F;[;[[I"-lib/generators/card/set/set_generator.rb;Ti;F;:create_files;;;[;{;IC;" ;T;@j;.0;F;[;[; I";T;!0;'@j;(I"def create_files;T;)T;*I"def create_files mod_path = if options.core? File.join Cardio.gem_root, 'mod', file_name else File.join 'mod', file_name end set_path = File.join(mod_path, 'set', set_pattern, anchors[0..-2], "#{anchors.last}.rb") spec_path = File.join(mod_path, 'spec', 'set', set_pattern, anchors[0..-2], "#{anchors.last}_spec.rb" ) template 'set_template.erb', set_path template 'set_spec_template.erb', spec_path end;T;+T;I@j;JIC;[;I@j;KIC;[;I@j;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@ji ;F;:SetGenerator;;;;;[;{;IC;" ;T;@j;.0;F;[;[; I";T;!0;'@gj;I"#Card::Generators::SetGenerator;F;Io;S ;T0;U0;V0;;(;'@gj;W@j;X0;+To; ;IC;[o; ; F; ;,;;;I"3Card::Generators::FormatGenerator#create_files;F;[;[[I"3lib/generators/card/format/format_generator.rb;Ti;F;;,;;;[;{;IC;" ;T;@j;.0;F;[;[; I";T;!0;'@j;(I"def create_files;T;)T;*I"def create_files mod_path = if options.core? File.join Cardio.gem_root, 'mod', file_name else File.join 'mod', file_name end format_path = File.join(mod_path, 'format', "#{module_name}_format.rb") spec_path = File.join(mod_path, 'spec', 'format', "#{module_name}_format_spec.rb") template 'format_template.erb', format_path template 'format_spec_template.erb', spec_path end;T;+T;I@j;JIC;[;I@j;KIC;[;I@j;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@ji ;F;:FormatGenerator;;;;;[;{;IC;" ;T;@j;.0;F;[;[; I";T;!0;'@gj;I"&Card::Generators::FormatGenerator;F;Io;S ;T0;U0;V0;;(;'@gj;W@j;X0;+To; ;IC;[o; ; F; ;,;;;I"?Card::Generators::MigrationGenerator#create_migration_file;F;[;[[I"9lib/generators/card/migration/migration_generator.rb;Ti;F;:create_migration_file;;;[;{;IC;" ;T;@k;.0;F;[;[; I";T;!0;'@k;(I"def create_migration_file;T;)T;*I"Jdef create_migration_file migration_type = options['core'] ? :core_cards : :deck_cards mig_paths = Cardio.migration_paths(migration_type) raise "No migration directory for #{migration_type}" if mig_paths.blank? set_local_assigns! migration_template @migration_template, File.join( mig_paths.first, "#{file_name}.rb") end;T;+To; ; F; ;,;;;I"" end;T;+To; ; F; ;,;;;I"Card::SetPattern#safe_key;F;[;[[@#li[@%li;F;: safe_key;;;[;{;IC;" ;T;@n;.0;F;[;[; I";T;!0;'@l;(I"def safe_key;T;)T;*I"def safe_key caps_part = self.class.pattern_code.gsub(' ','_').upcase self.class.anchorless? ? caps_part : "#{caps_part}-#{@anchor_name.safe_key}" end;T;+To; ; F; ;,;;;I""Card::SetPattern#rule_set_key;F;[;[[@#li[@%li;F;;;;;[;{;IC;" ;T;@!n;.0;F;[;[; I";T;!0;'@l;(I"def rule_set_key;T;)T;*I"def rule_set_key if self.class.anchorless? self.class.pattern_code elsif @anchor_id [ @anchor_id, self.class.pattern_code ].map( &:to_s ) * '+' end end;T;+T;I@l;JIC;[;I@l;KIC;[;I@l;LIC;M{; IC;M{ ;:IC;M{;C@l;D@.l;NT;<IC;M{;C@Bl;D@Pl;NT;>IC;M{;C@dl;D@rl;NT;@IC;M{;C@l;D@l;NT;BIC;M{;C@l;D@l;NT;DIC;M{;C@l;D@l;NT;NT;,IC;M{;NT;NT;O{;P[;[[@#li[@%li;F;:SetPattern;;;;;[;{;IC;" ;T;@l;.0;F;[;[; I";T;!0;'@;I"Card::SetPattern;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+To; ;IC;[o; ; F; ;,;;;I"Card::TypeSet#initialize;F;[[I" card;T0;[[@#li[@%li;F;;C;;;[;{;IC;" ;T;@In;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of TypeSet;T;0;3[I" TypeSet;F;@In; I";T;!0;'@Gn;(I"def initialize(card);T;)T;*I"Mdef initialize card super @inherit_card = card unless module_key end;T;+To; ; F; ;,;;;I"'Card::TypeSet#lookup_inherited_key;F;[;[[@#li[@%li;F;:lookup_inherited_key;;;[;{;IC;" ;T;@^n;.0;F;[;[; I";T;!0;'@Gn;(I"def lookup_inherited_key;T;)T;*I"def lookup_inherited_key return unless @inherit_card card, @inherit_card = @inherit_card, nil default_rule = card.rule_card(:default) and type_code = default_rule.type_code and #default_rule.cardname.size > 2 and #default_rule.left.right.codename == self.class.pattern_code mod_key = "Type::#{type_code.to_s.camelize}" and ( Card::Set.modules[:nonbase_format].values + [Card::Set.modules[:nonbase]] ).any?{|hash| hash[mod_key]} and mod_key end;T;+To; ; F; ;,;;;I" Card::TypeSet#inherited_key;F;[;[[@#li[@%li;F;:inherited_key;;;[;{;IC;" ;T;@ln;.0;F;[;[; I";T;!0;'@Gn;(I"def inherited_key;T;)T;*I"odef inherited_key (defined? @inherited_key) ? @inherited_key : @inherited_key = lookup_inherited_key end;T;+To; ; F; ;,;;;I"%Card::TypeSet#lookup_module_list;F;[[I"modules_hash;T0;[[@#li[@%li;F;;L;;;[;{;IC;" ;T;@zn;.0;F;[;[; I";T;!0;'@Gn;(I")def lookup_module_list(modules_hash);T;)T;*I"def lookup_module_list modules_hash module_key ? modules_hash[ module_key ] : inherited_key && modules_hash[ inherited_key ] end;T;+To; ; F; ; ;;;I"Card::TypeSet.label;F;[[I" name;T0;[[I"$tmpsets/set_pattern/102-type.rb;Ti ;T;;Z;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/03_type.rb ~~~~~~~~~~~ ;T;@n;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/03_type.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i ;&i ;'@Gn;(I"def label(name);T;)T;*I"0def label name %{All "#{name}" cards} end;T;+To; ; F; ; ;;;I"!Card::TypeSet.prototype_args;F;[[I" anchor;T0;[[@ni;F;:prototype_args;;;[;{;IC;" ;T;@n;.0;F;[;[; I";T;!0;'@Gn;(I"def prototype_args(anchor);T;)T;*I"6def prototype_args anchor { :type=>anchor } end;T;+To; ; F; ; ;;;I"#Card::TypeSet.pattern_applies?;F;[[I" card;T0;[[@ni;F;;J;;;[;{;IC;" ;T;@n;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@n; I";T;!0;'@Gn;(I"def pattern_applies?(card);T;)T;*I"3def pattern_applies? card !!card.type_id end;T;+To; ; F; ; ;;;I"Card::TypeSet.anchor_name;F;[[I" card;T0;[[@ni;F;:anchor_name;;;[;{;IC;" ;T;@n;.0;F;[;[; I";T;!0;'@Gn;(I"def anchor_name(card);T;)T;*I".def anchor_name card card.type_name end;T;+To; ; F; ; ;;;I"Card::TypeSet.anchor_id;F;[[I" card;T0;[[@ni;F;:anchor_id;;;[;{;IC;" ;T;@n;.0;F;[;[; I";T;!0;'@Gn;(I"def anchor_id(card);T;)T;*I"*def anchor_id card card.type_id end;T;+To; ; F; ; ;;;I"Card::TypeSet.follow_label;F;[[I" name;T0;[[@ni ;F;;$;;;[;{;IC;" ;T;@n;.0;F;[;[; I";T;!0;'@Gn;(I"def follow_label(name);T;)T;*I"2def follow_label name %{all "#{name}s"} end;T;+T;I@Gn;JIC;[;I@Gn;KIC;[;I@Gn;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@#li[@ni[@%li;F;: TypeSet;;;;;[;{;IC;" ;T;@Gn;.0;F;[;[; I";T;!0;'@;I"Card::TypeSet;F;Io;S ;T0;UI"Card::SetPattern;T;V@;;Q;'@;W@l;X0;+To;7;IC;[o; ; F; ;,;;;I"Card::SpecHelper#login_as;F;[[I" user;T0;[[I"lib/card/spec_helper.rb;Ti [I"lib/card/spec_helper.rb;Ti ;T;: login_as;;;[;{;IC;"/~~~~~~~~~ HELPER METHODS ~~~~~~~~~~~~~~~# ;T;@o;F;[;[; I"/~~~~~~~~~ HELPER METHODS ~~~~~~~~~~~~~~~#;T;!0;"o;#;$F;%i ;&i ;'@n;(I"def login_as(user);T;)T;*I"def login_as user Card::Auth.current_id = (uc=Card[user.to_s] and uc.id) if @request @request.session[:user] = Card::Auth.current_id end #warn "(ath)login_as #{user.inspect}, #{Card::Auth.current_id}, #{@request.session[:user]}" end;T;+To; ; F; ;,;;;I"Card::SpecHelper#newcard;F;[[I" name;T0[I" content;TI""";T;[[@oi;F;: newcard;;;[;{;IC;" ;T;@o;.0;F;[;[; I";T;!0;'@n;(I"!def newcard name, content="";T;)T;*I"def newcard name, content="" #FIXME - misleading name; sounds like it doesn't save. Card.create! name: name, content: content end;T;+To; ; F; ;,;;;I"(Card::SpecHelper#assert_view_select;F;[[I"view_html;T0[I" *args;T0[I" &block;T0;[[@oi[@ oi;F;:assert_view_select;;;[;{;IC;" ;T;@&o;.0;F;[;[; I";T;!0;'@n;(I"5def assert_view_select(view_html, *args, &block);T;)T;*I"def assert_view_select(view_html, *args, &block) node = Nokogiri::HTML::Document.parse(view_html).root #node = HTML::Document.new(view_html).root if block_given? assert_select node, *args, &block else assert_select node, *args end end;T;+To; ; F; ;,;;;I".Card::SpecHelper#debug_assert_view_select;F;[[I"view_html;T0[I" *args;T0[I" &block;T0;[[@oi$[@ oi ;F;:debug_assert_view_select;;;[;{;IC;" ;T;@:o;.0;F;[;[; I";T;!0;'@n;(I";def debug_assert_view_select(view_html, *args, &block);T;)T;*I"def debug_assert_view_select(view_html, *args, &block) Rails.logger.rspec %( #{CodeRay.scan(Nokogiri::XML(view_html,&:noblanks).to_s, :html).div} ) assert_view_select view_html, *args, &block end;T;+To; ; F; ;,;;;I"#Card::SpecHelper#render_editor;F;[[I" type;T0;[[@oi3[@ oi/;F;:render_editor;;;[;{;IC;" ;T;@No;.0;F;[;[; I";T;!0;'@n;(I"def render_editor(type);T;)T;*I"def render_editor(type) card = Card.create(name: "my favority #{type} + #{rand(4)}", type: type) card.format.render(:edit) end;T;+To; ; F; ;,;;;I"$Card::SpecHelper#render_content;F;[[I" content;T0[I"format_args;TI"{};T;[[@oi8[@ oi4;F;:render_content;;;[;{;IC;" ;T;@^o;.0;F;[;[; I";T;!0;'@n;(I"0def render_content(content, format_args={});T;)T;*I"fdef render_content content, format_args={} render_content_with_args( content, format_args ) end;T;+To; ; F; ;,;;;I".Card::SpecHelper#render_content_with_args;F;[[I" content;T0[I"format_args;TI"{};T[I"view_args;TI"{};T;[[@oi<[@ oi8;F;:render_content_with_args;;;[;{;IC;" ;T;@qo;.0;F;[;[; I";T;!0;'@n;(I"Hdef render_content_with_args(content, format_args={}, view_args={});T;)T;*I"def render_content_with_args content, format_args={}, view_args={} @card ||= Card.new name: "Tempo Rary 2" @card.content = content @card.format(format_args)._render :core, view_args end;T;+To; ; F; ;,;;;I"!Card::SpecHelper#render_card;F;[[I" view;T0[I"card_args;TI"{};T[I"format_args;TI"{};T;[[@oiB[@ oi>;F;:render_card;;;[;{;IC;" ;T;@o;.0;F;[;[; I";T;!0;'@n;(I"8def render_card(view, card_args={}, format_args={});T;)T;*I"pdef render_card view, card_args={}, format_args={} render_card_with_args view, card_args, format_args end;T;+To; ; F; ;,;;;I"+Card::SpecHelper#render_card_with_args;F;[ [I" view;T0[I"card_args;TI"{};T[I"format_args;TI"{};T[I"view_args;TI"{};T;[[@oiF[@ oiB;F;:render_card_with_args;;;[;{;IC;" ;T;@o;.0;F;[;[; I";T;!0;'@n;(I"Pdef render_card_with_args(view, card_args={}, format_args={}, view_args={});T;)T;*I"'def render_card_with_args view, card_args={}, format_args={}, view_args={} card = begin if card_args[:name] Card.fetch card_args[:name], new: card_args else Card.new card_args.merge( name: 'Tempo Rary' ) end end card.format(format_args)._render(view, view_args) end;T;+To; ; F; ;,;;;I"Card::SpecHelper#users;F;[;[[@oiQ[@ oiM;F;: users;;;[;{;IC;" ;T;@o;.0;F;[;[; I";T;!0;'@n;(I"def users;T;)T;*I"+def users SharedData::USERS.sort end;T;+To; ; F; ;,;;;I"Card::SpecHelper#create!;F;[[I" name;T0[I" content;TI"'';T;[[@ oi;F;: create!;;;[;{;IC;" ;T;@o;.0;F;[;[; I";T;!0;'@n;(I"!def create! name, content='';T;)T;*I"Qdef create! name, content='' Card.create! name: name, content: content end;T;+To; ; F; ;,;;;I"Card::SpecHelper#in_stage;F;[[I" stage;T0[I" opts;TI"{};T[I"&event_block;T0;[[@ oi];T;: in_stage;;;[;{;IC;"Make expectations in the event phase. Takes a stage and registers the event_block in this stage as an event. Unknown methods in the event_block are executed in the rspec context instead of the card's context. An additionally :trigger block in opts is expected that is called to start the event phase. Other event options like :on or :when are not supported yet. Example: in_stage :initialize, trigger: ->{ test_card.update_attributes! content: '' } do expect(item_names).to eq [] end ;T;@o;F;[;[; I"Make expectations in the event phase. Takes a stage and registers the event_block in this stage as an event. Unknown methods in the event_block are executed in the rspec context instead of the card's context. An additionally :trigger block in opts is expected that is called to start the event phase. Other event options like :on or :when are not supported yet. Example: in_stage :initialize, trigger: ->{ test_card.update_attributes! content: '' } do expect(item_names).to eq [] end;T;!0;"o;#;$F;%iQ;&i\;'@n;(I".def in_stage stage, opts={}, &event_block;T;)T;*I"Xdef in_stage stage, opts={}, &event_block stage_sym = :"#{stage}_stage" $rspec_binding = binding add_test_event stage_sym, :in_stage_test, &event_block trigger = if opts[:trigger].is_a?(Symbol) method(opts[:trigger]) else opts[:trigger] end trigger.call ensure remove_test_event stage_sym, :in_stage_test end;T;+To; ; F; ;,;;;I"$Card::SpecHelper#add_test_event;F;[[I" stage;T0[I" name;T0[I"&event_block;T0;[[@ oil;F;:add_test_event;;;[;{;IC;" ;T;@o;.0;F;[;[; I";T;!0;'@n;(I"1def add_test_event stage, name, &event_block;T;)T;*I"%def add_test_event stage, name, &event_block Card.class_eval do def method_missing m, *args begin method = eval('method(%s)' % m.inspect, $rspec_binding) rescue NameError else return method.call(*args) end begin value = eval(m.to_s, $rspec_binding) return value rescue NameError end super # raise NoMethodError end define_method name, event_block end Card.define_callbacks name Card.set_callback stage, :before, name, prepend: true end;T;+To; ; F; ;,;;;I"'Card::SpecHelper#remove_test_event;F;[[I" stage;T0[I" name;T0;[[@ oi;F;:remove_test_event;;;[;{;IC;" ;T;@o;.0;F;[;[; I";T;!0;'@n;(I"&def remove_test_event stage, name;T;)T;*I"Tdef remove_test_event stage, name Card.skip_callback stage, :before, name end;T;+To; ; F; ;,;;;I" Card::SpecHelper#test_event;F;[[I" stage;T0[I" _opts;T0[I" &block;T0;[[@ oi;F;:test_event;;;[;{;IC;" ;T;@p;.0;F;[;[; I";T;!0;'@n;(I"(def test_event stage, _opts, &block;T;)T;*I"def test_event stage, _opts, &block event_name = :"test_event_#{@events.size}" stage_sym = :"#{stage}_stage" @events << [stage_sym, event_name] add_test_event stage_sym, event_name, &block end;T;+To; ; F; ;,;;;I"&Card::SpecHelper#with_test_events;F;[;[[@ oi;F;:with_test_events;;;[;{;IC;" ;T;@"p;.0;F;[;[; I";T;!0;'@n;(I"def with_test_events;T;)T;*I"def with_test_events @events = [] $rspec_binding = binding yield ensure @events.each do |stage, name| remove_test_event stage, name end end;T;+T;I@n;JIC;[;I@n;KIC;[o;S ;T0;UI"8Rails::Dom::Testing::Assertions::SelectorAssertions;T;V@n;:SelectorAssertions;'o;S ;T0;UI"$Rails::Dom::Testing::Assertions;T;V@n;:Assertions;'o;S ;T0;UI"Rails::Dom::Testing;T;V@n;: Testing;'o;S ;T0;UI"Rails::Dom;T;V@n;:Dom;'o;S ;T0;U0;V0;;*;'@n;W0;X0;W0;X0;W0;X0;W0;X0;W0;X;Y;I@n;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@oi;F;:SpecHelper;;;;;[;{;IC;" ;T;@n;.0;F;[;[; I";T;!0;'o;S ;T0;U0;V0;;d;'@;W@;X0;I"Card::SpecHelper;Fo; ;IC;[;I@Ip;JIC;[;I@Ip;KIC;[;I@Ip;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[I"lib/card/core_migration.rb;Ti ;F;:CoreMigration;;;;;[;{;IC;" ;T;@Ip;.0;F;[;[; I";T;!0;'o;S ;T0;U0;V0;;d;'@;W@;X0;I"Card::CoreMigration;F;Io;S ;T0;UI"Card::Migration;T;V@[p;;i;'@u[;W@Y;X0o; ;IC;[o; ; F; ;,;;;I"Card::Act#set_actor;F;[;[[I"#mod/01_history/lib/card/act.rb;Ti[I"#mod/01_history/lib/card/act.rb;Ti9;F;:set_actor;;;[;{;IC;" ;T;@ap;.0;F;[;[; I";T;!0;'@_p;(I"def set_actor;T;)T;*I":def set_actor self.actor_id ||= Auth.current_id end;T;+To; ; F; ; ;;;I" Card::Act.delete_actionless;F;[;[[@fpi[@hpi;F;:delete_actionless;;;[;{;IC;" ;T;@qp;.0;F;[;[; I";T;!0;'@_p;(I"def delete_actionless;T;)T;*I"|def self.delete_actionless Card::Act.where( "id NOT IN (?)", Card::Action.pluck("card_act_id"), ).delete_all end;T;+To; ; F; ; ;;;I"'Card::Act.find_all_with_actions_on;F;[[I" card_ids;T0[I" args;TI"{};T;[[@fpi[@hpi$;F;:find_all_with_actions_on;;;[;{;IC;" ;T;@p;.0;F;[;[; I";T;!0;'@_p;(I"4def find_all_with_actions_on(card_ids, args={});T;)T;*I"^def self.find_all_with_actions_on card_ids, args={} sql = 'card_actions.card_id IN (:card_ids) AND ( (draft is not true) ' sql << ( args[:with_drafts] ? 'OR actor_id = :current_user_id)' : ')' ) vars = {card_ids: card_ids, current_user_id: Card::Auth.current_id } Card::Act.joins(:actions).where( sql, vars ).uniq.order(:id).reverse_order end;T;+To; ; F; ;,;;;I"Card::Act#action_on;F;[[I" card_id;T0;[[@fpi)[@hpi=;T;:action_on;;;[;{;IC;"Card[ card_id ] end ;T;@p;F;[;[; I" Card[ card_id ] end;T;!0;"o;#;$F;%i&;&i';'@_p;(I"def action_on(card_id);T;)T;*I"ddef action_on card_id actions.where( "card_id = #{card_id} and draft is not true" ).first end;T;+To; ; F; ;,;;;I"Card::Act#main_action;F;[;[[@fpi-[@hpiA;F;:main_action;;;[;{;IC;" ;T;@p;.0;F;[;[; I";T;!0;'@_p;(I"def main_action;T;)T;*I">def main_action action_on(card_id) || actions.first end;T;+To; ; F; ;,;;;I"Card::Act#elapsed_time;F;[;[[@fpi1[@hpiE;F;:elapsed_time;;;[;{;IC;" ;T;@p;.0;F;[;[; I";T;!0;'@_p;(I"def elapsed_time;T;)T;*I"Sdef elapsed_time DateTime.new(acted_at).distance_of_time_in_words_to_now end;T;+To; ; F; ;,;;;I""Card::Act#relevant_drafts_for;F;[[I" card;T0;[[@fpi5[@hpiI;F;:relevant_drafts_for;;;[;{;IC;" ;T;@p;.0;F;[;[; I";T;!0;'@_p;(I""def relevant_drafts_for(card);T;)T;*I"def relevant_drafts_for card drafts.select do |action| card.included_card_ids.include?(action.card_id) || (card.id == action.card_id) end end;T;+To; ; F; ;,;;;I"#Card::Act#relevant_actions_for;F;[[I" card;T0;[[@fpi;[@hpiP;F;:relevant_actions_for;;;[;{;IC;" ;T;@p;.0;F;[;[; I";T;!0;'@_p;(I"#def relevant_actions_for(card);T;)T;*I"def relevant_actions_for card, with_drafts=false actions.select do |action| card.included_card_ids.include?(action.card_id) || (card.id == action.card_id) end end;T;+To; ; F; ;,;;;I".Card::Act#timestamp_attributes_for_create;F;[;[[@fpiB[@hpiY;F;:$timestamp_attributes_for_create;;;[;{;IC;" ;T;@p;.0;F;[;[; I";T;!0;'@_p;(I"(def timestamp_attributes_for_create;T;)T;*I"Adef timestamp_attributes_for_create super << :acted_at end;T;+To; ; F; ;,;;;I"4;F;[;[[@hpi;F;;;;;[;{;IC;" ;T;@p;.0;F;[;[; I";T;!0;'@_p;(I" def card;T;)T;*I"Odef card Card.fetch card_id, look_in_trash: true, skip_modules: true end;T;+To; ; F; ; ;;;I"Card::Act.delete_cardless;F;[;[[@hpi;F;:delete_cardless;;;[;{;IC;" ;T;@p;.0;F;[;[; I";T;!0;'@_p;(I"def delete_cardless;T;)T;*I"def delete_cardless left_join = 'LEFT JOIN cards ON card_acts.card_id = cards.id' joins(left_join).where('cards.id IS NULL').delete_all end;T;+To; ; F; ; ;;;I"     ;F;[;[[@hpi+;F;:all_viewable;;;[;{;IC;" ;T;@q;.0;F;[;[; I";T;!0;'@_p;(I"def all_viewable;T;)T;*I"def all_viewable joins = 'JOIN card_actions ON card_acts.id = card_act_id ' \ 'JOIN cards ON cards.id = card_actions.card_id' where = [ 'card_actions.id is not null', # data check. should not be needed 'cards.id is not null', # ditto 'draft is not true', Card::Query::SqlStatement.new.permission_conditions('cards') ].compact.join ' AND ' joins(joins).where(where).uniq end;T;+T;I@_p;JIC;[;I@_p;KIC;[;I@_p;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@fpi;F;:Act;;;;;[;{;IC;" ;T;@_p;.0;F;[;[; I";T;!0;'@;I"Card::Act;F;Io;S ;T0;UI"ActiveRecord::Base;T;V@;;;'o;S ;T0;U0;V0;;j;'@;W@z[;X0;W0;X; ;+To; ;IC;[*o;4;[[I"&mod/01_history/lib/card/action.rb;Ti;T;: TYPE;;;;;[;{;IC;"0replace with enum if we start using rails 4 ;T;@)q;F;[;[; I"0replace with enum if we start using rails 4;T;!0;"o;#;$F;%i;&i;'@'q;I"Card::Action::TYPE;F;(I".TYPE = [:create, :update, :delete].freeze;T;*I".TYPE = [:create, :update, :delete].freeze;T;6I"'[:create, :update, :delete].freeze;T;+To; ; F; ;,;;;I"Card::Action#expire;F;[;[[@,qi;F;;;;;[;{;IC;" ;T;@8q;.0;F;[;[; I";T;!0;'@'q;(I"def expire;T;)T;*I"5def expire self.class.cache.delete id.to_s end;T;+To; ; F; ; ;;;I"Card::Action.cache;F;[;[[@,qi;F;;;;;[;{;IC;" ;T;@Eq;.0;F;[;[; I";T;!0;'@'q;(I"def cache;T;)T;*I"(def cache Card::Cache[Action] end;T;+To; ; F; ; ;;;I"Card::Action.fetch;F;[[I"id;T0;[[@,qi#;F;;;;;[;{;IC;" ;T;@Rq;.0;F;[;[; I";T;!0;'@'q;(I"def fetch(id);T;)T;*I"hdef fetch id cache.read(id.to_s) or begin cache.write id.to_s, Action.find(id.to_i) end end;T;+To; ; F; ; ;;;I"!Card::Action.delete_cardless;F;[;[[@,qi);F;;w;;;[;{;IC;" ;T;@aq;.0;F;[;[; I";T;!0;'@'q;(I"def delete_cardless;T;)T;*I"def delete_cardless Card::Action.joins('LEFT JOIN cards ON card_actions.card_id = cards.id').where('cards.id IS NULL').delete_all end;T;+To; ; F; ; ;;;I"Card::Action.delete_old;F;[;[[@,qi-[I"&mod/01_history/lib/card/action.rb;Ti7;F;:delete_old;;;[;{;IC;" ;T;@nq;.0;F;[;[; I";T;!0;'@'q;(I"def delete_old;T;)T;*I"rdef delete_old Card.find_each do |card| card.delete_old_actions end Card::Act.delete_actionless end;T;+To; ; F; ;,;;;I" Card::Action#changed_fields;F;[[I"obj;T0[I"changed_fields;T0;[[@,qiD;T;:changed_fields;;;[;{;IC;"This is the main API from Cards to history See also create_act_and_action, which needs to happen before this or we don't have the action to call this method on. When changes are stored for versioned attributes, this is the signal method By overriding this method in a module, the module takes over handling of changes. Although the standard version stores the Changes in active record models (Act, Action and Change records), these could be /dev/nulled for a history-less implementation, or handled by an external service. If change streams are generated from database triggers, and we aren't writing here (disabled history), we still have to generate change stream events in another way. ;T;@}q;F;[;[; I" This is the main API from Cards to history See also create_act_and_action, which needs to happen before this or we don't have the action to call this method on. When changes are stored for versioned attributes, this is the signal method By overriding this method in a module, the module takes over handling of changes. Although the standard version stores the Changes in active record models (Act, Action and Change records), these could be /dev/nulled for a history-less implementation, or handled by an external service. If change streams are generated from database triggers, and we aren't writing here (disabled history), we still have to generate change stream events in another way. ;T;!0;"o;#;$F;%i5;&iC;'@'q;(I"+def changed_fields obj, changed_fields;T;)T;*I"def changed_fields obj, changed_fields #changed_fields.each{ |f| changes.build field: f, value: self[f] } changed_fields.each{ |f| Card::Change.create field: f, value: obj[f], card_action_id: id } end;T;+To; ; F; ;,;;;I"Card::Action#edit_info;F;[;[[@,qiI;F;:edit_info;;;[;{;IC;" ;T;@q;.0;F;[;[; I";T;!0;'@'q;(I"def edit_info;T;)T;*I"8def edit_info @edit_info ||= { action_type: "#{action_type}d", new_content: new_values[:content], new_name: new_values[:name], new_cardtype: new_values[:cardtype], old_content: old_values[:content], old_name: old_values[:name], old_cardtype: old_values[:cardtype] } end;T;+To; ; F; ;,;;;I"Card::Action#new_values;F;[;[[@,qiU;F;:new_values;;;[;{;IC;" ;T;@q;.0;F;[;[; I";T;!0;'@'q;(I"def new_values;T;)T;*I"def new_values @new_values ||= { content: new_value_for(:db_content), name: new_value_for(:name), cardtype: ( typecard = Card[new_value_for(:type_id).to_i] and typecard.name.capitalize ) } end;T;+To; ; F; ;,;;;I"Card::Action#old_values;F;[;[[@,qi^;F;:old_values;;;[;{;IC;" ;T;@q;.0;F;[;[; I";T;!0;'@'q;(I"def old_values;T;)T;*I"def old_values @old_values ||= { content: last_value_for(:db_content), name: last_value_for(:name), cardtype: ( value = last_value_for(:type_id) and typecard = Card.find(value) and typecard.name.capitalize ) } end;T;+To; ; F; ;,;;;I" Card::Action#last_value_for;F;[[I" field;T0;[[@,qig;F;:last_value_for;;;[;{;IC;" ;T;@q;.0;F;[;[; I";T;!0;'@'q;(I"def last_value_for field;T;)T;*I"cdef last_value_for field ch = self.card.last_change_on(field, before: self) and ch.value end;T;+To; ; F; ;,;;;I"Card::Action#field_index;F;[[I" field;T0;[[@,qik;F;:field_index;;;[;{;IC;" ;T;@q;.0;F;[;[; I";T;!0;'@'q;(I"def field_index field;T;)T;*I"ydef field_index field if field.is_a? Integer field else Card::TRACKED_FIELDS.index(field.to_s) end end;T;+To; ; F; ;,;;;I"Card::Action#new_value_for;F;[[I" field;T0;[[@,qis;F;:new_value_for;;;[;{;IC;" ;T;@q;.0;F;[;[; I";T;!0;'@'q;(I"def new_value_for field;T;)T;*I"ddef new_value_for field ch = card_changes.find_by(field: field_index(field)) and ch.value end;T;+To; ; F; ;,;;;I"Card::Action#change_for;F;[[I" field;T0;[[@,qiw;F;:change_for;;;[;{;IC;" ;T;@q;.0;F;[;[; I";T;!0;'@'q;(I"def change_for field;T;)T;*I"_def change_for field card_changes.where 'card_changes.field = ?', field_index(field) end;T;+To; ; F; ;,;;;I"Card::Action#new_type?;F;[;[[@,qi{[@tqii;F;:new_type?;;;[;{;IC;" ;T;@q;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@q; I";T;!0;'@'q;(I"def new_type?;T;)T;*I"0def new_type? new_value_for(:type_id) end;T;+To; ; F; ;,;;;I"Card::Action#new_content?;F;[;[[@,qi[@tqim;F;:new_content?;;;[;{;IC;" ;T;@r;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@r; I";T;!0;'@'q;(I"def new_content?;T;)T;*I"6def new_content? new_value_for(:db_content) end;T;+To; ; F; ;,;;;I"Card::Action#new_name?;F;[;[[@,qi~[@tqiq;F;:new_name?;;;[;{;IC;" ;T;@r;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@r; I";T;!0;'@'q;(I"def new_name?;T;)T;*I"-def new_name? new_value_for(:name) end;T;+To; ; F; ;,;;;I"Card::Action#action_type=;F;[[I" value;T0;[[@,qi[@tqiu;F;:action_type=;;;[;{;IC;" ;T;@+r;.0;F;[;[; I";T;!0;'@'q;(I"def action_type=(value);T;)T;*I"Sdef action_type=(value) write_attribute(:action_type, TYPE.index(value)) end;T;+To; ; F; ;,;;;I"Card::Action#action_type;F;[;[[@,qi[@tqiy;F;:action_type;;;[;{;IC;" ;T;@;r;.0;F;[;[; I";T;!0;'@'q;(I"def action_type;T;)T;*I"=def action_type TYPE[read_attribute(:action_type)] end;T;+To; ; F; ;,;;;I"Card::Action#set_act;F;[;[[@,qi;F;: set_act;;;[;{;IC;" ;T;@Ir;.0;F;[;[; I";T;!0;'@'q;(I"def set_act;T;)T;*I"6def set_act self.set_act ||= self.acts.last end;T;+To; ; F; ;,;;;I"Card::Action#revision_nr;F;[;[[@,qi[@tqi};F;:revision_nr;;;[;{;IC;" ;T;@Vr;.0;F;[;[; I";T;!0;'@'q;(I"def revision_nr;T;)T;*I";def revision_nr self.card.actions.index_of(self) end;T;+To; ; F; ;,;;;I"Card::Action#red?;F;[;[[@,qi[@tqi|;F;;@;;;[;{;IC;" ;T;@dr;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@dr; I";T;!0;'@'q;(I" def red?;T;)T;*I"-def red? content_diff_builder.red? end;T;+To; ; F; ;,;;;I"Card::Action#green?;F;[;[[@,qi[@tqi;F;;A;;;[;{;IC;" ;T;@wr;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@wr; I";T;!0;'@'q;(I"def green?;T;)T;*I"1def green? content_diff_builder.green? end;T;+To; ; F; ;,;;;I"Card::Action#name_diff;F;[[I" opts;TI"{};T;[[@,qi[@tqi;T;:name_diff;;;[;{;IC;"\def diff @diff ||= { cardtype: type_diff, content: content_diff, name: name_diff} end ;T;@r;F;[;[; I"\def diff @diff ||= { cardtype: type_diff, content: content_diff, name: name_diff} end;T;!0;"o;#;$F;%i;&i;'@'q;(I"def name_diff(opts={});T;)T;*I"vdef name_diff opts={} if new_name? Card::Diff.complete old_values[:name], new_values[:name], opts end end;T;+To; ; F; ;,;;;I"Card::Action#cardtype_diff;F;[[I" opts;TI"{};T;[[@,qi[@tqi;F;:cardtype_diff;;;[;{;IC;" ;T;@r;.0;F;[;[; I";T;!0;'@'q;(I"def cardtype_diff(opts={});T;)T;*I"}def cardtype_diff opts={} if new_type? Card::Diff.complete old_values[:cardtype], new_values[:cardtype], opts end end;T;+To; ; F; ;,;;;I"Card::Action#content_diff;F;[[I"diff_type;TI":expanded;T[I" opts;TI"nil;T;[[@,qi[@tqi;F;:content_diff;;;[;{;IC;" ;T;@r;.0;F;[;[; I";T;!0;'@'q;(I"4def content_diff(diff_type=:expanded, opts=nil);T;)T;*I"def content_diff diff_type=:expanded, opts=nil if new_content? if diff_type == :summary content_diff_builder(opts).summary else content_diff_builder(opts).complete end end end;T;+To; ; F; ;,;;;I"&Card::Action#content_diff_builder;F;[[I" opts;TI"nil;T;[[@,qi;F;:content_diff_builder;;;[;{;IC;" ;T;@r;.0;F;[;[; I";T;!0;'@'q;(I"&def content_diff_builder opts=nil;T;)T;*I"def content_diff_builder opts=nil @content_diff_builder ||= begin Card::Diff::DiffBuilder.new(old_values[:content], new_values[:content], opts || card.include_set_modules.diff_args) end end;T;+To; ; F; ;,;;;I"Card::Action#card;F;[;[[@,qi[@tqi;F;;;;;[;{;IC;" ;T;@r;.0;F;[;[; I";T;!0;'@'q;(I" def card;T;)T;*I";def card Card.fetch card_id, look_in_trash: true end;T;+To; ; F; ; ;;;I"#Card::Action.delete_changeless;F;[;[[@tqi.;F;:delete_changeless;;;[;{;IC;" ;T;@r;.0;F;[;[; I";T;!0;'@'q;(I"def delete_changeless;T;)T;*I"def delete_changeless joins( 'LEFT JOIN card_changes '\ 'ON card_changes.card_action_id = card_actions.id' ).where( 'card_changes.id IS NULL' ).delete_all end;T;+To; ; F; ;,;;;I" [PB;F;[[I" field;T0;[[@tqiS;T;;;;;[;{;IC;"def changed_fields obj, changed_fields changed_fields.each do |f| Card::Change.create field: f, value: obj[f], card_action_id: id end end ;T;@r;F;[;[; I"def changed_fields obj, changed_fields changed_fields.each do |f| Card::Change.create field: f, value: obj[f], card_action_id: id end end;T;!0;"o;#;$F;%iM;&iQ;'@'q;(I"def value field;T;)T;*I"fdef value field return unless (change = change field) interpret_value field, change.value end;T;+To; ; F; ;,;;;I"Pʞ0[$;F;[[I" field;T0;[[@tqiX;F;: change;;;[;{;IC;" ;T;@r;.0;F;[;[; I";T;!0;'@'q;(I"def change field;T;)T;*I":def change field changes[interpret_field field] end;T;+To; ; F; ;,;;;I" AP;F;[;[[@tqi\;F;: changes;;;[;{;IC;" ;T;@ s;.0;F;[;[; I";T;!0;'@'q;(I"def changes;T;)T;*I"def changes @changes ||= card_changes.each_with_object({}) do |change, hash| hash[change.field.to_sym] = change end end;T;+To; ; F; ;,;;;I" Card::Action#previous_value;F;[[I" field;T0;[[@tqic;F;:previous_value;;;[;{;IC;" ;T;@s;.0;F;[;[; I";T;!0;'@'q;(I"def previous_value field;T;)T;*I"def previous_value field return if action_type == :create return unless (previous_change = previous_change field) interpret_value field, previous_change.value end;T;+To; ; F; ;,;;;I"%Card::Action#content_diff_object;F;[[I" opts;TI"nil;T;[[@tqi;F;:content_diff_object;;;[;{;IC;" ;T;@'s;.0;F;[;[; I";T;!0;'@'q;(I"%def content_diff_object opts=nil;T;)T;*I"def content_diff_object opts=nil @diff ||= begin diff_args = opts || card.include_set_modules.diff_args Card::Diff.new previous_value(:content), value(:content), diff_args end end;T;+To; ; F; ;,;;;I"!Card::Action#previous_change;F;[[I" field;T0;[[@tqi;F;:previous_change;;;[;{;IC;" ;T;@7s;.0;F;[;[; I";T;!0;'@'q;(I"def previous_change field;T;)T;*I"def previous_change field field = interpret_field field if @previous_changes && @previous_changes.key?(field) @previous_changes[field] else @previous_changes ||= {} @previous_changes[field] = card.last_change_on field, before: self end end;T;+To; ; F; ;,;;;I"!Card::Action#interpret_field;F;[[I" field;T0;[[@tqi;F;:interpret_field;;;[;{;IC;" ;T;@Fs;.0;F;[;[; I";T;!0;'@'q;(I"def interpret_field field;T;)T;*I"def interpret_field field case field when :content then :db_content when :cardtype then :type_id else field.to_sym end end;T;+To; ; F; ;,;;;I"!Card::Action#interpret_value;F;[[I" field;T0[I" value;T0;[[@tqi;F;:interpret_value;;;[;{;IC;" ;T;@Us;.0;F;[;[; I";T;!0;'@'q;(I"%def interpret_value field, value;T;)T;*I"def interpret_value field, value case field.to_sym when :type_id value && value.to_i when :cardtype type_card = value && Card.quick_fetch(value.to_i) type_card && type_card.name.capitalize else value end end;T;+T;I@'q;JIC;[;I@'q;KIC;[;I@'q;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@,qi [@tqi ;F;: Action;;;;;[;{;IC;" ;T;@'q;.0;F;[;[; I";T;!0;'@;I"Card::Action;F;Io;S ;T0;UI"ActiveRecord::Base;T;V@;;;'o;S ;T0;U0;V0;;j;'@;W@z[;X0;W0;X; ;+To; ;IC;[ o; ; F; ;,;;;I"Card::Change#field=;F;[[I" value;T0;[[I"&mod/01_history/lib/card/change.rb;Ti [I"&mod/01_history/lib/card/change.rb;Ti";F;: field=;;;[;{;IC;" ;T;@|s;.0;F;[;[; I";T;!0;'@zs;(I"def field=(value);T;)T;*I"\def field=(value) write_attribute(:field, Card::TRACKED_FIELDS.index(value.to_s)) end;T;+To; ; F; ;,;;;I"Card::Change#field;F;[;[[@si[@si&;F;;.;;;[;{;IC;" ;T;@s;.0;F;[;[; I";T;!0;'@zs;(I"def field;T;)T;*I"Adef field Card::TRACKED_FIELDS[read_attribute(:field)] end;T;+To; ; F; ; ;;;I"#Card::Change.delete_actionless;F;[;[[@si[@si ;F;;o;;;[;{;IC;" ;T;@s;.0;F;[;[; I";T;!0;'@zs;(I"def delete_actionless;T;)T;*I"def self.delete_actionless Card::Change.where( "card_action_id NOT IN (?)", Card::Action.pluck("id"), ).delete_all end;T;+To; ; F; ;,;;;I"$Card::Change#find_by_field_name;F;[[I" value;T0;[[@si[@si*;F;:find_by_field_name;;;[;{;IC;" ;T;@s;.0;F;[;[; I";T;!0;'@zs;(I""def find_by_field_name(value);T;)T;*I"def find_by_field_name(value) index = value.is_a?(Integer) ? value : Card::TRACKED_FIELDS.index(value.to_s) find_by_field(index) end;T;+To; ; F; ; ;;;I"$Card::Change.find_by_field_name;F;[[I" value;T0;[[@si[@si;F;;;;;[;{;IC;" ;T;@s;.0;F;[;[; I";T;!0;'@zs;(I""def find_by_field_name(value);T;)T;*I"def self.find_by_field_name(value) index = value.is_a?(Integer) ? value : Card::TRACKED_FIELDS.index(value.to_s) find_by_field(index) end;T;+To; ; F; ; ;;;I"Card::Change.field_index;F;[[I" value;T0;[[@si;F;;;;;[;{;IC;" ;T;@s;.0;F;[;[; I";T;!0;'@zs;(I"def field_index value;T;)T;*I"`def field_index value value.is_a?(Integer) ? value : TRACKED_FIELDS.index(value.to_s) end;T;+T;I@zs;JIC;[;I@zs;KIC;[;I@zs;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@si;F;: Change;;;;;[;{;IC;" ;T;@zs;.0;F;[;[; I";T;!0;'@;I"Card::Change;F;Io;S ;T0;UI"ActiveRecord::Base;T;V@;;;'o;S ;T0;U0;V0;;j;'@;W@z[;X0;W0;X; ;+T@$@3@L2@&o; ;IC;[o; ; F; ; ;;;I"Card::AllSet.label;F;[[I" name;T0;[[I"#tmpsets/set_pattern/100-all.rb;Ti ;T;;Z;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/01_all.rb ~~~~~~~~~~~ ;T;@s;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/01_all.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i ;&i ;'@s;(I"def label name;T;)T;*I"%def label name 'All cards' end;T;+To; ; F; ; ;;;I" Card::AllSet.prototype_args;F;[[I" anchor;T0;[[@si;F;;T;;;[;{;IC;" ;T;@s;.0;F;[;[; I";T;!0;'@s;(I"def prototype_args anchor;T;)T;*I"'def prototype_args anchor {} end;T;+To; ; F; ; ;;;I"Card::AllSet.follow_label;F;[[I" name;T0;[[@si;F;;$;;;[;{;IC;" ;T;@t;.0;F;[;[; I";T;!0;'@s;(I"def follow_label name;T;)T;*I"-def follow_label name 'everything' end;T;+T;I@s;JIC;[;I@s;KIC;[;I@s;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@si;F;: AllSet;;;;;[;{;IC;" ;T;@s;.0;F;[;[; I";T;!0;'o;S ;T0;U0;V0;;d;'@;W@;X0;I"Card::AllSet;F;Io;S ;T0;UI"Card::SetPattern;T;V@,t;;Q;'@;W@l;X0o; ;IC;[ o; ; F; ; ;;;I"Card::SelfSet.label;F;[[I" name;T0;[[I"$tmpsets/set_pattern/107-self.rb;Ti ;T;;Z;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/08_self.rb ~~~~~~~~~~~ ;T;@2t;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/08_self.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i ;&i ;'@0t;(I"def label(name);T;)T;*I"/def label name %{The card "#{name}"} end;T;+To; ; F; ; ;;;I"!Card::SelfSet.prototype_args;F;[[I" anchor;T0;[[@9ti;F;;T;;;[;{;IC;" ;T;@Ct;.0;F;[;[; I";T;!0;'@0t;(I"def prototype_args(anchor);T;)T;*I"6def prototype_args anchor { :name=>anchor } end;T;+To; ; F; ; ;;;I"Card::SelfSet.anchor_name;F;[[I" card;T0;[[@9ti;F;;U;;;[;{;IC;" ;T;@Rt;.0;F;[;[; I";T;!0;'@0t;(I"def anchor_name(card);T;)T;*I")def anchor_name card card.name end;T;+To; ; F; ; ;;;I"Card::SelfSet.anchor_id;F;[[I" card;T0;[[@9ti;F;;V;;;[;{;IC;" ;T;@at;.0;F;[;[; I";T;!0;'@0t;(I"def anchor_id(card);T;)T;*I"%def anchor_id card card.id end;T;+To; ; F; ; ;;;I"Card::SelfSet.follow_label;F;[[I" name;T0;[[@9ti;F;;$;;;[;{;IC;" ;T;@pt;.0;F;[;[; I";T;!0;'@0t;(I"def follow_label(name);T;)T;*I"%def follow_label name name end;T;+T;I@0t;JIC;[;I@0t;KIC;[;I@0t;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@9ti;F;: SelfSet;;;;;[;{;IC;" ;T;@0t;.0;F;[;[; I";T;!0;'o;S ;T0;U0;V0;;d;'@;W@;X0;I"Card::SelfSet;F;Io;S ;T0;UI"Card::SetPattern;T;V@t;;Q;'@;W@l;X0o; ;IC;[ o; ; F; ; ;;;I"Card::StarSet.label;F;[[I" name;T0;[[I"$tmpsets/set_pattern/103-star.rb;Ti ;T;;Z;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/04_star.rb ~~~~~~~~~~~ ;T;@t;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/04_star.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i ;&i ;'@t;(I"def label(name);T;)T;*I")def label name 'All "*" cards' end;T;+To; ; F; ; ;;;I"!Card::StarSet.prototype_args;F;[[I" anchor;T0;[[@ti;F;;T;;;[;{;IC;" ;T;@t;.0;F;[;[; I";T;!0;'@t;(I"def prototype_args(anchor);T;)T;*I"8def prototype_args anchor { :name=>'*dummy' } end;T;+To; ; F; ; ;;;I"#Card::StarSet.pattern_applies?;F;[[I" card;T0;[[@ti;F;;J;;;[;{;IC;" ;T;@t;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@t; I";T;!0;'@t;(I"def pattern_applies?(card);T;)T;*I"8def pattern_applies? card card.cardname.star? end;T;+To; ; F; ; ;;;I"Card::StarSet.follow_label;F;[[I" name;T0;[[@ti;F;;$;;;[;{;IC;" ;T;@t;.0;F;[;[; I";T;!0;'@t;(I"def follow_label(name);T;)T;*I"0def follow_label name 'all "*" cards' end;T;+T;I@t;JIC;[;I@t;KIC;[;I@t;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@ti;F;: StarSet;;;;;[;{;IC;" ;T;@t;.0;F;[;[; I";T;!0;'o;S ;T0;U0;V0;;d;'@;W@;X0;I"Card::StarSet;F;Io;S ;T0;UI"Card::SetPattern;T;V@t;;Q;'@;W@l;X0o; ;IC;[ o;[;[[I"%tmpsets/set_pattern/104-rstar.rb;Ti ;T;;;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/05_rstar.rb ~~~~~~~~~~~ ;T;@t;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/05_rstar.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i ;&i ;'@t;I"Card::RstarSet::@@options;F;(I"(@@options = { junction_only: true };T;*I"(@@options = { junction_only: true };T;6I"{ junction_only: true };T;+To; ; F; ; ;;;I"Card::RstarSet.label;F;[[I" name;T0;[[@ti;F;;Z;;;[;{;IC;" ;T;@t;.0;F;[;[; I";T;!0;'@t;(I"def label(name);T;)T;*I"*def label name 'All "+*" cards' end;T;+To; ; F; ; ;;;I""Card::RstarSet.prototype_args;F;[[I" anchor;T0;[[@ti;F;;T;;;[;{;IC;" ;T;@ u;.0;F;[;[; I";T;!0;'@t;(I"def prototype_args(anchor);T;)T;*I"?def prototype_args anchor { :name=>'*dummy+*dummy' } end;T;+To; ; F; ; ;;;I"$Card::RstarSet.pattern_applies?;F;[[I" card;T0;[[@ti;F;;J;;;[;{;IC;" ;T;@u;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@u; I";T;!0;'@t;(I"def pattern_applies?(card);T;)T;*I"9def pattern_applies? card card.cardname.rstar? end;T;+To; ; F; ; ;;;I" Card::RstarSet.follow_label;F;[[I" name;T0;[[@ti;F;;$;;;[;{;IC;" ;T;@-u;.0;F;[;[; I";T;!0;'@t;(I"def follow_label(name);T;)T;*I"1def follow_label name 'all "+*" cards' end;T;+T;I@t;JIC;[;I@t;KIC;[;I@t;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@ti;F;: RstarSet;;;;;[;{;IC;" ;T;@t;.0;F;[;[; I";T;!0;'o;S ;T0;U0;V0;;d;'@;W@;X0;I"Card::RstarSet;F;Io;S ;T0;UI"Card::SetPattern;T;V@Ku;;Q;'@;W@l;X0o; ;IC;[ o;[;[[I"%tmpsets/set_pattern/105-right.rb;Ti ;T;;;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/06_right.rb ~~~~~~~~~~~ ;T;@Qu;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/06_right.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i ;&i ;'@Ou;I"Card::RightSet::@@options;F;(I"@@options = {;T;*I"@@@options = { junction_only: true, assigns_type: true };T;6I"4{ junction_only: true, assigns_type: true };T;+To; ; F; ; ;;;I"Card::RightSet.label;F;[[I" name;T0;[[@Tui;F;;Z;;;[;{;IC;" ;T;@`u;.0;F;[;[; I";T;!0;'@Ou;(I"def label(name);T;)T;*I"1def label name %{All "+#{name}" cards} end;T;+To; ; F; ; ;;;I""Card::RightSet.prototype_args;F;[[I" anchor;T0;[[@Tui;F;;T;;;[;{;IC;" ;T;@ou;.0;F;[;[; I";T;!0;'@Ou;(I"def prototype_args(anchor);T;)T;*I"Bdef prototype_args anchor { :name=>"*dummy+#{anchor}" } end;T;+To; ; F; ; ;;;I"Card::RightSet.anchor_name;F;[[I" card;T0;[[@Tui;F;;U;;;[;{;IC;" ;T;@~u;.0;F;[;[; I";T;!0;'@Ou;(I"def anchor_name(card);T;)T;*I"1def anchor_name card card.cardname.tag end;T;+To; ; F; ; ;;;I" Card::RightSet.follow_label;F;[[I" name;T0;[[@Tui;F;;$;;;[;{;IC;" ;T;@u;.0;F;[;[; I";T;!0;'@Ou;(I"def follow_label(name);T;)T;*I"4def follow_label name %{all "+#{name}s"} end;T;+T;I@Ou;JIC;[;I@Ou;KIC;[;I@Ou;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Tui;F;: RightSet;;;;;[;{;IC;" ;T;@Ou;.0;F;[;[; I";T;!0;'o;S ;T0;U0;V0;;d;'@;W@;X0;I"Card::RightSet;F;Io;S ;T0;UI"Card::SetPattern;T;V@u;;Q;'@;W@l;X0o; ;IC;[ o;[;[[I"(tmpsets/set_pattern/101-all_plus.rb;Ti ;T;;;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/02_all_plus.rb ~~~~~~~~~~~ ;T;@u;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/02_all_plus.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i ;&i ;'@u;I" Card::AllPlusSet::@@options;F;(I"(@@options = { junction_only: true };T;*I"(@@options = { junction_only: true };T;6I"{ junction_only: true };T;+To; ; F; ; ;;;I"Card::AllPlusSet.label;F;[[I" name;T0;[[@ui;F;;Z;;;[;{;IC;" ;T;@u;.0;F;[;[; I";T;!0;'@u;(I"def label(name);T;)T;*I")def label name 'All "+" cards' end;T;+To; ; F; ; ;;;I"$Card::AllPlusSet.prototype_args;F;[[I" anchor;T0;[[@ui;F;;T;;;[;{;IC;" ;T;@u;.0;F;[;[; I";T;!0;'@u;(I"def prototype_args(anchor);T;)T;*I"3def prototype_args anchor { :name=>'+' } end;T;+To; ; F; ; ;;;I""Card::AllPlusSet.follow_label;F;[[I" name;T0;[[@ui;F;;$;;;[;{;IC;" ;T;@u;.0;F;[;[; I";T;!0;'@u;(I"def follow_label(name);T;)T;*I"0def follow_label name 'all "+" cards' end;T;+T;I@u;JIC;[;I@u;KIC;[;I@u;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@ui;F;:AllPlusSet;;;;;[;{;IC;" ;T;@u;.0;F;[;[; I";T;!0;'o;S ;T0;U0;V0;;d;'@;W@;X0;I"Card::AllPlusSet;F;Io;S ;T0;UI"Card::SetPattern;T;V@u;;Q;'@;W@l;X0o; ;IC;[ o;[;[[I"/tmpsets/set_pattern/106-type_plus_right.rb;Ti ;T;;;;;;;[;{;IC;"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/07_type_plus_right.rb ~~~~~~~~~~~ ;T;@v;F;[;[; I"~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set_pattern/07_type_plus_right.rb ~~~~~~~~~~~;T;!0;"o;#;$F;%i ;&i ;'@v;I"&Card::TypePlusRightSet::@@options;F;(I"@@options = {;T;*I"Y@@options = { junction_only: true, assigns_type: true, anchor_parts_count: 2 };T;6I"M{ junction_only: true, assigns_type: true, anchor_parts_count: 2 };T;+To; ; F; ; ;;;I"!Card::TypePlusRightSet.label;F;[[I" name;T0;[[@vi;F;;Z;;;[;{;IC;" ;T;@v;.0;F;[;[; I";T;!0;'@v;(I"def label(name);T;)T;*I"bdef label name %{All "+#{name.to_name.tag}" cards on "#{name.to_name.left_name}" cards} end;T;+To; ; F; ; ;;;I"*Card::TypePlusRightSet.prototype_args;F;[[I" anchor;T0;[[@vi;F;;T;;;[;{;IC;" ;T;@ v;.0;F;[;[; I";T;!0;'@v;(I"def prototype_args(anchor);T;)T;*I"~def prototype_args anchor { :name=>"+#{anchor.tag}", :supercard=>Card.new( :name=>'*dummy', :type=>anchor.trunk_name ) } end;T;+To; ; F; ; ;;;I"'Card::TypePlusRightSet.anchor_name;F;[[I" card;T0;[[@vi[I"/tmpsets/set_pattern/106-type_plus_right.rb;Ti;F;;U;;;[;{;IC;" ;T;@/v;.0;F;[;[; I";T;!0;'@v;(I"def anchor_name(card);T;)T;*I"def anchor_name card left = card.left type_name = (left && left.type_name) || Card[ Card.default_type_id ].name "#{type_name}+#{card.cardname.tag}" end;T;+To; ; F; ; ;;;I"(Card::TypePlusRightSet.follow_label;F;[[I" name;T0;[[@vi [@7vi#;F;;$;;;[;{;IC;" ;T;@@v;.0;F;[;[; I";T;!0;'@v;(I"def follow_label(name);T;)T;*I"_def follow_label name %{all "+#{name.to_name.tag}" on "#{name.to_name.left_name}s"} end;T;+T;I@v;JIC;[;I@v;KIC;[;I@v;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@vi;F;:TypePlusRightSet;;;;;[;{;IC;" ;T;@v;.0;F;[;[; I";T;!0;'o;S ;T0;U0;V0;;d;'@;W@;X0;I"Card::TypePlusRightSet;F;Io;S ;T0;UI"Card::SetPattern;T;V@_v;;Q;'@;W@l;X0o;7;IC;[ o;4;[[I"lib/card/stage.rb;Ti3;F;: STAGES;;;;;[;{;IC;" ;T;@ev;.0;F;[;[; I";T;!0;'@cv;I"::@o{ );F;(I"OSTAGES = [:initialize, :prepare_to_validate, :validate, :prepare_to_store,;T;*I"STAGES = [:initialize, :prepare_to_validate, :validate, :prepare_to_store, :store, :finalize, :integrate, :integrate_with_delay].freeze;T;6I"~[:initialize, :prepare_to_validate, :validate, :prepare_to_store, :store, :finalize, :integrate, :integrate_with_delay].freeze;T;+To;4;[[@hvi5;F;:STAGE_INDEX;;;;;[;{;IC;" ;T;@sv;.0;F;[;[; I";T;!0;'@cv;I"Card::Stage::STAGE_INDEX;F;(I"STAGE_INDEX = {};T;*I"STAGE_INDEX = {};T;6I"{};T;+To; ; F; ;,;;;I"Card::Stage#stage_symbol;F;[[I" index;T0;[[@hvi;;F;:stage_symbol;;;[;{;IC;" ;T;@v;.0;F;[;[o;0 ;1I" raise;F;2I";T;0;3[I"Card::Error;T;@v; I";T;!0;'@cv;(I"def stage_symbol index;T;)T;*I"def stage_symbol index case index when Symbol return index if STAGE_INDEX[index] when Integer return STAGES[index] if index < STAGES.size end raise Card::Error, "not a valid stage index: #{index}" end;T;+To; ; F; ;,;;;I";F;[[I" stage;T0;[[@hviE;F;:stage_index;;;[;{;IC;" ;T;@v;.0;F;[;[; I";T;!0;'@cv;(I"def stage_index stage;T;)T;*I"def stage_index stage case stage when Symbol then return STAGE_INDEX[stage] when Integer then return stage else raise Card::Error, "not a valid stage: #{stage}" end end;T;+To; ; F; ;,;;;I";F;[[I" opts;T0;[[@hviP;F;:stage_ok?;;;[;{;IC;" ;T;@v;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@v; I";T;!0;'@cv;(I"def stage_ok? opts;T;)T;*I"def stage_ok? opts stage && ( (opts[:during] && in?(opts[:during])) || (opts[:before] && before?(opts[:before])) || (opts[:after] && after?(opts[:after])) || true # no phase restriction in opts ) end;T;+To; ; F; ;,;;;I" 7`n;F;[[I"allowed_phase;T0;[[@hviY;F;;;;;[;{;IC;" ;T;@v;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@v; I";T;!0;'@cv;(I"def before? allowed_phase;T;)T;*I"Tdef before? allowed_phase STAGE_INDEX[allowed_phase] > STAGE_INDEX[stage] end;T;+To; ; F; ;,;;;I"p z ;F;[[I"allowed_phase;T0;[[@hvi];F;;;;;[;{;IC;" ;T;@v;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@v; I";T;!0;'@cv;(I"def after? allowed_phase;T;)T;*I"Sdef after? allowed_phase STAGE_INDEX[allowed_phase] < STAGE_INDEX[stage] end;T;+To; ; F; ;,;;;I"`ւ˅;F;[[I"allowed_phase;T0;[[@hvia;F;;;;;[;{;IC;" ;T;@v;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@v; I";T;!0;'@cv;(I"def in? allowed_phase;T;)T;*I"|def in? allowed_phase (allowed_phase.is_a?(Array) && allowed_phase.include?(stage)) || allowed_phase == stage end;T;+T;I@cv;JIC;[;I@cv;KIC;[;I@cv;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@hvi2;T;: Stage;;;;;[;{;IC;"The process of writing a card change to the database is divided into 8 stages that are grouped in 3 phases. 'validation phase' * initialize stage (I) * prepare_to_validate stage (P2V) * validate stage (V) 'storage phase' * prepare_to_store stage (P2S) * store stage (S) * finalize stage (F) 'integration phase' * integrate stage (IG) * integrate_with_delay stage (IGwD) Explanation: yes! the recommended stage to do that yes ok to do it here if necessary no not recommended; chance to mess things up but if something forces you to do it here you can try no! never do it here. it won't work or will break things if there is only a single entry in a phase column it counts for all stages of that phase validation | storage | integrate I P2V V | P2S S F | IG IGwD ---------------------------------------------------------------------- add subcard yes! yes! yes | yes yes yes | yes remove subcard yes! yes! yes | yes no no! | no! validate yes yes yes! | no | no unsecure change yes yes! no | no! | no! secure change yes | yes! no! no! | no! abort yes! | yes | yes? fail create other cards has id no | no no? yes | yes dirty attributes yes | yes | no ;T;@cv;F;[;[; I"The process of writing a card change to the database is divided into 8 stages that are grouped in 3 phases. 'validation phase' * initialize stage (I) * prepare_to_validate stage (P2V) * validate stage (V) 'storage phase' * prepare_to_store stage (P2S) * store stage (S) * finalize stage (F) 'integration phase' * integrate stage (IG) * integrate_with_delay stage (IGwD) Explanation: yes! the recommended stage to do that yes ok to do it here if necessary no not recommended; chance to mess things up but if something forces you to do it here you can try no! never do it here. it won't work or will break things if there is only a single entry in a phase column it counts for all stages of that phase validation | storage | integrate I P2V V | P2S S F | IG IGwD ---------------------------------------------------------------------- add subcard yes! yes! yes | yes yes yes | yes remove subcard yes! yes! yes | yes no no! | no! validate yes yes yes! | no | no unsecure change yes yes! no | no! | no! secure change yes | yes! no! no! | no! abort yes! | yes | yes? fail create other cards has id no | no no? yes | yes dirty attributes yes | yes | no ;T;!0;"o;#;$F;%i;&i1;'@;I" !;F;+To; ; F; ;,;;;I"T~gP;F;[;[[I"lib/card/subcards.rb;Ti;F;;;;;[;{;IC;" ;T;@w;.0;F;[;[; I";T;!0;'@;(I"def subcards;T;)T;*I"jdef subcards @subcards ||= Subcards.new(self) # @subcards ||= (director && director.subcards) end;T;+To; ; F; ;,;;;I" ZNJ;F;[;[[@ wi;F;:expire_subcards;;;[;{;IC;" ;T;@w;.0;F;[;[; I";T;!0;'@;(I"def expire_subcards;T;)T;*I"-def expire_subcards subcards.clear end;T;+To; ;IC;[&o; ; F; ;,;;;I" Card::Subcards#context_card;F;[;[[@ wi;F;:context_card;;;[;{;IC;"0Returns the value of attribute context_card ;T;@!w;.0;F;[;[; I"0Returns the value of attribute context_card;T;!0;'@w;(I"def context_card;T;*I")def context_card @context_card end;T;+To; ; F; ;,;;;I"!Card::Subcards#context_card=;F;[[I" value;T0;[[@ wi;F;:context_card=;;;[;{;IC;"$Sets the attribute context_card ;T;@.w;.0;F;[;[o;0 ;1I" param;F;2I"4the value to set the attribute context_card to.;T;I" value;T;30;@.w; I"aSets the attribute context_card @param value the value to set the attribute context_card to.;T;!0;'@w;(I"def context_card=(value);T;*I"9def context_card=(value) @context_card = value end;T;+To; ; F; ;,;;;I"  !!;F;[;[[@ wi;F;: keys;;;[;{;IC;"(Returns the value of attribute keys ;T;@Aw;.0;F;[;[; I"(Returns the value of attribute keys;T;!0;'@w;(I" def keys;T;*I"def keys @keys end;T;+To; ; F; ;,;;;I"Card::Subcards#remov;F;[[I" value;T0;[[@ wi;F;: keys=;;;[;{;IC;"Sets the attribute keys ;T;@Nw;.0;F;[;[o;0 ;1I" param;F;2I",the value to set the attribute keys to.;T;I" value;T;30;@Nw; I"QSets the attribute keys @param value the value to set the attribute keys to.;T;!0;'@w;(I"def keys=(value);T;*I")def keys=(value) @keys = value end;T;+To; ; F; ;,;;;I"Card::Subcards#initialize;F;[[I"context_card;T0;[[@ wi;F;;C;;;[;{;IC;" ;T;@aw;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of Subcards;T;0;3[I" Subcards;F;@aw; I";T;!0;'@w;(I" def initialize context_card;T;)T;*I"Wdef initialize context_card @context_card = context_card @keys = ::Set.new end;T;+To; ; F; ;,;;;I"446;F;[;[[@ wi!;F;: clear;;;[;{;IC;" ;T;@uw;.0;F;[;[; I";T;!0;'@w;(I"def clear;T;)T;*I"def clear @keys.each do |key| if (subcard = fetch_subcard key) Card::DirectorRegister.delete subcard.director end Card.cache.soft.delete key end @keys = ::Set.new end;T;+To; ; F; ;,;;;I"Card::Subcards#deep_clear;F;[[I" cleared;TI"::Set.new;T;[[@ wi+;F;:deep_clear;;;[;{;IC;" ;T;@w;.0;F;[;[; I";T;!0;'@w;(I"%def deep_clear cleared=::Set.new;T;)T;*I"def deep_clear cleared=::Set.new each_card do |card| next if cleared.include? card.id cleared << card.id card.subcards.deep_clear cleared end clear end;T;+To; ; F; ;,;;;I";F;[[I"name_or_card;T0;[[@ wi4;F;: remove;;;[;{;IC;" ;T;@w;.0;F;[;[; I";T;!0;'@w;(I"def remove name_or_card;T;)T;*I"Jdef remove name_or_card key = subcard_key name_or_card return unless @keys.include? key @keys.delete key removed_card = fetch_subcard key if removed_card.current_action removed_card.current_action.delete end Card::DirectorRegister.deep_delete removed_card.director Card.cache.soft.delete key removed_card end;T;+To; ; F; ;,;;;I"Card::Set::Loader#;F;[[I"name_or_card_or_attr;T0[I"card_or_attr;TI"nil;T;[[@ wiA;F;;X;;;[;{;IC;" ;T;@w;.0;F;[;[; I";T;!0;'@w;(I"3def add name_or_card_or_attr, card_or_attr=nil;T;)T;*I"def add name_or_card_or_attr, card_or_attr=nil if card_or_attr name = name_or_card_or_attr else card_or_attr = name_or_card_or_attr end case card_or_attr when Hash args = card_or_attr if name new_by_attributes name, args elsif args[:name] new_by_attributes args.delete(:name), args else args.each_pair do |key, val| case val when String then new_by_attributes key, content: val when Card val.name = absolutize_subcard_name key new_by_card val else new_by_attributes key, val end end end when Card new_by_card card_or_attr when Symbol, String new_by_attributes card_or_attr, {} end end;T;+To; ; F; ;,;;;I"%Card::Subcards#catch_up_to_stage;F;[[I"stage_index;T0;[[@ wi`;F;:catch_up_to_stage;;;[;{;IC;" ;T;@w;.0;F;[;[; I";T;!0;'@w;(I"&def catch_up_to_stage stage_index;T;)T;*I"sdef catch_up_to_stage stage_index each_card do |subcard| subcard.catch_up_to_stage stage_index end end;T;+To; ; F; ;,;;;I"def field name key ;F;[[I" old_name;T0[I" new_name;T0;[[@ wif;F;: rename;;;[;{;IC;" ;T;@w;.0;F;[;[; I";T;!0;'@w;(I""def rename old_name, new_name;T;)T;*I"def rename old_name, new_name return unless @keys.include? old_name.to_name.key @keys.delete old_name.to_name.key @keys << new_name.to_name.key end;T;+To; ; F; ;,;;;I"ä*DPOi;F;[[I" value;T0;[[@ wil;F;;;;;[;{;IC;" ;T;@w;.0;F;[;[; I";T;!0;'@w;(I"def << value;T;)T;*I"!def << value add value end;T;+To; ; F; ;,;;;I""Card::Subcards#method_missing;F;[[I" method;T0[I" *args;T0;[[@ wip;F;;@;;;[;{;IC;" ;T;@w;.0;F;[;[; I";T;!0;'@w;(I"%def method_missing method, *args;T;)T;*I"mdef method_missing method, *args return unless @keys.respond_to? method @keys.send method, *args end;T;+To; ; F; ;,;;;I"Card::Subcards#each_card;F;[;[[@ wiu;F;:each_card;;;[;{;IC;" ;T;@w;.0;F;[;[; I";T;!0;'@w;(I"def each_card;T;)T;*I"gdef each_card # fetch all cards first to avoid side effects # e.g. deleting a user adds follow rules and +*account to subcards # for deleting but deleting follow rules can remove +*account from the # cache if it belongs to the rule cards cards = @keys.map do |key| fetch_subcard key end cards.each do |card| yield(card) if card end end;T;+To; ; F; ;,;;;I"@q{#prep;F;[;[[@ wi};F;: each;;;[;{;IC;";T;@x;.0;F;[;[; I" ;T;!0;"0;'@w;(@w;*I"gdef each_card # fetch all cards first to avoid side effects # e.g. deleting a user adds follow rules and +*account to subcards # for deleting but deleting follow rules can remove +*account from the # cache if it belongs to the rule cards cards = @keys.map do |key| fetch_subcard key end cards.each do |card| yield(card) if card end end;T;+To; ; F; ;,;;;I"!Card::Subcards#each_with_key;F;[;[[@ wi;F;:each_with_key;;;[;{;IC;" ;T;@ x;.0;F;[;[; I";T;!0;'@w;(I"def each_with_key;T;)T;*I"qdef each_with_key @keys.each do |key| card = fetch_subcard(key) yield(card, key) if card end end;T;+To; ; F; ;,;;;I"@ ;F;[[I" name;T0[I"card_or_attr;T0;[[@ wi;F;;:;;;[;{;IC;" ;T;@x;.0;F;[;[; I";T;!0;'@w;(I"def []= name, card_or_attr;T;)T;*I"def []= name, card_or_attr case card_or_attr when Hash new_by_attributes name, card_or_attr when Card new_by_card card_or_attr end end;T;+To; ; F; ;,;;;I"Card::Set@ ;F;[[I" name;T0;[[@ wi;F;;9;;;[;{;IC;" ;T;@*x;.0;F;[;[; I";T;!0;'@w;(I"def [] name;T;)T;*I"0def [] name card(name) || field(name) end;T;+To; ; F; ;,;;;I";F;[[I" name;T0;[[@ wi;F;;.;;;[;{;IC;" ;T;@9x;.0;F;[;[; I";T;!0;'@w;(I"def field name;T;)T;*I"`def field name key = field_name_to_key name fetch_subcard key if @keys.include? key end;T;+To; ; F; ;,;;;I" A%;F;[[I" name;T0;[[@ wi;F;;;;;[;{;IC;" ;T;@Hx;.0;F;[;[; I";T;!0;'@w;(I"def card name;T;)T;*I"[def card name return unless @keys.include? name.to_name.key fetch_subcard name end;T;+To; ; F; ;,;;;I"Card::Subcards#add_child;F;[[I" name;T0[I" args;T0;[[@ wi;F;:add_child;;;[;{;IC;" ;T;@Wx;.0;F;[;[; I";T;!0;'@w;(I"def add_child name, args;T;)T;*I"@def add_child name, args add prepend_plus(name), args end;T;+To; ; F; ;,;;;I" Card::Subcards#remove_child;F;[[I"name_or_card;T0;[[@ wi;F;:remove_child;;;[;{;IC;" ;T;@hx;.0;F;[;[; I";T;!0;'@w;(I""def remove_child name_or_card;T;)T;*I"Adef remove_child name_or_card if name_or_card.is_a? Card remove name_or_card else absolute_name = @context_card.cardname.field_name(name_or_card) if @keys.include? absolute_name.key remove absolute_name else remove @context_card.cardname.relative_field_name(name_or_card) end end end;T;+To; ; F; ;,;;;I"Card::Subcards#add_field;F;[;[[@ wi;F;:add_field;;;[;{;IC;";T;@wx;.0;F;[;[; I" ;T;!0;"0;'@w;(@fx;*I"@def add_child name, args add prepend_plus(name), args end;T;+To; ; F; ;,;;;I" Card::Subcards#remove_field;F;[;[[@ wi;F;:remove_field;;;[;{;IC;";T;@x;.0;F;[;[; I" ;T;!0;"0;'@w;(@ux;*I"Adef remove_child name_or_card if name_or_card.is_a? Card remove name_or_card else absolute_name = @context_card.cardname.field_name(name_or_card) if @keys.include? absolute_name.key remove absolute_name else remove @context_card.cardname.relative_field_name(name_or_card) end end end;T;+To; ; F; ;,;;;I"::@@;F;[;[[@ wi;F;: present?;;;[;{;IC;" ;T;@x;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@x; I";T;!0;'@w;(I"def present?;T;)T;*I"&def present? @keys.present? end;T;+To; ; F; ;,;;;I"@q{#subcard_key;F;[[I"name_or_card;T0;[[@ wi;F;:subcard_key;;;[;{;IC;" ;T;@x;.0;F;[;[; I";T;!0;'@w;(I"!def subcard_key name_or_card;T;)T;*I"+def subcard_key name_or_card key = case name_or_card when Card name_or_card.key when Symbol fetch_subcard(name_or_card).key else name_or_card.to_name.key end key = absolutize_subcard_name(key).key unless @keys.include?(key) key end;T;+To; ; F; ;,;;;I"!@q{#fetch_subcard;F;[[I"key;T0;[[@ wi;F;:fetch_subcard;;;[;{;IC;" ;T;@x;.0;F;[;[; I";T;!0;'@w;(I"def fetch_subcard key;T;)T;*I"Jdef fetch_subcard key Card.fetch key, local_only: true, new: {} end;T;+To; ; F; ;,;;;I" @q{#prepend_plus;F;[[I" name;T0;[[@ wi;F;:prepend_plus;;;[;{;IC;" ;T;@x;.0;F;[;[; I";T;!0;'@w;(I"def prepend_plus name;T;)T;*I"def prepend_plus name case name when Symbol "+#{Card[name].name}" when /^\+/ name else "+#{name}" end end;T;+To; ; F; ;,;;;I"%@q{#field_name_to_key;F;[[I" name;T0;[[@ wi;F;:field_name_to_key;;;[;{;IC;" ;T;@x;.0;F;[;[; I";T;!0;'@w;(I"def field_name_to_key name;T;)T;*I"Fdef field_name_to_key name if @context_card.name =~ /^\+/ @context_card.cardname.relative_field_name(name).key else absolute_key = @context_card.cardname.field_name(name).key if @keys.include? absolute_key absolute_key else @context_card.cardname.relative_field_name(name).key end end end;T;+To; ; F; ;,;;;I")@q{#extract_subcard_args!;F;[[I" args;T0;[[@ wi;T;;;;;[;{;IC;"TODO: this method already exists as card instance method in tracked_attributes.rb. Find a place for it where its accessible for both. There is one important difference. The keys are symbols here instead of strings ;T;@x;F;[;[; I"TODO: this method already exists as card instance method in tracked_attributes.rb. Find a place for it where its accessible for both. There is one important difference. The keys are symbols here instead of strings;T;!0;"o;#;$F;%i;&i;'@w;(I"#def extract_subcard_args! args;T;)T;*I"9def extract_subcard_args! args subcards = args.delete(:subcards) || {} if (subfields = args.delete(:subfields)) subfields.each_pair do |key, value| subcards[cardname.field(key)] = value end end args.keys.each do |key| subcards[key] = args.delete(key) if key =~ /^\+/ end subcards end;T;+To; ; F; ;,;;;I"%@q{#new_by_attributes;F;[[I" name;T0[I"attributes;TI"{};T;[[@ wi;F;:new_by_attributes;;;[;{;IC;" ;T;@x;.0;F;[;[; I";T;!0;'@w;(I".def new_by_attributes name, attributes={};T;)T;*I"odef new_by_attributes name, attributes={} absolute_name = absolutize_subcard_name name if absolute_name.field_of?(@context_card.name) && (absolute_name.parts.size - @context_card.cardname.parts.size) > 2 left_card = new_by_attributes absolute_name.left new_by_card left_card left_card.new_by_attributes absolute_name, attributes else subcard_args = extract_subcard_args! attributes card = Card.assign_or_initialize_by absolute_name.s, attributes, local_only: true subcard = new_by_card card card.subcards.add subcard_args subcard end end;T;+To; ; F; ;,;;;I"+@q{#absolutize_subcard_name;F;[[I" name;T0;[[@ wi;F;:absolutize_subcard_name;;;[;{;IC;" ;T;@x;.0;F;[;[; I";T;!0;'@w;(I"%def absolutize_subcard_name name;T;)T;*I"def absolutize_subcard_name name if @context_card.name =~ /^\+/ || name.blank? name.to_name else name.to_name.to_absolute_name(@context_card.name) end end;T;+To; ; F; ;,;;;I"@q{#new_by_card;F;[[I" card;T0;[[@ wi ;F;:new_by_card;;;[;{;IC;" ;T;@y;.0;F;[;[; I";T;!0;'@w;(I"def new_by_card card;T;)T;*I"1def new_by_card card card.supercard = @context_card if !card.cardname.simple? && card.cardname.field_of?(@context_card.cardname) card.superleft = @context_card end @keys << card.key Card.write_to_soft_cache card card.director = @context_card.director.subdirectors.add(card) card end;T;+T;I@w;JIC;[;I@w;KIC;[;I@w;LIC;M{; IC;M{;NT;,IC;M{;IC;M{;C@!w;D@.w;NT;IC;M{;C@Aw;D@Nw;NT;NT;NT;O{@x;@wx;@x;;P[;[[@ wi;F;: Subcards;;;;;[;{;IC;" ;T;@w;.0;F;[;[; I";T;!0;'@;I" r;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+To; ; F; ;,;;;I"44;F;[[I"card_or_id;T0;[[@ wi;F;:right_id=;;;[;{;IC;" ;T;@0y;.0;F;[;[; I";T;!0;'@;(I"def right_id= card_or_id;T;)T;*I"Jdef right_id= card_or_id write_card_or_id :right_id, card_or_id end;T;+To; ; F; ;,;;;I" aM;F;[[I"card_or_id;T0;[[@ wi;F;: left_id=;;;[;{;IC;" ;T;@?y;.0;F;[;[; I";T;!0;'@;(I"def left_id= card_or_id;T;)T;*I"Hdef left_id= card_or_id write_card_or_id :left_id, card_or_id end;T;+To; ; F; ;,;;;I"^@{;F;[[I"card_or_id;T0;[[@ wi ;F;: type_id=;;;[;{;IC;" ;T;@Ny;.0;F;[;[; I";T;!0;'@;(I"def type_id= card_or_id;T;)T;*I"Hdef type_id= card_or_id write_card_or_id :type_id, card_or_id end;T;+To; ; F; ;,;;;I" Ab;F;[[I"attribute;T0[I"card_or_id;T0;[[@ wi$;F;:write_card_or_id;;;[;{;IC;" ;T;@]y;.0;F;[;[; I";T;!0;'@;(I"/def write_card_or_id attribute, card_or_id;T;)T;*I"udef write_card_or_id attribute, card_or_id if card_or_id.is_a? Card card = card_or_id if card.id write_attribute attribute, card.id else add_subcard card card.director.prior_store = true with_id_when_exists(card) do |id| write_attribute attribute, id end end else write_attribute attribute, card_or_id end end;T;+To; ; F; ;,;;;I"Card#with_id_when_exists;F;[[I" card;T0[I" &block;T0;[[@ wi5;F;:with_id_when_exists;;;[;{;IC;" ;T;@ny;.0;F;[;[; I";T;!0;'@;(I")def with_id_when_exists card, &block;T;)T;*I"Vdef with_id_when_exists card, &block card.director.call_after_store(&block) end;T;+To; ;IC;[+o; ; F; ;,;;;I"$Card::StageDirector#prior_store;F;[;[[I"lib/card/stage_director.rb;Ti);F;:prior_store;;;[;{;IC;"/Returns the value of attribute prior_store ;T;@y;.0;F;[;[; I"/Returns the value of attribute prior_store;T;!0;'@y;(I"def prior_store;T;*I"'def prior_store @prior_store end;T;+To; ; F; ;,;;;I"%Card::StageDirector#prior_store=;F;[[I" value;T0;[[@yi);F;:prior_store=;;;[;{;IC;"#Sets the attribute prior_store ;T;@y;.0;F;[;[o;0 ;1I" param;F;2I"3the value to set the attribute prior_store to.;T;I" value;T;30;@y; I"_Sets the attribute prior_store @param value the value to set the attribute prior_store to.;T;!0;'@y;(I"def prior_store=(value);T;*I"7def prior_store=(value) @prior_store = value end;T;+To; ; F; ;,;;;I"4y4;F;[;[[@yi);F;:act;;;[;{;IC;"'Returns the value of attribute act ;T;@y;.0;F;[;[; I"'Returns the value of attribute act;T;!0;'@y;(I" def act;T;*I"def act @act end;T;+To; ; F; ;,;;;I"Card::StageDirector#act=;F;[[I" value;T0;[[@yi);F;: act=;;;[;{;IC;"Sets the attribute act ;T;@y;.0;F;[;[o;0 ;1I" param;F;2I"+the value to set the attribute act to.;T;I" value;T;30;@y; I"OSets the attribute act @param value the value to set the attribute act to.;T;!0;'@y;(I"def act=(value);T;*I"'def act=(value) @act = value end;T;+To; ; F; ;,;;;I"Card::StageDirector#card;F;[;[[@yi);F;;;;;[;{;IC;"(Returns the value of attribute card ;T;@y;.0;F;[;[; I"(Returns the value of attribute card;T;!0;'@y;(I" def card;T;*I"def card @card end;T;+To; ; F; ;,;;;I"Card::StageDirector#card=;F;[[I" value;T0;[[@yi);F;;);;;[;{;IC;"Sets the attribute card ;T;@y;.0;F;[;[o;0 ;1I" param;F;2I",the value to set the attribute card to.;T;I" value;T;30;@y; I"QSets the attribute card @param value the value to set the attribute card to.;T;!0;'@y;(I"def card=(value);T;*I")def card=(value) @card = value end;T;+To; ; F; ;,;;;I"Card::StageDirector#stage;F;[;[[@yi);F;: stage;;;[;{;IC;")Returns the value of attribute stage ;T;@y;.0;F;[;[; I")Returns the value of attribute stage;T;!0;'@y;(I"def stage;T;*I"def stage @stage end;T;+To; ; F; ;,;;;I"Card::StageDirector#stage=;F;[[I" value;T0;[[@yi);F;: stage=;;;[;{;IC;"Sets the attribute stage ;T;@y;.0;F;[;[o;0 ;1I" param;F;2I"-the value to set the attribute stage to.;T;I" value;T;30;@y; I"SSets the attribute stage @param value the value to set the attribute stage to.;T;!0;'@y;(I"def stage=(value);T;*I"+def stage=(value) @stage = value end;T;+To; ; F; ;,;;;I"Card::StageDirector#parent;F;[;[[@yi);F;;;;;[;{;IC;"*Returns the value of attribute parent ;T;@z;.0;F;[;[; I"*Returns the value of attribute parent;T;!0;'@y;(I"def parent;T;*I"def parent @parent end;T;+To; ; F; ;,;;;I" Card::StageDirector#parent=;F;[[I" value;T0;[[@yi);F;: parent=;;;[;{;IC;"Sets the attribute parent ;T;@z;.0;F;[;[o;0 ;1I" param;F;2I".the value to set the attribute parent to.;T;I" value;T;30;@z; I"USets the attribute parent @param value the value to set the attribute parent to.;T;!0;'@y;(I"def parent=(value);T;*I"-def parent=(value) @parent = value end;T;+To; ; F; ;,;;;I"Card::StageDirector#main;F;[;[[@yi);F;: main;;;[;{;IC;"(Returns the value of attribute main ;T;@"z;.0;F;[;[; I"(Returns the value of attribute main;T;!0;'@y;(I" def main;T;*I"def main @main end;T;+To; ; F; ;,;;;I"Card::StageDirector#main=;F;[[I" value;T0;[[@yi);F;: main=;;;[;{;IC;"Sets the attribute main ;T;@/z;.0;F;[;[o;0 ;1I" param;F;2I",the value to set the attribute main to.;T;I" value;T;30;@/z; I"QSets the attribute main @param value the value to set the attribute main to.;T;!0;'@y;(I"def main=(value);T;*I")def main=(value) @main = value end;T;+To; ; F; ;,;;;I"%Card::StageDirector#subdirectors;F;[;[[@yi);F;:subdirectors;;;[;{;IC;"0Returns the value of attribute subdirectors ;T;@Bz;.0;F;[;[; I"0Returns the value of attribute subdirectors;T;!0;'@y;(I"def subdirectors;T;*I")def subdirectors @subdirectors end;T;+To; ; F; ;,;;;I"&Card::StageDirector#subdirectors=;F;[[I" value;T0;[[@yi);F;:subdirectors=;;;[;{;IC;"$Sets the attribute subdirectors ;T;@Oz;.0;F;[;[o;0 ;1I" param;F;2I"4the value to set the attribute subdirectors to.;T;I" value;T;30;@Oz; I"aSets the attribute subdirectors @param value the value to set the attribute subdirectors to.;T;!0;'@y;(I"def subdirectors=(value);T;*I"9def subdirectors=(value) @subdirectors = value end;T;+To; ; F; ;,;;;I" Card::StageDirector#running;F;[;[[@yi+;F;: running;;;[;{;IC;"+Returns the value of attribute running ;T;@bz;.0;F;[;[; I"+Returns the value of attribute running;T;!0;'@y;(I"def running;T;*I"def running @running end;T;+To; ; F; ;,;;;I"!Card::StageDirector#running?;F;[;[[@yi,;F;: running?;;;[;{;IC;"+Returns the value of attribute running;T;@oz;.0;F;[;[; I",Returns the value of attribute running ;T;!0;"0;'@y;(@mz;*I"def running @running end;T;+To; ; F; ;,;;;I"Card::StageDirector#main?;F;[;[[@yi-;F;;;;;[;{;IC;"(Returns the value of attribute main;T;@{z;.0;F;[;[; I")Returns the value of attribute main ;T;!0;"0;'@y;(@-z;*I"def main @main end;T;+To; ; F; ;,;;;I"#Card::StageDirector#initialize;F;[[I" card;T0[I" opts;TI"{};T[I" main;TI" true;T;[[@yi/;F;;C;;;[;{;IC;" ;T;@z;.0;F;[;[o;0 ;1I" return;F;2I"$a new instance of StageDirector;T;0;3[I"StageDirector;F;@z; I";T;!0;'@y;(I",def initialize card, opts={}, main=true;T;)T;*I"def initialize card, opts={}, main=true @card = card @card.director = self # for read actions there is no validation phase # so we have to set the action here @card.identify_action @stage = nil @running = false @prepared = false @parent = opts[:parent] # has card to be stored before the supercard? @prior_store = opts[:priority] @main = main @subdirectors = SubdirectorArray.initialize_with_subcards(self) register end;T;+To; ; F; ;,;;;I"!Card::StageDirector#register;F;[;[[@yiA;F;;;;;[;{;IC;" ;T;@z;.0;F;[;[; I";T;!0;'@y;(I"def register;T;)T;*I"7def register Card::DirectorRegister.add self end;T;+To; ; F; ;,;;;I"#Card::StageDirector#unregister;F;[;[[@yiE;F;:unregister;;;[;{;IC;" ;T;@z;.0;F;[;[; I";T;!0;'@y;(I"def unregister;T;)T;*I" e # don't rollback Card::Error.current = e @card.notable_exception_raised return false end;T;+To; ; F; ;,;;;I"*Card::StageDirector#catch_up_to_stage;F;[[I"next_stage;T0;[[@yis;F;;;;;[;{;IC;" ;T;@{;.0;F;[;[; I";T;!0;'@y;(I"%def catch_up_to_stage next_stage;T;)T;*I"def catch_up_to_stage next_stage @stage ||= -1 (@stage + 1).upto(stage_index(next_stage)) do |i| run_single_stage stage_symbol(i) end end;T;+To; ; F; ;,;;;I")Card::StageDirector#call_after_store;F;[[I" &block;T0;[[@yiz;F;:call_after_store;;;[;{;IC;" ;T;@{;.0;F;[;[; I";T;!0;'@y;(I" def call_after_store &block;T;)T;*I"\def call_after_store &block @call_after_store ||= [] @call_after_store << block end;T;+To; ; F; ;,;;;I"!Card::StageDirector#need_act;F;[;[[@yi;F;: need_act;;;[;{;IC;" ;T;@{;.0;F;[;[; I";T;!0;'@y;(I"def need_act;T;)T;*I"def need_act act_director = main_director unless act_director raise Card::Error, 'act requested without a main stage director' end act_director.act ||= Card::Act.create(ip_address: Env.ip) @card.current_act = @act = act_director.act end;T;+To; ; F; ;,;;;I"&Card::StageDirector#main_director;F;[;[[@yi;F;:main_director;;;[;{;IC;" ;T;@+{;.0;F;[;[; I";T;!0;'@y;(I"def main_director;T;)T;*I"~def main_director if main? self else DirectorRegister.act_director || (@parent && @parent.main_director) end end;T;+To; ; F; ;,;;;I"Card::StageDirector#to_s;F;[;[[@yi;F;;;;;[;{;IC;" ;T;@8{;.0;F;[;[; I";T;!0;'@y;(I" def to_s;T;)T;*I"def to_s str = @card.name.to_s.clone if @subdirectors subs = subdirectors.map(&:card) .map { |card| " #{card.name}" }.join "\n" str << "\n#{subs}" end str end;T;+To; ; F; ;,;;;I")Card::StageDirector#run_single_stage;F;[[I" stage;T0[I" &block;T0;[[@yi;F;:run_single_stage;;;[;{;IC;" ;T;@E{;.0;F;[;[; I";T;!0;'@y;(I"'def run_single_stage stage, &block;T;)T;*I"def run_single_stage stage, &block # puts "#{@card.name}: #{stage} stage".red @stage = stage_index stage return if @card.errors.any? && @stage <= stage_index(:validate) if stage == :initialize @running ||= true prepare_for_phases end # in the store stage it can be necessary that # other subcards must be saved before we save this card if stage == :store store(&block) else run_stage_callbacks stage run_subdirector_stages stage unless stage == :finalize end rescue => e @card.rescue_event e end;T;+To; ; F; ;,;;;I",Card::StageDirector#run_stage_callbacks;F;[[I" stage;T0;[[@yi;F;:run_stage_callbacks;;;[;{;IC;" ;T;@V{;.0;F;[;[; I";T;!0;'@y;(I""def run_stage_callbacks stage;T;)T;*I"def run_stage_callbacks stage # we use abort :success in the :store stage for :save_draft if stage_index(stage) <= stage_index(:store) && !main? @card.abortable do @card.run_callbacks :"#{stage}_stage" end else @card.run_callbacks :"#{stage}_stage" end end;T;+To; ; F; ;,;;;I"/Card::StageDirector#run_subdirector_stages;F;[[I" stage;T0;[[@yi;F;:run_subdirector_stages;;;[;{;IC;" ;T;@e{;.0;F;[;[; I";T;!0;'@y;(I"%def run_subdirector_stages stage;T;)T;*I"def run_subdirector_stages stage @subdirectors.each do |subdir| subdir.catch_up_to_stage stage end ensure @card.handle_subcard_errors end;T;+To; ; F; ;,;;;I"Card::StageDirector#store;F;[[I"&save_block;T0;[[@yi;T;; ;;;[;{;IC;"xhandle the store stage The tricky part here is to preserve the dirty marks on the subcards' attributes for the finalize stage. To achieve this we can't just call the :store and :finlaize callbacks on the subcards as we do in the other phases. Instead we have to call `save` on the subcards and use the ActiveRecord :around_save callback to run the :store and :finalize stages ;T;@t{;F;[;[; I"xhandle the store stage The tricky part here is to preserve the dirty marks on the subcards' attributes for the finalize stage. To achieve this we can't just call the :store and :finlaize callbacks on the subcards as we do in the other phases. Instead we have to call `save` on the subcards and use the ActiveRecord :around_save callback to run the :store and :finalize stages;T;!0;"o;#;$F;%i;&i;'@y;(I"def store &save_block;T;)T;*I"Udef store &save_block if main? && !block_given? raise Card::Error, 'need block to store main card' end # the block is the ActiveRecord block from the around save callback that # saves the card if block_given? run_stage_callbacks :store store_with_subcards(&save_block) else store_and_finalize_as_subcard end end;T;+To; ; F; ;,;;;I",Card::StageDirector#store_with_subcards;F;[;[[@yi;F;:store_with_subcards;;;[;{;IC;" ;T;@{;.0;F;[;[; I";T;!0;'@y;(I"def store_with_subcards;T;)T;*I"def store_with_subcards store_prior_subcards yield if @call_after_store @call_after_store.each do |handle_id| handle_id.call(@card.id) end end store_subcards @virtual = false # TODO: find a better place for this ensure @card.handle_subcard_errors end;T;+To; ; F; ;,;;;I"-Card::StageDirector#store_prior_subcards;F;[;[[@yi;T;:store_prior_subcards;;;[;{;IC;"3store subcards whose ids we need for this card ;T;@{;F;[;[; I"3store subcards whose ids we need for this card;T;!0;"o;#;$F;%i;&i;'@y;(I"def store_prior_subcards;T;)T;*I"def store_prior_subcards @subdirectors.each do |subdir| next unless subdir.prior_store subdir.catch_up_to_stage :store end end;T;+To; ; F; ;,;;;I"'Card::StageDirector#store_subcards;F;[;[[@yi;F;:store_subcards;;;[;{;IC;" ;T;@{;.0;F;[;[; I";T;!0;'@y;(I"def store_subcards;T;)T;*I"def store_subcards @subdirectors.each do |subdir| next if subdir.prior_store subdir.catch_up_to_stage :store end end;T;+To; ; F; ;,;;;I"6Card::StageDirector#store_and_finalize_as_subcard;F;[;[[@yi;T;:"store_and_finalize_as_subcard;;;[;{;IC;"trigger the storage_phase, skip the other phases At this point the :prepare_to_store stage was already executed by the parent director. So the storage phase will only run the :store stage and the :finalize stage ;T;@{;F;[;[; I"trigger the storage_phase, skip the other phases At this point the :prepare_to_store stage was already executed by the parent director. So the storage phase will only run the :store stage and the :finalize stage;T;!0;"o;#;$F;%i;&i;'@y;(I"&def store_and_finalize_as_subcard;T;)T;*I"cdef store_and_finalize_as_subcard @card.skip_phases = true @card.save! validate: false end;T;+T;I@y;JIC;[;I@y;KIC;[o;S ;T0;U0;V0;;;'@;W@cv;X;Y;I@y;LIC;M{; IC;M{;NT;,IC;M{ ;IC;M{;C@y;D@y;NT;IC;M{;C@y;D@y;NT;IC;M{;C@y;D@y;NT;IC;M{;C@y;D@y;NT;IC;M{;C@z;D@z;NT;IC;M{;C@"z;D@/z;NT;IC;M{;C@Bz;D@Oz;NT;IC;M{;C@bz;D0;NT;NT;NT;O{@oz;@{z;;P[;[[@yi&;T;:StageDirector;;;;;[;{;IC;"8A 'StageDirector' executes the stages of a card when the card gets created, updated or deleted. For subcards, i.e. other cards that are changed in the same act, a StageDirector has StageSubdirectors that take care of the stages for those cards In general a stage is executed for all involved cards before the StageDirector proceeds with the next stage. Only exception is the finalize stage. The finalize stage of a subcard is executed immediately after its store stage. When all subcards are finalized the supercard's finalize stage is executed. If a subcard is added in a stage then it catches up at the end of the stage to the current stage. For example if you add a subcard in a card's :prepare_to_store stage then after that stage the stages :initialize, :prepare_to_validate, :validate and :prepare_to_store are executed for the subcard. Stages are executed with pre-order depth-first search. That means if A has subcards AA and AB; AAA is subcard of AA and ABA subcard of AB then the order of execution is A -> AA -> AAA -> AB -> ABA A special case can happen in the store phase. If the id of a subcard is needed for a supercard (for example as left_id or as type_id) and the subcard doesn't have an id yet (because it gets created in the same act) then the subcard's store stage is executed before the supercard's store stage ;T;@y;F;[;[; I"8A 'StageDirector' executes the stages of a card when the card gets created, updated or deleted. For subcards, i.e. other cards that are changed in the same act, a StageDirector has StageSubdirectors that take care of the stages for those cards In general a stage is executed for all involved cards before the StageDirector proceeds with the next stage. Only exception is the finalize stage. The finalize stage of a subcard is executed immediately after its store stage. When all subcards are finalized the supercard's finalize stage is executed. If a subcard is added in a stage then it catches up at the end of the stage to the current stage. For example if you add a subcard in a card's :prepare_to_store stage then after that stage the stages :initialize, :prepare_to_validate, :validate and :prepare_to_store are executed for the subcard. Stages are executed with pre-order depth-first search. That means if A has subcards AA and AB; AAA is subcard of AA and ABA subcard of AB then the order of execution is A -> AA -> AAA -> AB -> ABA A special case can happen in the store phase. If the id of a subcard is needed for a supercard (for example as left_id or as type_id) and the subcard doesn't have an id yet (because it gets created in the same act) then the subcard's store stage is executed before the supercard's store stage;T;!0;"o;#;$F;%i;&i%;'@;I"Card::Cache::Tempor;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+To; ;IC;[o; ; F; ;,;;;I"&Card::StageSubdirector#initialize;F;[[I" card;T0[I" opts;TI"{};T;[[@yi;F;;C;;;[;{;IC;" ;T;@{;.0;F;[;[o;0 ;1I" return;F;2I"'a new instance of StageSubdirector;T;0;3[I"StageSubdirector;F;@{; I";T;!0;'@{;(I"!def initialize card, opts={};T;)T;*I"?def initialize card, opts={} super card, opts, false end;T;+To; ; F; ;,;;;I""Card::StageSubdirector#delete;F;[;[[@yi;F;;;;;[;{;IC;" ;T;@{;.0;F;[;[; I";T;!0;'@{;(I"def delete;T;)T;*I"Idef delete @parent.subdirectors.delete self if @parent super end;T;+T;I@{;JIC;[;I@{;KIC;[;I@{;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@yi;F;:StageSubdirector;;;;;[;{;IC;" ;T;@{;.0;F;[;[; I";T;!0;'@;I"EPۻI־;F;Io;S ;T0;U0;V0;;;'@;W@y;X0;+To; ;IC;[ o; ; F; ; ;;;I"4Card::SubdirectorArray.initialize_with_subcards;F;[[I" parent;T0;[[I""lib/card/subdirector_array.rb;Ti;F;:initialize_with_subcards;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@ |;(I"-def self.initialize_with_subcards parent;T;)T;*I"def self.initialize_with_subcards parent dir_array = new(parent) parent.card.subcards.each_card do |subcard| dir_array.add subcard end dir_array end;T;+To; ; F; ;,;;;I"&Card::SubdirectorArray#initialize;F;[[I" parent;T0;[[@|i;F;;C;;;[;{;IC;" ;T;@|;.0;F;[;[o;0 ;1I" return;F;2I"'a new instance of SubdirectorArray;T;0;3[I"SubdirectorArray;F;@|; I";T;!0;'@ |;(I"def initialize parent;T;)T;*I";def initialize parent @parent = parent super() end;T;+To; ; F; ;,;;;I"Card::SubdirectorArray#add;F;[[I" card;T0;[[@|i;F;;X;;;[;{;IC;" ;T;@2|;.0;F;[;[; I";T;!0;'@ |;(I"def add card;T;)T;*I"def add card if card.is_a? Card::StageDirector card = card.card end each do |dir| return dir if dir.card == card end dir = Card::DirectorRegister.fetch card, parent: @parent dir.main = false dir.parent = @parent self << dir dir end;T;+To; ; F; ;,;;;I"+Card::SubdirectorArray#delete_director;F;[;[[@|i#;F;:delete_director;;;[;{;IC;" ;T;@A|;.0;F;[;[; I";T;!0;'@ |;(I"def delete_director;T;*I"+alias_method :delete_director, :delete;T;+To; ; F; ;,;;;I""Card::SubdirectorArray#delete;F;[[I" card;T0;[[@|i%;F;;;;;[;{;IC;" ;T;@N|;.0;F;[;[; I";T;!0;'@ |;(I"def delete card;T;)T;*I"def delete card if card.is_a? Card::StageDirector delete_director card else delete_if { |dir| dir.card == card } end end;T;+To; ; F; ;,;;;I"(Card::SubdirectorArray#add_director;F;[[I"dir;T0;[[@|i-;F;:add_director;;;[;{;IC;" ;T;@]|;.0;F;[;[; I";T;!0;'@ |;(I"def add_director dir;T;)T;*I",def add_director dir add dir.card end;T;+T;I@ |;JIC;[;I@ |;KIC;[;I@ |;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@|i;F;:SubdirectorArray;;;;;[;{;IC;" ;T;@ |;.0;F;[;[; I";T;!0;'@;I"Cl;F;Io;S ;T0;U0;V0;: Array;'@;Wo; ;IC;[o; ; F; ;,;;;I"Array#to_pointer_content;F;[;[[I"lib/card/core_ext.rb;TiL;F;:to_pointer_content;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@}|;(I"def to_pointer_content;T;)T;*I"Qdef to_pointer_content map do |item| "[[#{item}]]" end.join "\n" end;T;+T;I@}|;JIC;[;I@}|;KIC;[;I@}|;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@|iK;F;;;;;;;[;{;IC;" ;T;@}|;.0;F;[;[; I";T;!0;'@;I" Array;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;X0;+To; ; F; ;,;;;I" M;F;[[I" opts;TI"{};T;[[I""lib/card/director_register.rb;Ti;F;;;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@;(I"def act opts={};T;)T;*I"gdef act opts={} if !DirectorRegister.act_card DirectorRegister.clear self.director = nil DirectorRegister.act_card = self main_act_block = true if opts[:success] Env[:success] = Success.new(cardname, Env.params[:success]) end else main_act_block = false end yield ensure DirectorRegister.clear if main_act_block end;T;+To; ; F; ; ;;;I"$ M;F;[[I" card;T0[I" opts;TI"{};T;[[@|i;F;:new_director;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@;(I"(def self.new_director card, opts={};T;)T;*I"Jdef self.new_director card, opts={} if opts[:parent] StageSubdirector.new card, opts elsif DirectorRegister.act_card && DirectorRegister.act_card != card && DirectorRegister.act_card.director.running? DirectorRegister.act_card.director.subdirectors.add(card) else StageDirector.new card end end;T;+To; ;IC;[ o; ; F; ; ;;;I"(Card::DirectorRegister.act_director;F;[;[[@|i(;F;:act_director;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@|;(I"def act_director;T;)T;*I"hdef act_director return unless DirectorRegister.act_card DirectorRegister.act_card.director end;T;+To; ; F; ; ;;;I"%Card::DirectorRegister.directors;F;[;[[@|i-;F;:directors;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@|;(I"def directors;T;)T;*I"*def directors @directors ||= {} end;T;+To; ; F; ; ;;;I"!Card::DirectorRegister.clear;F;[;[[@|i1;F;;;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@|;(I"def clear;T;)T;*I"def clear DirectorRegister.act_card = nil directors.each_pair do |card, _dir| card.director = nil end @directors = nil end;T;+To; ; F; ; ;;;I"!Card::DirectorRegister.fetch;F;[[I" card;T0[I" opts;TI"{};T;[[@|i9;F;;;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@|;(I"def fetch card, opts={};T;)T;*I"Sdef fetch card, opts={} directors[card] ||= Card.new_director card, opts end;T;+To; ; F; ; ;;;I"Card::DirectorRegister.add;F;[[I" director;T0;[[@|i=;F;;X;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@|;(I"def add director;T;)T;*I"?def add director directors[director.card] = director end;T;+To; ; F; ; ;;;I""Card::DirectorRegister.delete;F;[[I" director;T0;[[@|iA;F;;;;;[;{;IC;" ;T;@ };.0;F;[;[; I";T;!0;'@|;(I"def delete director;T;)T;*I"kdef delete director return unless @directors @directors.delete director.card director.delete end;T;+To; ; F; ; ;;;I"'Card::DirectorRegister.deep_delete;F;[[I" director;T0;[[@|iG;F;:deep_delete;;;[;{;IC;" ;T;@};.0;F;[;[; I";T;!0;'@|;(I"def deep_delete director;T;)T;*I"ydef deep_delete director director.subdirectors.each do |subdir| deep_delete subdir end delete director end;T;+To; ; F; ; ;;;I" Card::DirectorRegister.to_s;F;[;[[@|iN;F;;;;;[;{;IC;" ;T;@)};.0;F;[;[; I";T;!0;'@|;(I" def to_s;T;)T;*I":def to_s directors.values.map(&:to_s).join "\n" end;T;+T;I@|;JIC;[;I@|;KIC;[;I@|;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@|i$;F;:DirectorRegister;;;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@;I"~2a9^;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+T@Z;I@;JIC;[o;S ;T0;UI"CarrierWave::Mount;T;V@;: Mount;'o;S ;T0;U0;V0;:CarrierWave;'@;Wo;7;IC;[o;7;IC;[o; ; F; ;,;;;I"%CarrierWave::CardMount#uploaders;F;[;[[I"2mod/05_standard/lib/carrier_wave/cardmount.rb;Ti [I"2mod/05_standard/lib/carrier_wave/cardmount.rb;Ti ;F;:uploaders;;;[;{;IC;" ;T;@O};.0;F;[;[; I";T;!0;'@M};(I"def uploaders;T;)T;*I".def uploaders Card.uploaders ||= {} end;T;+To; ; F; ;,;;;I",CarrierWave::CardMount#uploader_options;F;[;[[@T}i[@V}i;F;:uploader_options;;;[;{;IC;" ;T;@_};.0;F;[;[; I";T;!0;'@M};(I"def uploader_options;T;)T;*I"i [@Ci[@Ei[@Ii[@ Ki [@2Li[@Si [@ Ti[@$Vi [@Yi [@bSi[@\i [@5^i[@Xii[@sji [@^ki[@#li[@<`i[@ai[@fpi[@di[@,qi[@si[@$i([@3i [@Q2i [@ji [@&i[@ji [@ki [@i[@i[@ui[@i[@0i[@i[@Z i[@ i[@ i[@v i[@ i[@ i[@ei[@i[@vi[@-2i[@i[@!i[@Si[@3i[@&i[@'i[@3i[@'i[@4i[@4i[@5i[@C5i[@Z5i[@o5i[@5i[@)i[@i[@Li[@ri[@)iy[@#!i[@)i[@5i[@#*i[@+i[@i[@ci[@ti[@i[@+i[@i[@i[@_!i[@t!i[@#i[@i[@i[@5i[@g*i[@5i[@6i[@:i[@?i[@A6i[@|i[@X6i[@i[@i[@o6i[@i[@i[@+i[@#i[@+i[@<$i[@i[@6i[@$i[@&i[@,i[@6i[@6i[@6i[@i[@i[@/,i[@6i[@6i[@7i[@7i[@i[@27i[@&i[@.i[@.i[@Z,i[@/i[@/i[@,i[@,i[@%/i[@S/i[@I7i[@`7i[@w7i[@j/i[@7i[@,i[@/i[@i[@/i[@7i[@8i[@Mi[@7i[@0i[@bi[@7i[@7i[@8i[@0i[@0i[@8i[@1i[@*i[@+8i[@]-i[@31i[@D1i[@-i[@@8i[@ )i[@W8i[@-i[@l8i[@8i[@yi[@%.i[@i[@Gi[@8i[@8i[@r1i[@i[@8i[@8i[@r.i[@1i[@!i[@#i[@8i[@i[@9i[@ i[@a i[@1i[@9i[@i[@:9i[@% i[@i[@i[@9i[@ i[@!i[@9i[@1i[@9i[@: i[@9i[@9;i[@9i[@ :i[@":i[@7:i[@Ofi[@!i[@Xi[@l@i[@hvi[@Si [@ wi[I"lib/card/diff/lcs.rb;Ti[@;F;:set_config;;;[;{;IC;" ;T;@~;.0;F;[;[; I";T;!0;'@~;(I"def set_config(config);T;)T;*I",def set_config config @@config, @@root = config, config.root config.autoload_paths += Dir["#{gem_root}/mod/*/lib/**/"] config.autoload_paths += Dir["#{gem_root}/lib/**/"] config.autoload_paths += Dir["#{root}/mod/*/lib/**/"] set_default_value config, :read_only, !!ENV['WAGN_READ_ONLY'] set_default_value config, :allow_inline_styles, false set_default_value config, :recaptcha_public_key, nil set_default_value config, :recaptcha_private_key, nil set_default_value config, :recaptcha_proxy, nil set_default_value config, :cache_store, :file_store, 'tmp/cache' set_default_value config, :override_host, nil set_default_value config, :override_protocol, nil set_default_value config, :no_authentication, false set_default_value config, :files_web_path, 'files' set_default_value config, :max_char_count, 200 set_default_value config, :max_depth, 20 set_default_value config, :email_defaults, nil set_default_value config, :token_expiry, 2.days set_default_value config, :revisions_per_page, 10 set_default_value config, :space_last_in_multispace, true set_default_value config, :closed_search_limit, 50 set_default_value config, :view_cache, false end;T;+To; ; F; ; ;;;I"Cardio.set_default_value;F;[[I" config;T0[I" setting;T0[I" *value;T0;[[@~iB[@~iR;T;:set_default_value;;;[;{;IC;"In production mode set_config gets called twice. The second call overrides all deck config settings so don't change settings here if they already exist ;T;@~;F;[;[; I"In production mode set_config gets called twice. The second call overrides all deck config settings so don't change settings here if they already exist;T;!0;"o;#;$F;%iO;&iQ;'@~;(I"3def set_default_value(config, setting, *value);T;)T;*I"}def set_default_value config, setting, *value config.send("#{setting}=", *value) unless config.respond_to? setting end;T;+To; ; F; ; ;;;I"Cardio.set_paths;F;[[I" paths;T0;[[@~iG[@~iV;F;:set_paths;;;[;{;IC;" ;T;@~;.0;F;[;[; I";T;!0;'@~;(I"def set_paths(paths);T;)T;*I"zdef set_paths paths @@paths = paths add_path 'tmp/set', root: root add_path 'tmp/set_pattern', root: root add_path 'mod' add_path "db" add_path 'db/migrate' add_path "db/migrate_core_cards" add_path "db/migrate_deck_cards", root: root, with: 'db/migrate_cards' add_path "db/seeds", with: "db/seeds.rb" add_path 'config/initializers', glob: '**/*.rb' end;T;+To; ; F; ; ;;;I"Cardio.set_mod_paths;F;[;[[@~iY[@~ig;F;:set_mod_paths;;;[;{;IC;" ;T;@~;.0;F;[;[; I";T;!0;'@~;(I"def set_mod_paths;T;)T;*I"def set_mod_paths each_mod_path do |mod_path| Dir.glob( "#{mod_path}/*/initializers" ).each do |initializers_dir| paths['config/initializers'] << initializers_dir end end end;T;+To; ; F; ; ;;;I"Cardio.each_mod_path;F;[;[[@~ia[@~iq;F;:each_mod_path;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@~;(I"def each_mod_path;T;)T;*I"Udef each_mod_path paths['mod'].each do |mod_path| yield mod_path end end;T;+To; ; F; ; ;;;I"Cardio.root;F;[;[[@~ig[@~iw;F;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@~;(I" def root;T;)T;*I"!def root @@config.root end;T;+To; ; F; ; ;;;I"Cardio.gem_root;F;[;[[@~ik[@~i{;F;: gem_root;;;[;{;IC;" ;T;@$;.0;F;[;[; I";T;!0;'@~;(I"def gem_root;T;)T;*I"%def gem_root CARD_GEM_ROOT end;T;+To; ; F; ; ;;;I"Cardio.add_path;F;[[I" path;T0[I" options;TI"{};T;[[@~io[@~i;F;: add_path;;;[;{;IC;" ;T;@2;.0;F;[;[; I";T;!0;'@~;(I"#def add_path(path, options={});T;)T;*I"def add_path path, options={} root = options.delete(:root) || gem_root options[:with] = File.join(root, (options[:with] || path) ) paths.add path, options end;T;+To; ; F; ; ;;;I"Cardio.future_stamp;F;[;[[@~iu[@~i;F;:future_stamp;;;[;{;IC;" ;T;@E;.0;F;[;[; I";T;!0;'@~;(I"def future_stamp;T;)T;*I"_def future_stamp ## used in test data @@future_stamp ||= Time.local 2020,1,1,0,0,0 end;T;+To; ; F; ; ;;;I"Cardio.migration_paths;F;[[I" type;T0;[[@~iz[@~i;F;;V;;;[;{;IC;" ;T;@S;.0;F;[;[; I";T;!0;'@~;(I"def migration_paths(type);T;)T;*I"def migration_paths type list = paths["db/migrate#{schema_suffix type}"].to_a if type == :deck_cards list += Card::Loader.mod_dirs.map do |p| Dir.glob "#{p}/db/migrate_cards" end.flatten end list end;T;+To; ; F; ; ;;;I"(Cardio.assume_migrated_upto_version;F;[[I" type;T0;[[@~i[@~i;F;;Z;;;[;{;IC;" ;T;@c;.0;F;[;[; I";T;!0;'@~;(I"+def assume_migrated_upto_version(type);T;)T;*I"def assume_migrated_upto_version type Cardio.schema_mode(type) do ActiveRecord::Schema.assume_migrated_upto_version Cardio.schema(type), Cardio.migration_paths(type) end end;T;+To; ; F; ; ;;;I"Cardio.schema_suffix;F;[[I" type;T0;[[@~i[@~i;F;;X;;;[;{;IC;" ;T;@s;.0;F;[;[; I";T;!0;'@~;(I"def schema_suffix(type);T;)T;*I"def schema_suffix type case type when :core_cards then '_core_cards' when :deck_cards then '_deck_cards' else '' end end;T;+To; ; F; ; ;;;I"Cardio.delete_tmp_files;F;[[I"id;TI"nil;T;[[@~i[@~i;F;:delete_tmp_files;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@~;(I"!def delete_tmp_files(id=nil);T;)T;*I"def delete_tmp_files id=nil dir = Cardio.paths['files'].existent.first + '/tmp' dir += "/#{id}" if id FileUtils.rm_rf dir, secure: true rescue Rails.logger.info "failed to remove tmp files" end;T;+To; ; F; ; ;;;I"Cardio.schema_mode;F;[[I" type;T0;[[@~i[@~i;F;;Y;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" yield;F;2I";T;0;3[I" paths;T;@; I";T;!0;'@~;(I"def schema_mode(type);T;)T;*I"Qdef schema_mode type new_suffix = Cardio.schema_suffix type original_suffix = ActiveRecord::Base.table_name_suffix ActiveRecord::Base.table_name_suffix = new_suffix ActiveRecord::SchemaMigration.reset_table_name yield ActiveRecord::Base.table_name_suffix = original_suffix ActiveRecord::SchemaMigration.reset_table_name end;T;+To; ; F; ; ;;;I"Cardio.schema;F;[[I" type;TI"nil;T;[[@~i[@~i;F;;W;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@~;(I"def schema(type=nil);T;)T;*I"Hdef schema type=nil File.read( schema_stamp_path type ).strip end;T;+To; ; F; ; ;;;I"Cardio.schema_stamp_path;F;[[I" type;T0;[[@~i[@~i;F;:schema_stamp_path;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@~;(I" def schema_stamp_path(type);T;)T;*I"def schema_stamp_path type root_dir = ( type == :deck_cards ? root : gem_root ) stamp_dir = ENV['SCHEMA_STAMP_PATH'] || File.join( root_dir, 'db' ) File.join stamp_dir, "version#{ schema_suffix(type) }.txt" end;T;+To; ; F; ; ;;;I" IPI;F;[;[[@~i;F;:default_configs;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@~;(I"def default_configs;T;)T;*I"/def default_configs { read_only: read_only?, allow_inline_styles: false, recaptcha_public_key: nil, recaptcha_private_key: nil, recaptcha_proxy: nil, override_host: nil, override_protocol: nil, no_authentication: false, files_web_path: 'files', max_char_count: 200, max_depth: 20, email_defaults: nil, token_expiry: 2.days, acts_per_page: 10, space_last_in_multispace: true, closed_search_limit: 50, non_createable_types: [%w( signup setting set )], view_cache: false, encoding: 'utf-8', request_logger: false, performance_logger: false, sql_comments: true } end;T;+To; ; F; ; ;;;I"$ M;F;[;[[@~iK;F;:read_only?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@~;(I"def read_only?;T;)T;*I"5def read_only? !ENV['WAGN_READ_ONLY'].nil? end;T;+To; ; F; ; ;;;I";F;[[I"dir;T0;[[@~ik;F;:add_initializers;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@~;(I"def add_initializers dir;T;)T;*I"def add_initializers dir Dir.glob("#{dir}/config/initializers").each do |initializers_dir| paths['config/initializers'] << initializers_dir end end;T;+T;I@~;JIC;[;I@~;KIC;[;I@~;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@~i [@~i ;F;: Cardio;;;;;[;{;IC;" ;T;@~;.0;F;[;[; I";T;!0;'@;I" Cardio;F@o; ;IC;[o;4;[[@i1[@|i/;F;:RUBY_VERSION_18;;;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@ ;I"Module::RUBY_VERSION_18;F;(I"2RUBY_VERSION_18 = !!(RUBY_VERSION =~ /^1\.8/);T;*I"2RUBY_VERSION_18 = !!(RUBY_VERSION =~ /^1\.8/);T;6I" !!(RUBY_VERSION =~ /^1\.8/);T;+To; ; F; ;,;;;I" Module#const_get_if_defined;F;[[I" const;T0;[[@i3[@|i1;F;:const_get_if_defined;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@ ;(I"$def const_get_if_defined(const);T;)T;*I"def const_get_if_defined const args = RUBY_VERSION_18 ? [ const ] : [ const, false ] if const_defined? *args const_get *args end end;T;+To; ; F; ;,;;;I"Module#const_get_or_set;F;[[I" const;T0;[[@i:[@|i6;F;:const_get_or_set;;;[;{;IC;" ;T;@);.0;F;[;[; I";T;!0;'@ ;(I" def const_get_or_set(const);T;)T;*I"Zdef const_get_or_set const const_get_if_defined const or const_set const, yield end;T;+T;I@ ;JIC;[;I@ ;KIC;[;I@ ;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i0[@|i.;F;: Module;;;;;[;{;IC;" ;T;@ ;.0;F;[;[; I";T;!0;'@;I" Module;F;Io;S ;T0;U0;V0;;J;'@;W@;X0o; ;IC;[o; ; F; ; ;;;I"&Hash.new_from_semicolon_attr_list;F;[[I"attr_string;T0;[[@iD[@|i>;F;:!new_from_semicolon_attr_list;;;[;{;IC;" ;T;@M;.0;F;[;[; I";T;!0;'@K;(I"2def new_from_semicolon_attr_list(attr_string);T;)T;*I"def new_from_semicolon_attr_list(attr_string) return {} if attr_string.blank? attr_string.strip.split(';').inject({}) do |result, pair| value, key = pair.split(':').reverse key ||= 'view' key.strip!; value.strip! result[key.to_sym] = value result end end;T;+T;I@K;JIC;[;I@K;KIC;[;I@K;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@iA[@|i;;F;: Hash;;;;;[;{;IC;" ;T;@K;.0;F;[;[; I";T;!0;'@;I" Hash;F;Io;S ;T0;U0;V0;;J;'@;W@;X0o;7;IC;[;I@o;JIC;[;I@o;KIC;[;I@o;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@oi;F;;l;;;;;[;{;IC;" ;T;@o;.0;F;[;[; I";T;!0;'@;I"SpecHelper;Fo;4;[[I" spec/lib/card/query_spec.rb;Ti;F;:A_JOINEES;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"A_JOINEES;F;(I"'A_JOINEES = %w( B C D E F ).freeze;T;*I"'A_JOINEES = %w( B C D E F ).freeze;T;6I"%w( B C D E F ).freeze;To;4;[[@i [I" spec/lib/card/query_spec.rb;Ti ;F;:CARDS_MATCHING_TWO;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"CARDS_MATCHING_TWO;F;(I"PCARDS_MATCHING_TWO = ['Joe User', 'One+Two', 'One+Two+Three', 'Two'].freeze;T;*I"PCARDS_MATCHING_TWO = ['Joe User', 'One+Two', 'One+Two+Three', 'Two'].freeze;T;6I";['Joe User', 'One+Two', 'One+Two+Three', 'Two'].freeze;To; ; F; ;,;;;I"#is_in_mod?;T;[[I" file;T0[I" mod_path;T0;[[I"!lib/card/simplecov_helper.rb;Ti;F;:is_in_mod?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"#def is_in_mod?(file, mod_path);T;)T;*I"def is_in_mod? file,mod_path mod_msg = "below pulled from #{Rails.root}/mod/#{mod_path}/" file.src.join("") =~ /#{mod_msg}/ end;To; ; F; ;,;;;I"#card_simplecov_filters;T;[;[[@i [I"!lib/card/simplecov_helper.rb;Ti ;F;:card_simplecov_filters;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def card_simplecov_filters;T;)T;*I"def card_simplecov_filters add_filter 'spec/' add_filter '/config/' add_filter '/tasks/' # filter all card mods add_filter do |src_file| src_file.filename =~ /tmp\// and not /\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/**/#{m[1].gsub("-","/")}"].present? } end # add group for each deck mod Dir['mod/*'].map{ |path| path.sub('mod/','') }.each do |mod| add_group mod.capitalize do |src_file| src_file.filename =~ /mod\/#{mod}\// or ( src_file.filename =~ /tmp\// and /\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/#{mod}/**/#{m[1].gsub("-","/")}"].present? } and is_in_mod? src_file,mod ) end end add_group 'Sets' do |src_file| src_file.filename =~ /tmp\/set\// and /\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/**/#{m[1]}"].present? } end add_group 'Set patterns' do |src_file| src_file.filename =~ /tmp\/set_pattern\// and /\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/**/#{m[1]}"].present? } end add_group 'Formats' do |src_file| src_file.filename =~ /mod\/[^\/]+\/formats/ end add_group 'Chunks' do |src_file| src_file.filename =~ /mod\/[^\/]+\/chunks/ end end;To; ; F; ;,;;;I"%#card_core_dev_simplecov_filters;T;[;[[@i1[@i5;F;:$card_core_dev_simplecov_filters;;;[;{;IC;" ;T;@Ā;.0;F;[;[; I";T;!0;'@;(I"(def card_core_dev_simplecov_filters;T;)T;*I"def card_core_dev_simplecov_filters filters.clear # This will remove the :root_filter that comes via simplecov's defaults add_filter do |src| !(src.filename =~ /^#{SimpleCov.root}/) unless src.filename =~ /card/ end add_filter '/spec/' add_filter '/features/' add_filter '/config/' add_filter '/tasks/' add_filter '/generators/' add_filter 'lib/card' add_group 'Card', 'lib/card' add_group 'Set Patterns', 'tmp/set_pattern/' add_group 'Sets', 'tmp/set/' add_group 'Formats' do |src_file| src_file.filename =~ /mod\/[^\/]+\/format/ end add_group 'Chunks' do |src_file| src_file.filename =~ /mod\/[^\/]+\/chunk/ end end;T@z[o;4;[[I""spec/lib/card/content_spec.rb;Ti ;F;: EXAMPLES;;;;;[;{;IC;" ;T;@Ҁ;.0;F;[;[; I";T;!0;'@;I" EXAMPLES;F;(I"EXAMPLES = {;T;*I"EXAMPLES = { nests: { content: "Some Literals: \\[{I'm not| a link]}, and " \ '\\{{This Card|Is not Included}}' \ ', but ' \ '{{this is}}' \ ', and some tail', rendered: ["Some Literals: \\[{I'm not| a link]}, and ", '{{This Card|Is not Included}}', ', but ', { options: { inc_name: 'this is', inc_syntax: 'this is' } }, ', and some tail' ], classes: [String, :EscapedLiteral, String, :Include, String] }, links_and_nests: { content: 'Some Links and includes: [[the card|the text]], ' \ 'and {{This Card|Is Included}}{{this too}} ' \ 'and [[http://external.wagn.org/path|link text]]' \ '{{Included|open}}', rendered: ['Some Links and includes: ', '' \ 'the text', ', and ', { options: { view: 'Is Included', inc_name: 'This Card', inc_syntax: 'This Card|Is Included' } }, { options: { inc_name: 'this too', inc_syntax: 'this too' } }, ' and ', 'link text', { options: { view: 'open', inc_name: 'Included', inc_syntax: 'Included|open' } } ], classes: [ String, :Link, String, :Include, :Include, String, :Link, :Include ] }, uris_and_links: { content: 'Some URIs and Links: http://a.url.com/ ' \ 'More urls: wagn.com/a/path/to.html ' \ 'http://localhost:2020/path?cgi=foo&bar=baz ' \ '[[http://brain.org/Home|extra]] ' \ '[ http://gerry.wagn.com/a/path ] ' \ '{ https://brain.org/more?args } ', rendered: ['Some URIs and Links: ', 'http://a.url.com/', ' More urls: ', '' \ 'wagn.com/a/path/to.html', ' ', '' \ 'http://localhost:2020/path?cgi=foo&bar=baz', ' ', 'extra', ' [ ', '' \ 'http://gerry.wagn.com/a/path', ' ] { ', '' \ 'https://brain.org/more?args', ' } ' ], text_rendered: ['Some URIs and Links: ', 'http://a.url.com/', ' More urls: ', 'wagn.com/a/path/to.html[http://wagn.com/a/path/to.html]', ' ', 'http://localhost:2020/path?cgi=foo&bar=baz', ' ', 'extra[http://brain.org/Home]', ' [ ', 'http://gerry.wagn.com/a/path', ' ] { ', 'https://brain.org/more?args', ' } ' ], classes: [ String, :URI, String, :HostURI, String, :URI, String, :Link, String, :URI, String, :URI, String ] }, uris_and_links_2: { content: 'Some URIs and Links: http://a.url.com ' \ 'More urls: wagn.com/a/path/to.html ' \ '[ http://gerry.wagn.com/a/path ] ' \ '{ https://brain.org/more?args } ' \ 'http://localhost:2020/path?cgi=foo&bar=baz ' \ '[[http://brain.org/Home|extra]]', rendered: ['Some URIs and Links: ', 'http://a.url.com', ' More urls: ', '' \ 'wagn.com/a/path/to.html', ' [ ', '' \ 'http://gerry.wagn.com/a/path', ' ] { ', '' \ 'https://brain.org/more?args', ' } ', '' \ 'http://localhost:2020/path?cgi=foo&bar=baz', ' ', 'extra' ], classes: [ String, :URI, String, :HostURI, String, :URI, String, :URI, String, :URI, String, :Link ] }, no_chunks: { content: 'No chunks', rendered: 'No chunks' }, single_nest: { content: '{{one nest|size;large}}', classes: [:Include] }, css: { content: %( /* body text */ body { color: #444444; } /* page - background image and color */ body#wagn { background: #ffffff; } /* top bar background color; text colors */ #menu { background: #3260a0; } #menu a { color: #EEEEEE; } /* header text */ h1, h2 { color: #664444; } h1.page-header, h2.page-header { color: #222299; } ) } }.freeze;T;6I"{ nests: { content: "Some Literals: \\[{I'm not| a link]}, and " \ '\\{{This Card|Is not Included}}' \ ', but ' \ '{{this is}}' \ ', and some tail', rendered: ["Some Literals: \\[{I'm not| a link]}, and ", '{{This Card|Is not Included}}', ', but ', { options: { inc_name: 'this is', inc_syntax: 'this is' } }, ', and some tail' ], classes: [String, :EscapedLiteral, String, :Include, String] }, links_and_nests: { content: 'Some Links and includes: [[the card|the text]], ' \ 'and {{This Card|Is Included}}{{this too}} ' \ 'and [[http://external.wagn.org/path|link text]]' \ '{{Included|open}}', rendered: ['Some Links and includes: ', '' \ 'the text', ', and ', { options: { view: 'Is Included', inc_name: 'This Card', inc_syntax: 'This Card|Is Included' } }, { options: { inc_name: 'this too', inc_syntax: 'this too' } }, ' and ', 'link text', { options: { view: 'open', inc_name: 'Included', inc_syntax: 'Included|open' } } ], classes: [ String, :Link, String, :Include, :Include, String, :Link, :Include ] }, uris_and_links: { content: 'Some URIs and Links: http://a.url.com/ ' \ 'More urls: wagn.com/a/path/to.html ' \ 'http://localhost:2020/path?cgi=foo&bar=baz ' \ '[[http://brain.org/Home|extra]] ' \ '[ http://gerry.wagn.com/a/path ] ' \ '{ https://brain.org/more?args } ', rendered: ['Some URIs and Links: ', 'http://a.url.com/', ' More urls: ', '' \ 'wagn.com/a/path/to.html', ' ', '' \ 'http://localhost:2020/path?cgi=foo&bar=baz', ' ', 'extra', ' [ ', '' \ 'http://gerry.wagn.com/a/path', ' ] { ', '' \ 'https://brain.org/more?args', ' } ' ], text_rendered: ['Some URIs and Links: ', 'http://a.url.com/', ' More urls: ', 'wagn.com/a/path/to.html[http://wagn.com/a/path/to.html]', ' ', 'http://localhost:2020/path?cgi=foo&bar=baz', ' ', 'extra[http://brain.org/Home]', ' [ ', 'http://gerry.wagn.com/a/path', ' ] { ', 'https://brain.org/more?args', ' } ' ], classes: [ String, :URI, String, :HostURI, String, :URI, String, :Link, String, :URI, String, :URI, String ] }, uris_and_links_2: { content: 'Some URIs and Links: http://a.url.com ' \ 'More urls: wagn.com/a/path/to.html ' \ '[ http://gerry.wagn.com/a/path ] ' \ '{ https://brain.org/more?args } ' \ 'http://localhost:2020/path?cgi=foo&bar=baz ' \ '[[http://brain.org/Home|extra]]', rendered: ['Some URIs and Links: ', 'http://a.url.com', ' More urls: ', '' \ 'wagn.com/a/path/to.html', ' [ ', '' \ 'http://gerry.wagn.com/a/path', ' ] { ', '' \ 'https://brain.org/more?args', ' } ', '' \ 'http://localhost:2020/path?cgi=foo&bar=baz', ' ', 'extra' ], classes: [ String, :URI, String, :HostURI, String, :URI, String, :URI, String, :URI, String, :Link ] }, no_chunks: { content: 'No chunks', rendered: 'No chunks' }, single_nest: { content: '{{one nest|size;large}}', classes: [:Include] }, css: { content: %( /* body text */ body { color: #444444; } /* page - background image and color */ body#wagn { background: #ffffff; } /* top bar background color; text colors */ #menu { background: #3260a0; } #menu a { color: #EEEEEE; } /* header text */ h1, h2 { color: #664444; } h1.page-header, h2.page-header { color: #222299; } ) } }.freeze;To;7;IC;[o; ; F; ;,;;;I"&SetPatternSpecHelper#it_generates;F;[[I" opts;T0;[[I"&spec/lib/card/set_pattern_spec.rb;Ti ;F;:it_generates;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def it_generates(opts);T;)T;*I"def it_generates( opts ) name = opts[:name] card = opts[:from] it "generates name '#{name}' for card '#{card.name}'" do expect(described_class.new(card).to_s).to eq(name) end end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@i;F;:SetPatternSpecHelper;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"SetPatternSpecHelper;Fo; ;IC;[o; ; F; ;,;;;I"ImageUploader#path;F;[[I" version;TI"nil;T;[[I"*mod/05_standard/lib/image_uploader.rb;Ti ;F;: path;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def path(version=nil);T;)T;*I"edef path(version=nil) (version && version != :original) ? versions[version].path : super() end;T;+To; ; F; ;,;;;I"ImageUploader#identifier;F;[;[[I"*mod/05_standard/lib/image_uploader.rb;Ti+[@ i;T;:identifier;;;[;{;IC;"version :small_square, if: :create_versions?, from_version: :medium_square do process resize_to_fill: [75, 75] end version :medium_square, if: :create_versions? do process resize_to_fill: [200, 200] end In case we decide to support the squared versions we have to update all existing images with the following snippet: Card.search(type_id: Card::ImageID) do |card| card.image.cache_stored_file! card.image.recreate_versions! end ;T;@;F;[;[; I"version :small_square, if: :create_versions?, from_version: :medium_square do process resize_to_fill: [75, 75] end version :medium_square, if: :create_versions? do process resize_to_fill: [200, 200] end In case we decide to support the squared versions we have to update all existing images with the following snippet: Card.search(type_id: Card::ImageID) do |card| card.image.cache_stored_file! card.image.recreate_versions! end;T;!0;"o;#;$F;%i;&i);'@;(I"def identifier;T;)T;*I"0def identifier full_filename(super()) end;T;+To; ; F; ;,;;;I" ImageUploader#full_filename;F;[[I" for_file;T0;[[@ i [@i0;T;:full_filename;;;[;{;IC;"*add 'original' if no version is given ;T;@%;F;[;[; I"*add 'original' if no version is given;T;!0;"o;#;$F;%i/;&i/;'@;(I" def full_filename(for_file);T;)T;*I"def full_filename(for_file) name = super(for_file) if version_name name else parts = name.split '.' "#{parts.shift}-original.#{parts.join('.')}" end end;T;+T;I@;JIC;[;I@;KIC;[o;S ;T0;UI"CarrierWave::MiniMagick;T;V@;:MiniMagick;'o;S ;T0;U0;V0;;;'@;W@K};X0;W0;X;Y;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@ i;F;:ImageUploader;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I"ImageUploader;F;Io;S ;T0;U0;V0;:FileUploader;'@;Wo; ;IC;[o; ; F; ;,;;;I"FileUploader#mod;F;[;[[I")mod/05_standard/lib/file_uploader.rb;Ti1[I")mod/05_standard/lib/file_uploader.rb;Ti,;F;:mod;;;[;{;IC;"'Returns the value of attribute mod ;T;@L;.0;F;[;[; I"'Returns the value of attribute mod;T;!0;'@J;(I" def mod;T;*I"def mod @mod end;T;+To; ; F; ;,;;;I"FileUploader#mod=;F;[[I" value;T0;[[@Qi1[@Si,;F;: mod=;;;[;{;IC;"Sets the attribute mod ;T;@\;.0;F;[;[o;0 ;1I" param;F;2I"+the value to set the attribute mod to.;T;I" value;T;30;@\; I"OSets the attribute mod @param value the value to set the attribute mod to.;T;!0;'@J;(I"def mod=(value);T;*I"'def mod=(value) @mod = value end;T;+To; ; F; ;,;;;I"FileUploader#filename;F;[;[[@Qi6[@Si1;F;: filename;;;[;{;IC;" ;T;@p;.0;F;[;[; I";T;!0;'@J;(I"def filename;T;)T;*I"udef filename if mod_file? "#{model.type_code}#{extension}" else "#{action_id}#{extension}" end end;T;+To; ; F; ;,;;;I"FileUploader#extension;F;[;[[@Qi>[@Si9;F;:extension;;;[;{;IC;" ;T;@~;.0;F;[;[; I";T;!0;'@J;(I"def extension;T;)T;*I"def extension case when file && file.extension.present? ; ".#{file.extension}" when card_content = model.content ; File.extname(card_content) when orig = original_filename ; File.extname(orig) else '' end.downcase end;T;+To; ; F; ;,;;;I"FileUploader#db_content;F;[[I" opts;TI"{};T;[[@QiH[@SiC;T;:db_content;;;[;{;IC;"Hgenerate identifier that gets stored in the card's db_content field ;T;@;F;[;[; I"Hgenerate identifier that gets stored in the card's db_content field;T;!0;"o;#;$F;%iB;&iB;'@J;(I"def db_content(opts={});T;)T;*I"def db_content opts={} if opts[:mod] && !model.load_from_mod model.load_from_mod = opts[:mod] end "%s/%s" % [file_dir, url_filename(opts)] end;T;+To; ; F; ;,;;;I"FileUploader#url_filename;F;[[I" opts;TI"{};T;[[@QiO[@SiI;F;:url_filename;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@J;(I"def url_filename(opts={});T;)T;*I"def url_filename opts={} if opts[:mod] && !model.load_from_mod model.load_from_mod = opts[:mod] end basename = if (mod = mod_file?) "#{mod}#{extension}" else "#{action_id}#{extension}" end end;T;+To; ; F; ;,;;;I"FileUploader#url;F;[[I" opts;TI"{};T;[[@Qi[[@SiS;F;:url;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@J;(I"def url(opts={});T;)T;*I"~def url opts = {} "%s/%s/%s" % [card_path(Card.config.files_web_path), file_dir, full_filename(url_filename(opts))] end;T;+To; ; F; ;,;;;I"FileUploader#file_dir;F;[;[[@Qi_[@SiX;F;: file_dir;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@J;(I"def file_dir;T;)T;*I"def file_dir if mod_file? ":#{model.codename}" elsif model.id "~#{model.id}" else "~#{model.upload_cache_card.id}" end end;T;+To; ; F; ;,;;;I"FileUploader#cache_dir;F;[;[[@Qii[@Sib;F;:cache_dir;;;[;{;IC;" ;T;@΁;.0;F;[;[; I";T;!0;'@J;(I"def cache_dir;T;)T;*I"Hdef cache_dir Cardio.paths['files'].existent.first + '/cache' end;T;+To; ; F; ;,;;;I"FileUploader#store_path;F;[[I" for_file;TI"nil;T;[[@Qiq[@Sik;T;:store_path;;;[;{;IC;"Carrierwave calls store_path without argument when it stores the file and with the identifier from the db when it retrieves the file In our case the first part of our identifier is not part of the path but we can construct the filename from db data. So we don't need the identifier. ;T;@܁;F;[;[; I"Carrierwave calls store_path without argument when it stores the file and with the identifier from the db when it retrieves the file In our case the first part of our identifier is not part of the path but we can construct the filename from db data. So we don't need the identifier.;T;!0;"o;#;$F;%if;&ij;'@J;(I"!def store_path(for_file=nil);T;)T;*I"def store_path(for_file=nil) # if for_file retrieve_path else File.join([store_dir, full_filename(filename)].compact) end end;T;+To; ; F; ;,;;;I"FileUploader#retrieve_path;F;[;[[@Qiy[@Sis;F;:retrieve_path;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@J;(I"def retrieve_path;T;)T;*I"Wdef retrieve_path File.join([retrieve_dir, full_filename(filename)].compact) end;T;+To; ; F; ;,;;;I"FileUploader#tmp_path;F;[;[[@Qi}[@Siw;F;: tmp_path;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@J;(I"def tmp_path;T;)T;*I"def tmp_path if !Dir.exists? model.tmp_upload_dir Dir.mkdir model.tmp_upload_dir end File.join model.tmp_upload_dir, filename end;T;+To; ; F; ;,;;;I""FileUploader#create_versions?;F;[[I"_new_file;T0;[[@Qi[@Si|;F;;;;;[;{;IC;" ;T;@ ;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@ ; I";T;!0;'@J;(I"$def create_versions?(_new_file);T;)T;*I"?def create_versions? new_file model.create_versions? end;T;+To; ; F; ;,;;;I"FileUploader#path;F;[[I" version;TI"nil;T;[[@Qi[@Si|;T;;;;;[;{;IC;"Dpaperclip compatibility used in type/file.rb#core (base format) ;T;@;F;[;[; I"Dpaperclip compatibility used in type/file.rb#core (base format);T;!0;"o;#;$F;%i{;&i{;'@J;(I"def path(version=nil);T;)T;*I"Kdef path(version=nil) version ? versions[version].path : super() end;T;+To; ; F; ;,;;;I"#FileUploader#original_filename;F;[;[[@Qi[@Si;F;;;;;[;{;IC;" ;T;@1;.0;F;[;[; I";T;!0;'@J;(I"def original_filename;T;)T;*I"pdef original_filename @original_filename ||= (model.selected_action && model.selected_action.comment) end;T;+To; ; F; ;,;;;I"FileUploader#store_dir;F;[;[[@Qi[@Si;F;;;;;[;{;IC;" ;T;@?;.0;F;[;[; I";T;!0;'@J;(I"def store_dir;T;)T;*I"(def store_dir model.store_dir end;T;+To; ; F; ;,;;;I"FileUploader#retrieve_dir;F;[;[[@Qi[@Si;F;;&;;;[;{;IC;" ;T;@M;.0;F;[;[; I";T;!0;'@J;(I"def retrieve_dir;T;)T;*I".def retrieve_dir model.retrieve_dir end;T;+To; ; F; ;,;;;I"FileUploader#mod_file?;F;[;[[@Qi[@Si;F;;;;;[;{;IC;" ;T;@[;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@[; I";T;!0;'@J;(I"def mod_file?;T;)T;*I"1def mod_file? @mod ||= model.mod_file? end;T;+To; ; F; ;,;;;I"FileUploader#action_id;F;[;[[@Qi[@Si;F;:action_id;;;[;{;IC;" ;T;@n;.0;F;[;[; I";T;!0;'@J;(I"def action_id;T;)T;*I"9def action_id model.selected_content_action_id end;T;+T;I@J;JIC;[;I@J;KIC;[o;S ;T0;UI"Card::Location;T;V@J;;;'@;W@VS;X;Y;I@J;LIC;M{; IC;M{;NT;,IC;M{;IC;M{;C@L;D@\;NT;NT;NT;O{;P[;[[@Qi0[@Si+;F;;;;;;;[;{;IC;" ;T;@J;.0;F;[;[; I";T;!0;'@;I"FileUploader;F;Io;S ;T0;UI" CarrierWave::Uploader::Base;T;V@;;;'o;S ;T0;UI"CarrierWave::Uploader;T;V@;: Uploader;'o;S ;T0;U0;V0;;;'@;W@K};X0;W0;X0;W0;X; ;X0@K}o; ; F; ;,;;;I"#that_produces;T;[[I" type;T0;[[I"8mod/03_machines/spec/lib/shared_machine_examples.rb;Ti;F;:that_produces;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def that_produces(type);T;)T;*I"&def that_produces type type end;To; ; F; ;,;;;I"#method_missing;T;[[I"m;T0[I" *args;T0[I" &block;T0;[[@i ;F;;@;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I")def method_missing(m, *args, &block);T;)T;*I"vdef method_missing m, *args, &block case m when /that_produces_(.+)/ return $1 else super end end;T@J@}|;I@;JIC;[;I@;KIC;[o;S ;T0;U0;V0;;;'@;W@;X;Y;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[;F;;;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'0;I";T;d@:$Card.serializable_attr_accessor@ :Card#follower_stash@:Card#follower_stash=@*:Card::TRACKED_FIELDS@>;@~:Cardio::CARD_GEM_ROOT@~:Cardio.cache@~:Cardio.set_config@~:Cardio.set_default_value@~:Cardio.set_paths@~:Cardio.set_mod_paths@~:Cardio.each_mod_path@:Cardio.root@:Cardio.gem_root@$:Cardio.add_path@2:Cardio.future_stamp@E:Cardio.migration_paths@S:(Cardio.assume_migrated_upto_version@c:Cardio.schema_suffix@s:Cardio.delete_tmp_files@:Cardio.schema_mode@:Cardio.schema@:Cardio.schema_stamp_path@:Card::Env@L:Card::Env.reset@N:Card::Env.[]@a:Card::Env.[]=@p:Card::Env.params@|:Card::Env.session@:Card::Env.success@:Card::Env.ajax?@:Card::Env.html?@:Card::Env.method_missing@:Card::Env::LocationHistory@:0Card::Env::LocationHistory#location_history@:-Card::Env::LocationHistory#save_location@:1Card::Env::LocationHistory#previous_location@:5Card::Env::LocationHistory#discard_locations_for@:7Card::Env::LocationHistory#save_interrupted_action@:2Card::Env::LocationHistory#interrupted_action@/:4Card::Env::LocationHistory#url_key_for_location@=:Card::Set@:Card::Set::@@modules@:Card::Set::Format@:Card::Set::Format::@@views@:Card::Set::Format#view@:"Card::Set::Format#alias_block@:Card::Set#format@:Card::Set#define_on_format@:Card::Set#view@:Card::Set#event@:0Card::Set#define_event_perform_later_method@:"Card::Set#define_event_method@: Card::Set#define_active_job@:Card::Set#card_accessor@+:Card::Set#card_reader@;:Card::Set#card_writer@J:Card::Set#ensure_set@Y:Card::Set.extended@j:Card::Set.register_set@z:Card::Set.write_tmp_file@:#Card::Set.process_base_modules@:'Card::Set.process_base_module_list@:"Card::Set.clean_empty_modules@:+Card::Set.clean_empty_module_from_hash@:"Card::Set#register_set_format@:Card::Set#shortname@:Card::Set#abstract_set?@:Card::Set#all_set?@ :"Card::Set#set_event_callbacks@:Card::Set#get_traits@.:Card::Set#add_traits@=: Card::Set#define_trait_card@N:"Card::Set#define_trait_reader@_:"Card::Set#define_trait_writer@n:&Card::Set#set_specific_attributes@}:Card::Set#attachment@:Card::Name@>:Card::Name#star?@>:Card::Name#rstar?@>:Card::Name#trait_name?@>:Card::Name#trait_name@>:Card::Name#trait@?:Card::Name#code@?:Card::Name#is_a_field_of?@?:Card::Name#is_setting?@2?:Card::Name#is_set?@D?:Card::Diffo; ;IC;[ o; ; F; ;,;;;I" A;F;[;[[@l@i;F;;W;;;[;{;IC;"*Returns the value of attribute result ;T;@ʂ;.0;F;[;[; I"*Returns the value of attribute result;T;!0;'@Ȃ;(I"def result;T;*I"def result @result end;T;+To; ; F; ;,;;;I"0Ȓ’;F;[[I"old_version;T0[I"new_version;T0[I" opts;TI"{};T;[[@l@i(;T;;C;;;[;{;IC;";diff options :format => :html|:text|:pointer|:raw :html = maintain html structure, but compare only content :text = remove all html tags; compare plain text :pointer = remove all double square brackets :raw = escape html tags and compare everything summary: {length: , joint: } ;T;@ׂ;F;[;[o;0 ;1I" return;F;2I"a new instance of Diff;T;0;3[I" Diff;F;@ׂ; I";diff options :format => :html|:text|:pointer|:raw :html = maintain html structure, but compare only content :text = remove all html tags; compare plain text :pointer = remove all double square brackets :raw = escape html tags and compare everything summary: {length: , joint: };T;!0;"o;#;$F;%i;&i&;'@Ȃ;(I"5def initialize old_version, new_version, opts={};T;)T;*I"def initialize old_version, new_version, opts={} @result = Result.new opts[:summary] if new_version lcs_opts = lcs_opts_for_format opts[:format] LCS.new(lcs_opts).run(old_version, new_version, @result) end end;T;+To; ; F; ;,;;;I";F;[;[[@l@i0;F;;@;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@Ȃ;(I" def red?;T;)T;*I"(def red? @result.dels_cnt > 0 end;T;+To; ; F; ;,;;;I"44;F;[;[[@l@i4;F;;A;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@Ȃ;(I"def green?;T;)T;*I"*def green? @result.adds_cnt > 0 end;T;+To; ; F; ;,;;;I"#Card::Diff#lcs_opts_for_format;F;[[I" format;T0;[[@l@i:;F;;B;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@Ȃ;(I"#def lcs_opts_for_format format;T;)T;*I"~def lcs_opts_for_format format opts = {} case format when :html opts[:exclude] = /^') } when :pointer opts[:preprocess] = proc { |word| word.gsub('[[', '').gsub(']]', '') } else # :raw opts[:preprocess] = proc { |word| CGI.escapeHTML(word) } end opts end;T;+To; ;IC;[o; ; F; ;,;;;I"Card::Diff::LCS#initialize;F;[[I" opts;T0;[[@~i ;F;;C;;;[;{;IC;" ;T;@&;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of LCS;T;0;3[I"LCS;F;@&; I";T;!0;'@$;(I"def initialize opts;T;)T;*I"def initialize opts # regex; remove matches completely from diff @reject_pattern = opts[:reject] # regex; put matches back to the result after diff @exclude_pattern = opts[:exclude] @preprocess = opts[:preprocess] # block; called with every word @postprocess = opts[:postprocess] # block; called with complete diff @splitters = %w( <[^>]+> \[\[[^\]]+\]\] \{\{[^}]+\}\} \s+ ) @disjunction_pattern = /^\s/ end;T;+To; ; F; ;,;;;I";F;[[I" old_text;T0[I" new_text;T0[I" result;T0;[[@~i;F;;;;;[;{;IC;" ;T;@:;.0;F;[;[; I";T;!0;'@$;(I"'def run old_text, new_text, result;T;)T;*I"def run old_text, new_text, result @result = result compare old_text, new_text @result.complete = postprocess @result.complete end;T;+To; ; F; ;,;;;I"4kϾX;F;[[I" old_text;T0[I" new_text;T0;[[@~i;F;: compare;;;[;{;IC;" ;T;@M;.0;F;[;[; I";T;!0;'@$;(I"#def compare old_text, new_text;T;)T;*I"'def compare old_text, new_text if old_text old_words, old_ex = separate_comparables_from_excludees old_text new_words, new_ex = separate_comparables_from_excludees new_text ChunkProcessor.new(old_words, new_words, old_ex, new_ex).run(@result) else list = split_and_preprocess(new_text) if @exclude_pattern list = list.reject { |word| word.match @exclude_pattern } end # CAUTION: postproces and added_chunk changed order # and no longer postprocess for summary @result.write_added_chunk list.join end end;T;+To; ; F; ;,;;;I"8Card::Diff::LCS#separate_comparables_from_excludees;F;[[I" text;T0;[[@~i/;F;;R;;;[;{;IC;" ;T;@^;.0;F;[;[; I";T;!0;'@$;(I"1def separate_comparables_from_excludees text;T;)T;*I"def separate_comparables_from_excludees text # return two arrays, one with all words, one with pairs # (index in word list, html_tag) list = split_and_preprocess text if @exclude_pattern check_exclude_and_disjunction_pattern list else [list, []] end end;T;+To; ; F; ;,;;;I":Card::Diff::LCS#check_exclude_and_disjunction_pattern;F;[[I" list;T0;[[@~i:;F;:*check_exclude_and_disjunction_pattern;;;[;{;IC;" ;T;@m;.0;F;[;[; I";T;!0;'@$;(I"3def check_exclude_and_disjunction_pattern list;T;)T;*I"def check_exclude_and_disjunction_pattern list list.each_with_index.each_with_object([[], []]) do |pair, res| element, index = pair if element.match @disjunction_pattern res[1] << { chunk_index: index, element: element, type: :disjunction } elsif element.match @exclude_pattern res[1] << { chunk_index: index, element: element, type: :excludee } else res[0] << element end end end;T;+To; ; F; ;,;;;I")Card::Diff::LCS#split_and_preprocess;F;[[I" text;T0;[[@~iI;F;;S;;;[;{;IC;" ;T;@|;.0;F;[;[; I";T;!0;'@$;(I""def split_and_preprocess text;T;)T;*I"def split_and_preprocess text splitted = split_to_list_of_words(text).select do |s| !s.empty? && (!@reject_pattern || !s.match(@reject_pattern)) end @preprocess ? splitted.map { |s| @preprocess.call(s) } : splitted end;T;+To; ; F; ;,;;;I"+Card::Diff::LCS#split_to_list_of_words;F;[[I" text;T0;[[@~iP;F;;T;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@$;(I"$def split_to_list_of_words text;T;)T;*I"mdef split_to_list_of_words text split_regex = /(#{@splitters.join '|'})/ text.split(split_regex) end;T;+To; ; F; ;,;;;I"Card::Diff::LCS#preprocess;F;[[I" text;T0;[[@~iU;F;;U;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@$;(I"def preprocess text;T;)T;*I"Jdef preprocess text @preprocess ? @preprocess.call(text) : text end;T;+To; ; F; ;,;;;I" Card::Diff::LCS#postprocess;F;[[I" text;T0;[[@~iY;F;;V;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@$;(I"def postprocess text;T;)T;*I"Mdef postprocess text @postprocess ? @postprocess.call(text) : text end;T;+To; ;IC;[o; ; F; ;,;;;I"+Card::Diff::LCS::ChunkProcessor#result;F;[;[[@~i_;F;;W;;;[;{;IC;"*Returns the value of attribute result ;T;@;.0;F;[;[; I"*Returns the value of attribute result;T;!0;'@;(I"def result;T;*I"def result @result end;T;+To; ; F; ;,;;;I",Card::Diff::LCS::ChunkProcessor#summary;F;[;[[@~i_;F;;<;;;[;{;IC;"+Returns the value of attribute summary ;T;@ǃ;.0;F;[;[; I"+Returns the value of attribute summary;T;!0;'@;(I"def summary;T;*I"def summary @summary end;T;+To; ; F; ;,;;;I"-Card::Diff::LCS::ChunkProcessor#dels_cnt;F;[;[[@~i_;F;;E;;;[;{;IC;",Returns the value of attribute dels_cnt ;T;@ԃ;.0;F;[;[; I",Returns the value of attribute dels_cnt;T;!0;'@;(I"def dels_cnt;T;*I"!def dels_cnt @dels_cnt end;T;+To; ; F; ;,;;;I"-Card::Diff::LCS::ChunkProcessor#adds_cnt;F;[;[[@~i_;F;;D;;;[;{;IC;",Returns the value of attribute adds_cnt ;T;@;.0;F;[;[; I",Returns the value of attribute adds_cnt;T;!0;'@;(I"def adds_cnt;T;*I"!def adds_cnt @adds_cnt end;T;+To; ; F; ;,;;;I"/Card::Diff::LCS::ChunkProcessor#initialize;F;[ [I"old_words;T0[I"new_words;T0[I"old_excludees;T0[I"new_excludees;T0;[[@~i`;F;;C;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I"%a new instance of ChunkProcessor;T;0;3[I"ChunkProcessor;F;@; I";T;!0;'@;(I"Fdef initialize old_words, new_words, old_excludees, new_excludees;T;)T;*I"def initialize old_words, new_words, old_excludees, new_excludees @adds = [] @dels = [] @words = { old: old_words, new: new_words } @excludees = { old: ExcludeeIterator.new(old_excludees), new: ExcludeeIterator.new(new_excludees) } end;T;+To; ; F; ;,;;;I"(Card::Diff::LCS::ChunkProcessor#run;F;[[I" result;T0;[[@~im;F;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def run result;T;)T;*I"def run result @result = result prev_action = nil ::Diff::LCS.traverse_balanced(@words[:old], @words[:new]) do |word| if prev_action if prev_action != word.action && !(prev_action == '-' && word.action == '!') && !(prev_action == '!' && word.action == '+') # delete and/or add section stops here; write changes to result write_dels write_adds # new neutral section starts # we can just write excludees to result write_excludees else # current word belongs to edit of previous word case word.action when '-' del_old_excludees when '+' add_new_excludees when '!' del_old_excludees add_new_excludees else write_excludees end end else write_excludees end process_word word prev_action = word.action end write_dels write_adds write_excludees @result end;T;+To; ; F; ;,;;;I"4Card::Diff::LCS::ChunkProcessor#write_unchanged;F;[[I" text;T0;[[@~i;F;;J;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def write_unchanged text;T;)T;*I"Fdef write_unchanged text @result.write_unchanged_chunk text end;T;+To; ; F; ;,;;;I"/Card::Diff::LCS::ChunkProcessor#write_dels;F;[;[[@~i;F;;K;;;[;{;IC;" ;T;@&;.0;F;[;[; I";T;!0;'@;(I"def write_dels;T;)T;*I"fdef write_dels return if @dels.empty? @result.write_deleted_chunk @dels.join @dels = [] end;T;+To; ; F; ;,;;;I"/Card::Diff::LCS::ChunkProcessor#write_adds;F;[;[[@~i;F;;L;;;[;{;IC;" ;T;@3;.0;F;[;[; I";T;!0;'@;(I"def write_adds;T;)T;*I"ddef write_adds return if @adds.empty? @result.write_added_chunk @adds.join @adds = [] end;T;+To; ; F; ;,;;;I"4Card::Diff::LCS::ChunkProcessor#write_excludees;F;[;[[@~i;F;;M;;;[;{;IC;" ;T;@@;.0;F;[;[; I";T;!0;'@;(I"def write_excludees;T;)T;*I"udef write_excludees while (ex = @excludees[:new].next) @result.write_excluded_chunk ex[:element] end end;T;+To; ; F; ;,;;;I"6Card::Diff::LCS::ChunkProcessor#del_old_excludees;F;[;[[@~i;F;;N;;;[;{;IC;" ;T;@M;.0;F;[;[; I";T;!0;'@;(I"def del_old_excludees;T;)T;*I"def del_old_excludees while (ex = @excludees[:old].next) if ex[:type] == :disjunction @dels << ex[:element] else write_dels @result.write_excluded_chunk ex[:element] end end end;T;+To; ; F; ;,;;;I"6Card::Diff::LCS::ChunkProcessor#add_new_excludees;F;[;[[@~i;F;;O;;;[;{;IC;" ;T;@Z;.0;F;[;[; I";T;!0;'@;(I"def add_new_excludees;T;)T;*I"def add_new_excludees while (ex = @excludees[:new].next) if ex[:type] == :disjunction @adds << ex[:element] else write_adds @result.complete << ex[:element] end end end;T;+To; ; F; ;,;;;I"1Card::Diff::LCS::ChunkProcessor#process_word;F;[[I" word;T0;[[@~i;F;;P;;;[;{;IC;" ;T;@g;.0;F;[;[; I";T;!0;'@;(I"def process_word word;T;)T;*I"`def process_word word process_element word.old_element, word.new_element, word.action end;T;+To; ; F; ;,;;;I"4Card::Diff::LCS::ChunkProcessor#process_element;F;[[I"old_element;T0[I"new_element;T0[I" action;T0;[[@~i;F;;Q;;;[;{;IC;" ;T;@v;.0;F;[;[; I";T;!0;'@;(I"9def process_element old_element, new_element, action;T;)T;*I" def process_element old_element, new_element, action case action when '-' minus old_element when '+' plus new_element when '!' minus old_element plus new_element else write_unchanged new_element @excludees[:new].word_step end end;T;+To; ; F; ;,;;;I")Card::Diff::LCS::ChunkProcessor#plus;F;[[I"new_element;T0;[[@~i;F;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def plus new_element;T;)T;*I"Qdef plus new_element @adds << new_element @excludees[:new].word_step end;T;+To; ; F; ;,;;;I"*Card::Diff::LCS::ChunkProcessor#minus;F;[[I"old_element;T0;[[@~i;F;: minus;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def minus old_element;T;)T;*I"Rdef minus old_element @dels << old_element @excludees[:old].word_step end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{ ;WIC;M{;C@;D0;NT;<IC;M{;C@ǃ;D0;NT;EIC;M{;C@ԃ;D0;NT;DIC;M{;C@;D0;NT;NT;NT;O{;P[;[[@~i^;T;:ChunkProcessor;;;;;[;{;IC;"6Compares two lists of chunks and generates a diff ;T;@;F;[;[; I"6Compares two lists of chunks and generates a diff;T;!0;"o;#;$F;%i];&i];'@$;I"$Card::Diff::LCS::ChunkProcessor;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+To; ;IC;[o; ; F; ;,;;;I"1Card::Diff::LCS::ExcludeeIterator#initialize;F;[[I" list;T0;[[@~i;F;;C;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I"'a new instance of ExcludeeIterator;T;0;3[I"ExcludeeIterator;F;@; I";T;!0;'@;(I"def initialize list;T;)T;*I"Kdef initialize list @list = list @index = 0 @chunk_index = 0 end;T;+To; ; F; ;,;;;I"0Card::Diff::LCS::ExcludeeIterator#word_step;F;[;[[@~i;F;;^;;;[;{;IC;" ;T;@ӄ;.0;F;[;[; I";T;!0;'@;(I"def word_step;T;)T;*I"*def word_step @chunk_index += 1 end;T;+To; ; F; ;,;;;I"+Card::Diff::LCS::ExcludeeIterator#next;F;[;[[@~i;F;;_;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I" def next;T;)T;*I"def next if @index < @list.size && @list[@index][:chunk_index] == @chunk_index res = @list[@index] @index += 1 @chunk_index += 1 res end end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@~i;F;;`;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@$;I"&Card::Diff::LCS::ExcludeeIterator;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+T;I@$;JIC;[;I@$;KIC;[;I@$;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@~i ;T;;a;;;;;[;{;IC;"/Use LCS algorithm to create a Diff::Result ;T;@$;F;[;[; I"/Use LCS algorithm to create a Diff::Result;T;!0;"o;#;$F;%i;&i;'@Ȃ;I"p:Y;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+To; ;IC;[o; ; F; ;,;;;I" Card::Diff::Result#complete;F;[;[[@~i ;F;;;;;;[;{;IC;",Returns the value of attribute complete ;T;@;.0;F;[;[; I",Returns the value of attribute complete;T;!0;'@;(I"def complete;T;*I"!def complete @complete end;T;+To; ; F; ;,;;;I"!Card::Diff::Result#complete=;F;[[I" value;T0;[[@~i ;F;:complete=;;;[;{;IC;" Sets the attribute complete ;T;@;.0;F;[;[o;0 ;1I" param;F;2I"0the value to set the attribute complete to.;T;I" value;T;30;@; I"YSets the attribute complete @param value the value to set the attribute complete to.;T;!0;'@;(I"def complete=(value);T;*I"1def complete=(value) @complete = value end;T;+To; ; F; ;,;;;I"Card::Diff::Result#summary;F;[;[[@~i [@~i;F;;<;;;[;{;IC;"+Returns the value of attribute summary ;T;@2;.0;F;[;[; I"+Returns the value of attribute summary;T;!0;'@;(I"def summary;T;)T;*I"def summary @summary end;T;+To; ; F; ;,;;;I" Card::Diff::Result#summary=;F;[[I" value;T0;[[@~i ;F;: summary=;;;[;{;IC;"Sets the attribute summary ;T;@@;.0;F;[;[o;0 ;1I" param;F;2I"/the value to set the attribute summary to.;T;I" value;T;30;@@; I"WSets the attribute summary @param value the value to set the attribute summary to.;T;!0;'@;(I"def summary=(value);T;*I"/def summary=(value) @summary = value end;T;+To; ; F; ;,;;;I" Card::Diff::Result#dels_cnt;F;[;[[@~i ;F;;E;;;[;{;IC;",Returns the value of attribute dels_cnt ;T;@S;.0;F;[;[; I",Returns the value of attribute dels_cnt;T;!0;'@;(I"def dels_cnt;T;*I"!def dels_cnt @dels_cnt end;T;+To; ; F; ;,;;;I"!Card::Diff::Result#dels_cnt=;F;[[I" value;T0;[[@~i ;F;:dels_cnt=;;;[;{;IC;" Sets the attribute dels_cnt ;T;@`;.0;F;[;[o;0 ;1I" param;F;2I"0the value to set the attribute dels_cnt to.;T;I" value;T;30;@`; I"YSets the attribute dels_cnt @param value the value to set the attribute dels_cnt to.;T;!0;'@;(I"def dels_cnt=(value);T;*I"1def dels_cnt=(value) @dels_cnt = value end;T;+To; ; F; ;,;;;I" Card::Diff::Result#adds_cnt;F;[;[[@~i ;F;;D;;;[;{;IC;",Returns the value of attribute adds_cnt ;T;@s;.0;F;[;[; I",Returns the value of attribute adds_cnt;T;!0;'@;(I"def adds_cnt;T;*I"!def adds_cnt @adds_cnt end;T;+To; ; F; ;,;;;I"!Card::Diff::Result#adds_cnt=;F;[[I" value;T0;[[@~i ;F;:adds_cnt=;;;[;{;IC;" Sets the attribute adds_cnt ;T;@;.0;F;[;[o;0 ;1I" param;F;2I"0the value to set the attribute adds_cnt to.;T;I" value;T;30;@; I"YSets the attribute adds_cnt @param value the value to set the attribute adds_cnt to.;T;!0;'@;(I"def adds_cnt=(value);T;*I"1def adds_cnt=(value) @adds_cnt = value end;T;+To; ; F; ;,;;;I""Card::Diff::Result#initialize;F;[[I"summary_opts;TI"nil;T;[[@~i ;F;;C;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of Result;T;0;3[I" Result;F;@; I";T;!0;'@;(I"$def initialize summary_opts=nil;T;)T;*I"def initialize summary_opts=nil @dels_cnt = 0 @adds_cnt = 0 @complete = '' @summary = Summary.new summary_opts end;T;+To; ; F; ;,;;;I")Card::Diff::Result#write_added_chunk;F;[[I" text;T0;[[@~i;F;:write_added_chunk;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def write_added_chunk text;T;)T;*I"{def write_added_chunk text @adds_cnt += 1 @complete << Card::Diff.render_added_chunk(text) @summary.add text end;T;+To; ; F; ;,;;;I"+Card::Diff::Result#write_deleted_chunk;F;[[I" text;T0;[[@~i;F;:write_deleted_chunk;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"!def write_deleted_chunk text;T;)T;*I"}def write_deleted_chunk text @dels_cnt += 1 @complete << Card::Diff.render_deleted_chunk(text) @summary.delete text end;T;+To; ; F; ;,;;;I"-Card::Diff::Result#write_unchanged_chunk;F;[[I" text;T0;[[@~i!;F;:write_unchanged_chunk;;;[;{;IC;" ;T;@ƅ;.0;F;[;[; I";T;!0;'@;(I"#def write_unchanged_chunk text;T;)T;*I"Kdef write_unchanged_chunk text @complete << text @summary.omit end;T;+To; ; F; ;,;;;I",Card::Diff::Result#write_excluded_chunk;F;[[I" text;T0;[[@~i&;F;:write_excluded_chunk;;;[;{;IC;" ;T;@Յ;.0;F;[;[; I";T;!0;'@;(I""def write_excluded_chunk text;T;)T;*I":def write_excluded_chunk text @complete << text end;T;+To; ;IC;[o; ; F; ;,;;;I"+Card::Diff::Result::Summary#initialize;F;[[I" opts;T0;[[@~i+;F;;C;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I"a new instance of Summary;T;0;3[I" Summary;F;@; I";T;!0;'@;(I"def initialize opts;T;)T;*I"def initialize opts opts ||= {} @remaining_chars = opts[:length] || 50 @joint = opts[:joint] || '...' @summary = nil @chunks = [] end;T;+To; ; F; ;,;;;I")Card::Diff::Result::Summary#rendered;F;[;[[@~i4;F;: rendered;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def rendered;T;)T;*I"def rendered @summary ||= begin truncate_overlap @chunks.map do |chunk| render_chunk chunk[:action], chunk[:text] end.join end end;T;+To; ; F; ;,;;;I"$Card::Diff::Result::Summary#add;F;[[I" text;T0;[[@~i>;F;;X;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def add text;T;)T;*I".def add text add_chunk text, :added end;T;+To; ; F; ;,;;;I"'Card::Diff::Result::Summary#delete;F;[[I" text;T0;[[@~iB;F;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def delete text;T;)T;*I"3def delete text add_chunk text, :deleted end;T;+To; ; F; ;,;;;I"%Card::Diff::Result::Summary#omit;F;[;[[@~iF;F;;Y;;;[;{;IC;" ;T;@%;.0;F;[;[; I";T;!0;'@;(I" def omit;T;)T;*I"qdef omit if @chunks.empty? || @chunks.last[:action] != :ellipsis add_chunk @joint, :ellipsis end end;T;+To; ; F; ;,;;;I"*Card::Diff::Result::Summary#add_chunk;F;[[I" text;T0[I" action;T0;[[@~iN;F;;Z;;;[;{;IC;" ;T;@2;.0;F;[;[; I";T;!0;'@;(I"def add_chunk text, action;T;)T;*I"def add_chunk text, action if @remaining_chars > 0 @chunks << { action: action, text: text } @remaining_chars -= text.size end end;T;+To; ; F; ;,;;;I"-Card::Diff::Result::Summary#render_chunk;F;[[I" action;T0[I" text;T0;[[@~iU;F;;?;;;[;{;IC;" ;T;@C;.0;F;[;[; I";T;!0;'@;(I""def render_chunk action, text;T;)T;*I"def render_chunk action, text case action when '+', :added then Card::Diff.render_added_chunk text when '-', :deleted then Card::Diff.render_deleted_chunk text else text end end;T;+To; ; F; ;,;;;I"1Card::Diff::Result::Summary#truncate_overlap;F;[;[[@~i];F;;\;;;[;{;IC;" ;T;@T;.0;F;[;[; I";T;!0;'@;(I"def truncate_overlap;T;)T;*I"edef truncate_overlap if @remaining_chars < 0 if @chunks.last[:action] == :ellipsis @chunks.pop @remaining_chars += @joint.size end index = @chunks.size - 1 while @remaining_chars < @joint.size && index >= 0 if @remaining_chars + @chunks[index][:text].size == @joint.size replace_with_joint index break elsif @remaining_chars + @chunks[index][:text].size > @joint.size cut_with_joint index break else @remaining_chars += @chunks[index][:text].size @chunks.delete_at(index) end index -= 1 end end end;T;+To; ; F; ;,;;;I"/Card::Diff::Result::Summary#cut_with_joint;F;[[I" index;T0;[[@~iu;F;:cut_with_joint;;;[;{;IC;" ;T;@a;.0;F;[;[; I";T;!0;'@;(I"def cut_with_joint index;T;)T;*I"def cut_with_joint index @chunks[index][:text] = @chunks[index][:text][0..(@remaining_chars - @joint.size - 1)] @chunks[index][:text] += @joint end;T;+To; ; F; ;,;;;I"3Card::Diff::Result::Summary#replace_with_joint;F;[[I" index;T0;[[@~i{;F;:replace_with_joint;;;[;{;IC;" ;T;@p;.0;F;[;[; I";T;!0;'@;(I"!def replace_with_joint index;T;)T;*I"def replace_with_joint index @chunks.pop if index - 1 >= 0 if @chunks[index - 1][:action] == :added @chunks << { action: :ellipsis, text: @joint } elsif @chunks[index - 1][:action] == :deleted @chunks << { action: :added, text: @joint } end end end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@~i*;F;;];;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;I" Card::Diff::Result::Summary;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{ ;;IC;M{;C@;D@;NT;<IC;M{;C@2;D@@;NT;EIC;M{;C@S;D@`;NT;DIC;M{;C@s;D@;NT;NT;NT;O{;P[;[[@~i;F;: Result;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@Ȃ;I";F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+T;I@Ȃ;JIC;[;I@Ȃ;KIC;[;I@Ȃ;LIC;M{; IC;M{;NT;,IC;M{;WIC;M{;C@ʂ;D0;NT;NT;NT;O{;P[;[[@l@i [@~i[@~i;F;;c;;;;;[;{;IC;" ;T;@Ȃ;.0;F;[;[; I";T;!0;'@;I"Card::Diff;F;Io;S ;T0;U0;V0;;J;'@;W@;X0;+T:Card::Diff.complete@^@:Card::Diff.summary@u@:"Card::Diff.render_added_chunk@@:$Card::Diff.render_deleted_chunk@@:Card::Diff.render_chunk@@:Card::Diff::DiffBuilder@@:$Card::Diff::DiffBuilder#summary@@:%Card::Diff::DiffBuilder#complete@@:'Card::Diff::DiffBuilder#initialize@@:!Card::Diff::DiffBuilder#red?@@:#Card::Diff::DiffBuilder#green?@A:0Card::Diff::DiffBuilder#lcs_opts_for_format@A:%Card::Diff::DiffBuilder#lcs_diff@'A:!Card::Diff::DiffBuilder::LCS@4A:*Card::Diff::DiffBuilder::LCS#adds_cnt@6A:*Card::Diff::DiffBuilder::LCS#dels_cnt@CA:,Card::Diff::DiffBuilder::LCS#initialize@PA:)Card::Diff::DiffBuilder::LCS#summary@kA:*Card::Diff::DiffBuilder::LCS#complete@xA:+Card::Diff::DiffBuilder::LCS#init_diff@A:*Card::Diff::DiffBuilder::LCS#run_diff@A:-Card::Diff::DiffBuilder::LCS#added_chunk@A:/Card::Diff::DiffBuilder::LCS#deleted_chunk@A:1Card::Diff::DiffBuilder::LCS#write_unchanged@A:,Card::Diff::DiffBuilder::LCS#write_dels@A:,Card::Diff::DiffBuilder::LCS#write_adds@A:1Card::Diff::DiffBuilder::LCS#write_excludees@A:3Card::Diff::DiffBuilder::LCS#del_old_excludees@A:3Card::Diff::DiffBuilder::LCS#add_new_excludees@ B:.Card::Diff::DiffBuilder::LCS#process_word@B:1Card::Diff::DiffBuilder::LCS#process_element@&B:ECard::Diff::DiffBuilder::LCS#separate_comparables_from_excludees@9B:6Card::Diff::DiffBuilder::LCS#split_and_preprocess@HB:8Card::Diff::DiffBuilder::LCS#split_to_list_of_words@WB:,Card::Diff::DiffBuilder::LCS#preprocess@fB:-Card::Diff::DiffBuilder::LCS#postprocess@uB:*Card::Diff::DiffBuilder::LCS::Summary@B:5Card::Diff::DiffBuilder::LCS::Summary#initialize@B:1Card::Diff::DiffBuilder::LCS::Summary#result@B:.Card::Diff::DiffBuilder::LCS::Summary#add@B:1Card::Diff::DiffBuilder::LCS::Summary#delete@B:/Card::Diff::DiffBuilder::LCS::Summary#omit@B:4Card::Diff::DiffBuilder::LCS::Summary#add_chunk@B:8Card::Diff::DiffBuilder::LCS::Summary#render_chunks@B:;Card::Diff::DiffBuilder::LCS::Summary#truncate_overlap@B:3Card::Diff::DiffBuilder::LCS::ExcludeeIterator@C:>Card::Diff::DiffBuilder::LCS::ExcludeeIterator#initialize@C:=Card::Diff::DiffBuilder::LCS::ExcludeeIterator#word_step@$C:8Card::Diff::DiffBuilder::LCS::ExcludeeIterator#next@1C:Card::Auth@C:Card::Auth::@@as_card@C:%Card::Auth::NON_CREATEABLE_TYPES@C:Card::Auth::NEED_SETUP_KEY@C:Card::Auth.authenticate@C:'Card::Auth.password_authenticated?@C:Card::Auth.encrypt@C:Card::Auth.[]@C:Card::Auth.signin@C:Card::Auth.session@D:(Card::Auth.set_current_from_session@D:Card::Auth.current_id@+D:Card::Auth.current@9D:Card::Auth.current_id=@GD:Card::Auth.get_user_id@WD:Card::Auth.as@gD:Card::Auth.as_bot@wD:Card::Auth.among?@D:Card::Auth.as_id@D:Card::Auth.as_card@D:Card::Auth.signed_in?@D:Card::Auth.needs_setup?@D:$Card::Auth.simulate_setup_need!@D:Card::Auth.always_ok?@D: Card::Auth.createable_types@E:Card::Auth.account_count@E:Card::Cache@E:Card::Cache::TEST_ENVS@E:!Card::Cache::@@prepopulating@E:"Card::Cache::@@no_rails_cache@E:"Card::Cache::@@cache_by_class@E:Card::Cache.[]@E:Card::Cache.renew@ F:Card::Cache.prefix_root@F:Card::Cache.system_prefix@%F:Card::Cache.restore@4F:"Card::Cache.generate_cache_id@BF:Card::Cache.reset_global@OF:Card::Cache.reset_local@]F:Card::Cache.obj_to_key@jF:Card::Cache.prepopulate@zF:Card::Cache#prefix@F:Card::Cache#store@F:Card::Cache#klass@F:Card::Cache#local@F:Card::Cache#local=@F:Card::Cache#initialize@F:Card::Cache#system_prefix=@F:Card::Cache#read@F:Card::Cache#read_local@G:Card::Cache#write_variable@G:Card::Cache#write@&G:Card::Cache#write_local@8G:Card::Cache#fetch@IG:Card::Cache#fetch_local@[G:Card::Cache#delete@jG:Card::Cache#dump@zG:Card::Cache#reset@G:Card::Cache#reset_local@G:Card::Cache#exist?@G:Card::Chunk@I:Card::Chunk.register_class@I:Card::Chunk.register_list@I:%Card::Chunk.find_class_by_prefix@J:"Card::Chunk.get_prefix_regexp@J:Card::Chunk::Abstract@"J:Card::Chunk::Abstract#text@$J:(Card::Chunk::Abstract#process_chunk@1J:%Card::Chunk::Abstract.full_match@>J:"Card::Chunk::Abstract.full_re@QJ:&Card::Chunk::Abstract.context_ok?@`J:%Card::Chunk::Abstract#initialize@vJ:$Card::Chunk::Abstract#interpret@J:!Card::Chunk::Abstract#format@J:Card::Chunk::Abstract#card@J:Card::Chunk::Abstract#to_s@J:"Card::Chunk::Abstract#inspect@J:"Card::Chunk::Abstract#as_json@J:Card.config@K:Card.paths@K:Card::Loader@"K:Card::Loader.load_mods@$K:Card::Loader.load_chunks@3K:Card::Loader.load_layouts@AK:Card::Loader.mod_dirs@OK:#Card::Loader.load_set_patterns@]K:0Card::Loader.generate_set_pattern_tmp_files@kK:Card::Loader.load_formats@yK:Card::Loader.load_sets@K:*Card::Loader.generate_tmp_set_modules@K:&Card::Loader.load_tmp_set_modules@K:)Card::Loader.make_set_module_tmp_dir@K:!Card::Loader.prepare_tmp_dir@K:$Card::Loader.rewrite_tmp_files?@K:Card::Loader.load_dir@K:Card::Format@-L:#Card::Format::DEPRECATED_VIEWS@/L:"Card::Format::INCLUSION_MODES@?L:Card::Format#card@ML:Card::Format#root@[L:Card::Format#parent@iL:Card::Format#main_opts@wL:Card::Format#form@L:Card::Format#form=@L:Card::Format#error_status@L:Card::Format#error_status=@L: Card::Format#inclusion_opts@L:!Card::Format#inclusion_opts=@L:Card::Format::@@registered@L:Card::Format.register@L:#Card::Format.format_class_name@M:$Card::Format.extract_class_vars@M:Card::Format.new@)M:Card::Format.tagged@U:Card::Success#target=@NU:Card::Success#apply@^U:Card::Success#target@nU:Card::Success#[]=@U:Card::Success#[]@U:Card::Success#to_url@U:!Card::Success#method_missing@U:Card::Success#session@U:Card::Version@U:Card::Version.release@U:Card::Content@V:Card::Content#revision@V:Card::Content#format@-V:Card::Content#chunks@:V:Card::Content#opts@GV:Card::Content#initialize@TV:Card::Content#card@mV:Card::Content#chunk_list@|V:Card::Content#to_s@V:Card::Content#inspect@V:Card::Content#each_chunk@V:Card::Content#find_chunks@V:)Card::Content#process_content_object@V: Card::Content#parse_content@V: Card::Content::ALLOWED_TAGS@V:!Card::Content::ATTR_VALUE_RE@V:Card::Content.clean!@V:)Card::Content#clean_with_space_last!@W:2Card::Content.truncatewords_with_closing_tags@%W:Card::Codename@Y:Card::Codename::@@codehash@Y:Card::Codename.[]@(Y:Card::Codename.codehash@9Y:Card::Codename.reset_cache@GY:Card::Codename.bootdata@UY:Card::Codename.cache@fY:Card::Codename.load_hash@tY:Card.const_missing@Y;J@:Object#deep_clone@:Object#send_unless@:Object#send_if@:Object#to_name@:Object#to_viewname@;@ :Module::RUBY_VERSION_18@ : Module#const_get_if_defined@:Module#const_get_or_set@); @K:&Hash.new_from_semicolon_attr_list@M:Kaminari::Helpers::Tago; ;IC;[o; ; F; ;,;;;I"(Kaminari::Helpers::Tag#page_url_for;T;[[I" page;T0;[[@iT;F;:page_url_for;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'@;(I"def page_url_for(page);T;)T;*I"def page_url_for page p = params_for(page) p.delete :controller p.delete :action card = Card[p.delete('id')] card.format.path p end;T;+To; ; F; ;,;;;I"&Kaminari::Helpers::Tag#params_for;T;[[I" page;T0;[[@i^;F;:params_for;;;[;{;IC;" ;T;@ʆ;.0;F;[;[; I";T;!0;'@;(I"def params_for(page);T;)T;*I"def params_for(page) page_params = Rack::Utils.parse_nested_query("#{@param_name}=#{page}") page_params = @params.with_indifferent_access.deep_merge(page_params) if Kaminari.config.respond_to?(:params_on_first_page) && !Kaminari.config.params_on_first_page && page <= 1 # This converts a hash: # from: {other: "params", page: 1} # to: {other: "params", page: nil} # (when @param_name == "page") # # from: {other: "params", user: {name: "yuki", page: 1}} # to: {other: "params", user: {name: "yuki", page: nil}} # (when @param_name == "user[page]") @param_name.to_s.scan(/\w+/)[0..-2].inject(page_params){|h, k| h[k] }[$&] = nil end page_params end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@iS;F;:Tag;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'o;S ;T0;UI"Kaminari::Helpers;T;V@;: Helpers;'o;S ;T0;U0;V0;: Kaminari;'@;W0;X0;W0;X0;I"Kaminari::Helpers::Tag;T;Io;S ;T0;U0;V0;;J;'@;W@;X0:Card::Location@VS:Card::Location#page_path@XS:Card::Location#card_path@nS:Card::Location#card_url@~S:Card::Migration@Y:Card::Migration.type@Y:%Card::Migration.find_unused_name@Y:$Card::Migration.migration_paths@Y:Card::Migration.schema@Y:"Card::Migration.schema_suffix@Z: Card::Migration.schema_mode@Z:1Card::Migration.assume_migrated_upto_version@/Z:Card::Migration.data_path@=Z: Card::Migration#contentedly@NZ: Card::Migration#import_json@\Z:Card::Migration#read_json@oZ:Card::Migration#data_path@Z: Card::Migration#schema_mode@Z:$Card::Migration#migration_paths@Z:#Card::Migration#exec_migration@Z:Card::Migration#down@Z:Card::ViewName@\:*Card::ViewName::@@name2viewnameobject@\:Card::ViewName.new@\:Card::ViewName#initialize@\:Card::ViewName#simple_key@\:Card::ViewName#to_viewname@\:Card::Reference@]:Card::Reference#referencer@]:Card::Reference#referencee@]:$Card::Reference.delete_all_from@!]:"Card::Reference.delete_all_to@0]:(Card::Reference.update_existing_key@?]:%Card::Reference.update_on_rename@Q]:%Card::Reference.update_on_delete@e]:,Card::Reference.repair_missing_referees@t]:,Card::Reference.delete_missing_referers@]:Card::Reference.repair_all@]:Card::Query@,^:Card::Query::Join@.^:!Card::Query::Join#conditions@0^:"Card::Query::Join#conditions=@>^:Card::Query::Join#side@Q^:Card::Query::Join#side=@a^:Card::Query::Join#from@t^:Card::Query::Join#from=@^:Card::Query::Join#to@^:Card::Query::Join#to=@^:!Card::Query::Join#from_table@^:"Card::Query::Join#from_table=@^:Card::Query::Join#to_table@^: Card::Query::Join#to_table=@^:!Card::Query::Join#from_alias@^:"Card::Query::Join#from_alias=@_:Card::Query::Join#to_alias@_: Card::Query::Join#to_alias=@!_:!Card::Query::Join#from_field@4_:"Card::Query::Join#from_field=@A_:Card::Query::Join#to_field@T_: Card::Query::Join#to_field=@a_:!Card::Query::Join#initialize@t_:"Card::Query::Join#from_and_to@_:Card::Query::Join#to_sql@_: Card::Query::Join#on_clause@_:Card::ViewCache@Si:Card::ViewCache::SIZE@Ui:Card::ViewCache::LIMIT@ci:Card::ViewCache::CNT_KEY@qi:#Card::ViewCache::FREQUENCY_KEY@~i:Card::ViewCache.cache@i:"Card::ViewCache.increment_cnt@i:Card::ViewCache.count@i:!Card::ViewCache.reduce_cache@i:%Card::ViewCache.update_frequency@i:Card::ViewCache.fetch@i:Card::ViewCache.reset@i:Card::Generators@gj:#Card::Generators::ClassMethods@ij:/Card::Generators::ClassMethods#source_root@kj:*Card::Generators::ClassMethods#banner@~j: Card::Generators::NamedBase@j:$Card::Generators::MigrationBase@j:Card::Error@Sk:Card::Oops@hk:Card::BadQuery@|k:Card::NotFound@k:Card::PermissionDenied@k: Card::PermissionDenied#card@k:&Card::PermissionDenied#initialize@k:)Card::PermissionDenied#build_message@k:Card::Abort@k:Card::Abort#status@k:Card::Abort#initialize@k:Card::SetPattern@l:"Card::SetPattern.pattern_code@l:#Card::SetPattern.pattern_code=@.l: Card::SetPattern.pattern_id@Bl:!Card::SetPattern.pattern_id=@Pl:#Card::SetPattern.junction_only@dl:$Card::SetPattern.junction_only=@rl:"Card::SetPattern.assigns_type@l:#Card::SetPattern.assigns_type=@l: Card::SetPattern.anchorless@l:!Card::SetPattern.anchorless=@l:(Card::SetPattern.anchor_parts_count@l:)Card::SetPattern.anchor_parts_count=@l:Card::SetPattern.card_keys@l:Card::SetPattern.find@l:$Card::SetPattern.junction_only?@ m:!Card::SetPattern.anchorless?@m:Card::SetPattern.new@2m:Card::SetPattern.pattern@Bm:Card::SetPattern.register@Pm:&Card::SetPattern.pattern_applies?@cm:$Card::SetPattern.write_tmp_file@xm: Card::SetPattern#initialize@m: Card::SetPattern#module_key@m:(Card::SetPattern#lookup_module_list@m:!Card::SetPattern#module_list@m:(Card::SetPattern#format_module_list@m:&Card::SetPattern#anchor_codenames@m:Card::SetPattern#pattern@m:Card::SetPattern#to_s@m:Card::SetPattern#inspect@n:Card::SetPattern#safe_key@n:"Card::SetPattern#rule_set_key@!n:Card::TypeSet@Gn:Card::TypeSet#initialize@In:'Card::TypeSet#lookup_inherited_key@^n: Card::TypeSet#inherited_key@ln:%Card::TypeSet#lookup_module_list@zn;l@o:Card::SpecHelper@n:Card::SpecHelper#login_as@o:Card::SpecHelper#newcard@o:(Card::SpecHelper#assert_view_select@&o:.Card::SpecHelper#debug_assert_view_select@:o:#Card::SpecHelper#render_editor@No:$Card::SpecHelper#render_content@^o:.Card::SpecHelper#render_content_with_args@qo:!Card::SpecHelper#render_card@o:+Card::SpecHelper#render_card_with_args@o:Card::SpecHelper#users@o:Card::Query::Value@5`:Card::Query::Value#query@7`: Card::Query::Value#operator@G`:Card::Query::Value#value@U`:"Card::Query::Value#initialize@c`:#Card::Query::Value#parse_value@z`:-Card::Query::Value#canonicalize_operator@`:Card::Query::Value#sqlize@`:Card::Query::Value#to_sql@`:Card::Query::Clause@`:!Card::Query::Clause#safe_sql@`:Card::Query::Clause#quote@`:#Card::Query::Clause#match_prep@`:Card::CoreMigration@Ip:Card::Query::Reference@a:(Card::Query::Reference::DEFINITIONS@a:%Card::Query::Reference::FIELDMAP@$a:&Card::Query::Reference#conditions@2a:'Card::Query::Reference#conditions=@@a:%Card::Query::Reference#cardquery@Ta:&Card::Query::Reference#cardquery=@ba:#Card::Query::Reference#infield@va:$Card::Query::Reference#infield=@a:$Card::Query::Reference#outfield@a:%Card::Query::Reference#outfield=@a:'Card::Query::Reference#table_alias@a:&Card::Query::Reference#initialize@a; @; @:Card::Query::Attributes@a:3Card::Query::Attributes::SORT_JOIN_TO_ITEM_MAP@a:!Card::Query::Attributes#type@b:!Card::Query::Attributes#part@b:!Card::Query::Attributes#left@)b:"Card::Query::Attributes#right@9b:&Card::Query::Attributes#editor_of@Ib:&Card::Query::Attributes#edited_by@Yb:+Card::Query::Attributes#last_editor_of@ib:+Card::Query::Attributes#last_edited_by@yb:'Card::Query::Attributes#creator_of@b:'Card::Query::Attributes#created_by@b:&Card::Query::Attributes#member_of@b:#Card::Query::Attributes#member@b:&Card::Query::Attributes#left_plus@b:'Card::Query::Attributes#right_plus@b:!Card::Query::Attributes#plus@b:%Card::Query::Attributes#junction@b:%Card::Query::Attributes#found_by@c:+Card::Query::Attributes#found_by_cards@c:"Card::Query::Attributes#match@/c:%Card::Query::Attributes#complete@?c:+Card::Query::Attributes#extension_type@Oc:,Card::Query::Attributes#join_references@_c:(Card::Query::Attributes#conjunction@rc:!Card::Query::Attributes#sort@c:*Card::Query::Attributes#sort_by_count@c:(Card::Query::Attributes#table_alias@c:%Card::Query::Attributes#table_id@c:,Card::Query::Attributes#tick_table_seq!@c:'Card::Query::Attributes#join_cards@c: Card::Query::Attributes#all@c: Card::Query::Attributes#and@c: Card::Query::Attributes#any@d:Card::Query::Attributes#or@d:Card::Query::Attributes#in@ d:$Card::Query::Attributes#conjoin@-d: Card::Query::Attributes#not@?d:%Card::Query::Attributes#restrict@Od:(Card::Query::Attributes#id_from_val@ad:#is_in_mod?@:#card_simplecov_filters@:%#card_core_dev_simplecov_filters@Ā;j@z[:%ActiveRecord::ConnectionAdapters@|[:6ActiveRecord::ConnectionAdapters::AbstractAdapter@~[:ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#match@[:2ActiveRecord::ConnectionAdapters::MysqlCommon@[:8ActiveRecord::ConnectionAdapters::MysqlCommon#match@[:DActiveRecord::ConnectionAdapters::MysqlCommon#custom_cast_types@[:3ActiveRecord::ConnectionAdapters::MysqlAdapter@\:4ActiveRecord::ConnectionAdapters::Mysql2Adapter@*\:4ActiveRecord::ConnectionAdapters::SQLiteAdapter@?\::ActiveRecord::ConnectionAdapters::SQLiteAdapter#match@A\:ActiveRecord::Transactions@t\:AActiveRecord::Transactions#with_transaction_returning_status@v\;@Ҁ:Card::Act@_p:Card::Act#set_actor@ap: Card::Act.delete_actionless@qp:'Card::Act.find_all_with_actions_on@p:Card::Act#action_on@p:Card::Act#main_action@p:Card::Act#elapsed_time@p:"Card::Act#relevant_drafts_for@p:#Card::Act#relevant_actions_for@p:.Card::Act#timestamp_attributes_for_create@p:Card::Query::SqlStatement@d:)Card::Query::SqlStatement#initialize@d:$Card::Query::SqlStatement#build@d:#Card::Query::SqlStatement#to_s@d:%Card::Query::SqlStatement#tables@d:%Card::Query::SqlStatement#fields@d:$Card::Query::SqlStatement#joins@d:*Card::Query::SqlStatement#join_clause@d:$Card::Query::SqlStatement#where@e:/Card::Query::SqlStatement#query_conditions@e:/Card::Query::SqlStatement#basic_conditions@"e:2Card::Query::SqlStatement#standard_conditions@2e:.Card::Query::SqlStatement#trash_condition@Be:4Card::Query::SqlStatement#permission_conditions@Re:$Card::Query::SqlStatement#group@be:/Card::Query::SqlStatement#limit_and_offset@pe:*Card::Query::SqlStatement#full_syntax@~e:$Card::Query::SqlStatement#order@e:)Card::Query::SqlStatement#sort_field@e:'Card::Query::SqlStatement#safe_sql@e:(Card::Query::SqlStatement#cast_type@e:Card::Query::SqlCond@*f: Card::Query::SqlCond#to_sql@,f;@:&SetPatternSpecHelper#it_generates@:Card::Action@'q:Card::Action::TYPE@)q:Card::Action#expire@8q:Card::Action.cache@Eq:Card::Action.fetch@Rq:!Card::Action.delete_cardless@aq:Card::Action.delete_old@nq: Card::Action#changed_fields@}q:Card::Action#edit_info@q:Card::Action#new_values@q:Card::Action#old_values@q: Card::Action#last_value_for@q:Card::Action#field_index@q:Card::Action#new_value_for@q:Card::Action#change_for@q:Card::Action#new_type?@q:Card::Action#new_content?@r:Card::Action#new_name?@r:Card::Action#action_type=@+r:Card::Action#action_type@;r:Card::Action#set_act@Ir:Card::Action#revision_nr@Vr:Card::Action#red?@dr:Card::Action#green?@wr:Card::Action#name_diff@r:Card::Action#cardtype_diff@r:Card::Action#content_diff@r:&Card::Action#content_diff_builder@r:Card::Action#card@r:Card::Change@zs:Card::Change#field=@|s:Card::Change#field@s:#Card::Change.delete_actionless@s:$Card::Change#find_by_field_name@s:$Card::Change.find_by_field_name@s:Card::Machine@$: Card::Machine::ClassMethods@$:.Card::Machine::ClassMethods#output_config@$:/Card::Machine::ClassMethods#output_config=@$:4Card::Machine::ClassMethods#collect_input_cards@$:6Card::Machine::ClassMethods#prepare_machine_input@%:/Card::Machine::ClassMethods#machine_engine@%:5Card::Machine::ClassMethods#store_machine_output@$%:Card::Machine.included@I%:Card::Machine#run_machine@]%:(Card::Machine#reset_machine_output!@n%:(Card::Machine#update_machine_output@|%:!Card::Machine#lock_cache_key@%:Card::Machine#locked?@%:Card::Machine#lock!@%:Card::Machine#unlock!@%:$Card::Machine#update_input_card@%:#Card::Machine#input_item_cards@%:%Card::Machine#machine_output_url@%:&Card::Machine#machine_output_path@%:(Card::Machine#ensure_machine_output@%:Card::Setting@3:Card::Setting#codename@3:Card::Setting#codename=@4:Card::Setting.extended@4:!Card::Setting::@@group_names@%4:Card::Setting::@@groups@34:#Card::Setting::@@user_specific@A4:!Card::Setting.user_specific?@O4:Card::Setting#to_type_id@d4:Card::Setting#setting_opts@t4:&Card::Setting#applies_to_cardtype@4:$CarrierWave::Uploader::Versionso;7;IC;[o; ; F; ;,;;;I"2CarrierWave::Uploader::Versions#full_filename;T;[[I" for_file;T0;[[@Qi([@Si#;T;;;;;[;{;IC;"+put version at the end of the filename ;T;@;F;[;[; I"+put version at the end of the filename;T;!0;"o;#;$F;%i";&i";'@;(I" def full_filename(for_file);T;)T;*I"def full_filename(for_file) name = super(for_file) parts = name.split '.' basename = [parts.shift, version_name].compact.join('-') "#{basename}.#{parts.join('.')}" end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@Si[@Qi$;T;: Versions;;;;;[;{;IC;"*DATABASE_CONTENT* if in mod: :codename/modname.ext else ~card_id/action_id.ext *FILE SYSTEM* if in mod (mod_dir)/files/codename/type_code-variant.ext (no colon on codename!) else (files_dir)/id/action_id-variant.ext (no tilde on id!) variant = icon|small|medium|large|original (only for images) *URLS* mark.ext mark/revision.ext mark/revision-variant.ext revision = modname or action_id Examples: ~22/33-medium.png :yeti_skin/05_standard-large.png ;T;@;F;[;[; I"*DATABASE_CONTENT* if in mod: :codename/modname.ext else ~card_id/action_id.ext *FILE SYSTEM* if in mod (mod_dir)/files/codename/type_code-variant.ext (no colon on codename!) else (files_dir)/id/action_id-variant.ext (no tilde on id!) variant = icon|small|medium|large|original (only for images) *URLS* mark.ext mark/revision.ext mark/revision-variant.ext revision = modname or action_id Examples: ~22/33-medium.png :yeti_skin/05_standard-large.png;T;!0;"o;#;$F;%i;&i;'o;S ;T0;UI"CarrierWave::Uploader;T;V@;;&;'o;S ;T0;U0;V0;;;'@;W@K};X0;W0;X0;I"$CarrierWave::Uploader::Versions;T;@:ImageUploader#path@:ImageUploader#identifier@: ImageUploader#full_filename@%:Card::FollowOption@L2:"Card::FollowOption::@@options@N2: Card::FollowOption.included@\2:!Card::FollowOption.codenames@o2:Card::FollowOption.cards@2:+Card::FollowOption.restrictive_options@2:$Card::FollowOption.main_options@2:+Card::FollowOption#restrictive_option?@2:#Card::FollowOption#description@2:%Card::FollowOption::ClassMethods@2:=Card::FollowOption::ClassMethods#restrictive_follow_opts@2:1Card::FollowOption::ClassMethods#follow_opts@2:1Card::FollowOption::ClassMethods#follow_test@2:Card::Set::All::Rules::ClassMethods#all_rule_keys_with_id@ :OCard::Set::All::Rules::ClassMethods#all_user_rule_keys_with_id_and_user_id@ :BCard::Set::All::Rules::ClassMethods#all_rule_keys_with_id_for@ :=Card::Set::All::Rules::ClassMethods#cached_rule_keys_for@0 :CCard::Set::All::Rules::ClassMethods#all_user_ids_with_rule_for@@ :8Card::Set::All::Rules::ClassMethods#user_rule_cards@R :3Card::Set::All::Rules::ClassMethods#rule_cache@d :6Card::Set::All::Rules::ClassMethods#user_rule_key@r :7Card::Set::All::Rules::ClassMethods#user_ids_cache@ :8Card::Set::All::Rules::ClassMethods#rule_keys_cache@ :9Card::Set::All::Rules::ClassMethods#clear_rule_cache@ :>Card::Set::All::Rules::ClassMethods#clear_user_rule_cache@ :DCard::Set::All::Rules::ClassMethods#refresh_rule_cache_for_user@ :9Card::Set::All::Rules::ClassMethods#write_rule_cache@ :=Card::Set::All::Rules::ClassMethods#write_user_ids_cache@ :>Card::Set::All::Rules::ClassMethods#write_rule_keys_cache@ :8Card::Set::All::Rules::ClassMethods#read_rule_cache@ :>Card::Set::All::Rules::ClassMethods#clear_read_rule_cache@ :Card::Set::All::Fetch@L :(Card::Set::All::Fetch::ClassMethods@N :.Card::Set::All::Fetch::ClassMethods#fetch@P :1Card::Set::All::Fetch::ClassMethods#fetch_id@f :+Card::Set::All::Fetch::ClassMethods#[]@z :0Card::Set::All::Fetch::ClassMethods#exists?@ :/Card::Set::All::Fetch::ClassMethods#known?@ :/Card::Set::All::Fetch::ClassMethods#expire@ :0Card::Set::All::Fetch::ClassMethods#members@ :4Card::Set::All::Fetch::ClassMethods#set_members@ :.Card::Set::All::Fetch::ClassMethods#cache@ :9Card::Set::All::Fetch::ClassMethods#fetch_from_cache@ :;Card::Set::All::Fetch::ClassMethods#fullname_from_name@ :?Card::Set::All::Fetch::ClassMethods#fetch_from_cache_or_db@ :?Card::Set::All::Fetch::ClassMethods#fetch_from_cache_by_id@- :@Card::Set::All::Fetch::ClassMethods#fetch_from_cache_by_key@@ :6Card::Set::All::Fetch::ClassMethods#new_for_cache@S ::Card::Set::All::Fetch::ClassMethods#clean_cache_opts?@g :7Card::Set::All::Fetch::ClassMethods#write_to_cache@{ : Card::Set::All::Fetch#fetch@ : Card::Set::All::Fetch#renew@ :(Card::Set::All::Fetch#expire_pieces@ :!Card::Set::All::Fetch#expire@ :"Card::Set::All::Fetch#refresh@ :'Card::Set::All::Fetch#eager_renew?@ :Card::Set::Right@ :Card::Set::Right::Cc@ :Card::Set::Right::To@ :Card::Set::All::Trash@m :!Card::Set::All::Trash#delete@o :"Card::Set::All::Trash#delete!@ :Card::Set::Right::Bcc@ :2Card::Set::Right::Bcc#process_email_addresses@ :Card::Set::All::Phases@ :!Card::Set::All::Phases#abort@ :%Card::Set::All::Phases#abortable@ :*Card::Set::All::Phases#valid_subcard?@ :=Card::Set::All::Phases#with_transaction_returning_status@ :#Card::Set::All::Phases#prepare@ :#Card::Set::All::Phases#approve@ :+Card::Set::All::Phases#identify_action@ :!Card::Set::All::Phases#store@:"Card::Set::All::Phases#extend@&:(Card::Set::All::Phases#rescue_event@4:*Card::Set::All::Phases#event_applies?@D:$Card::Set::All::Phases#subcards@Y:#Card::Set::All::Phases#success@f:Card::Set::All::States@\:%Card::Set::All::States#new_card?@^: Card::Set::All::States#new?@t:"Card::Set::All::States#known?@:!Card::Set::All::States#real?@:$Card::Set::All::States#unknown?@:%Card::Set::All::States#pristine?@:Card::Set::All::Follow@:3Card::Set::All::Follow::FOLLOWER_IDS_CACHE_KEY@:(Card::Set::All::Follow#follow_label@:%Card::Set::All::Follow#followers@:*Card::Set::All::Follow#follower_names@:-Card::Set::All::Follow#follow_rule_card?@:*Card::Set::All::Follow#follow_option?@/:(Card::Set::All::Follow#followed_by?@B:%Card::Set::All::Follow#followed?@X:0Card::Set::All::Follow#follow_rule_applies?@k:7Card::Set::All::Follow#with_follower_candidate_ids@:3Card::Set::All::Follow#default_follow_set_card@:+Card::Set::All::Follow#followed_field?@:(Card::Set::All::Follow#follower_ids@:,Card::Set::All::Follow#direct_followers@:/Card::Set::All::Follow#direct_follower_ids@:?Card::Set::All::Follow#all_direct_follower_ids_with_reason@:4Card::Set::All::Follow#write_follower_ids_cache@:3Card::Set::All::Follow#read_follower_ids_cache@:)Card::Set::All::Follow::ClassMethods@:?Card::Set::All::Follow::ClassMethods#follow_caches_expired@:Card::Set::All::Permissions#add_to_read_rule_update_queue@:8Card::Set::All::Permissions#track_permission_errors@:.Card::Set::All::Permissions#recaptcha_on?@:5Card::Set::All::Permissions#have_recaptcha_keys?@:*Card::Set::All::Permissions::Accounts@:1Card::Set::All::Permissions::Accounts#permit@:(Card::Set::All::Permissions::Follow@:5Card::Set::All::Permissions::Follow#ok_to_update@:5Card::Set::All::Permissions::Follow#ok_to_create@:5Card::Set::All::Permissions::Follow#ok_to_delete@:/Card::Set::All::Permissions::Follow#permit@*:Card::Set::All::Base@:Card::Set::Self::Layout@`6:Card::Set::All::File@:Card::Set::All::Json@:Card::Set::Type::Toggle@+:Card::Set::Right::Email@#:,Card::Set::Right::Email#email_required?@#:'Card::Set::Right::Email#ok_to_read@#:,Card::Set::Right::Email#is_own_account?@#:Card::Set::Type::Signup@+:'Card::Set::Type::Signup#has_token?@+:>Card::Set::Type::Signup#signed_in_as_me_without_password?@+:Card::Set::Right::Stats@/$:Card::Set::All::Text@:Card::Set::Self::Script@w6:Card::Set::Right::Token@D$:Card::Set::Right::Style@$:Card::Set::Type::Phrase@,:Card::Set::Self::Thanks@6:Card::Set::Self::Update@6:Card::Set::Self::Alerts@6:Card::Set::All::Account@:*Card::Set::All::Account::ClassMethods@:DCard::Set::All::Account::ClassMethods#default_accounted_type_id@:$Card::Set::All::Account#account@:)Card::Set::All::Account#accountable?@:$Card::Set::All::Account#parties@1:#Card::Set::All::Account#among?@?:,Card::Set::All::Account#is_own_account?@T:'Card::Set::All::Account#read_rules@f:&Card::Set::All::Account#all_roles@t:Card::Set::All::EmailText@:Card::Set::Type::Number@&,:*Card::Set::Type::Number#valid_number?@(,:Card::Set::Self::Navbox@6:Card::Set::Self::Recent@6:Card::Set::Self::Search@6:Card::Set::Self::Signin@7:Card::Set::All::EmailHtml@:Card::Set::Self::Version@%7: Card::Set::Right::Followers@&:,Card::Set::Right::Followers#raw_content@&:)Card::Set::Right::Followers#virtual?@&: Card::Set::Right::Following@.:)Card::Set::Right::Following#virtual?@.:Card::Set::Right::Create@.:Card::Set::Type::Html@Q,:&Card::Set::Type::Html#clean_html?@S,:$Card::Set::Type::Html#diff_args@i,:Card::Set::Right::Delete@.:Card::Set::Right::Script@/:Card::Set::Type::Setting@,:*Card::Set::Type::Setting.member_names@,:Card::Set::Type::Session@,:&Card::Set::Type::Session#history?@,:)Card::Set::Type::Session#followable?@,:%Card::Set::Type::Session#content@,:Card::Set::Right::Status@/:*Card::Set::Right::Status#ok_to_update@ /:Card::Set::Right::Update@D/:Card::Set::Self::Options@:7:Card::Set::Self::Default@Q7:Card::Set::Self::Captcha@h7:Card::Set::Right::Comment@[/:Card::Set::Self::AddHelp@7:Card::Set::Type::Cardtype@,:+Card::Set::Type::Cardtype#follow_label@,:+Card::Set::Type::Cardtype#followed_by?@ -:6Card::Set::Type::Cardtype#default_follow_set_card@ -:3Card::Set::Type::Cardtype#cards_of_type_exist?@.-:Card::Set::Right::Default@r/:Card::Set::All::EventViz@:$Card::Set::All::EventViz#events@:)Card::Set::All::EventViz#puts_events@:)Card::Set::All::EventViz#events_tree@ :'ActiveSupport::Callbacks::Callbacko; ;IC;[o; ; F; ;,;;;I"0ActiveSupport::Callbacks::Callback#applies?;T;[[I" object;T0;[[@iH[@iI;F;: applies?;;;[;{;IC;" ;T;@;.0;F;[;[o;0 ;1I" return;F;2I";T;0;3[I" Boolean;T;@; I";T;!0;'@;(I"def applies?(object);T;)T;*I"Rdef applies? object conditions_lambdas.all? { |c| c.call(object, nil) } end;T;+T;I@;JIC;[;I@;KIC;[;I@;LIC;M{; IC;M{;NT;,IC;M{;NT;NT;O{;P[;[[@iG[@iH;F;: Callback;;;;;[;{;IC;" ;T;@;.0;F;[;[; I";T;!0;'o;S ;T0;UI"ActiveSupport::Callbacks;T;V@;:Callbacks;'o;S ;T0;U0;V0;:ActiveSupport;'@;W0;X0;W0;X0;I"'ActiveSupport::Callbacks::Callback;T;Io;S ;T0;U0;V0;;J;'@;W@;X0;+T:Card::Set::Right::Account@/:&Card::Set::Right::Account#active?@/:'Card::Set::Right::Account#blocked?@/:(Card::Set::Right::Account#built_in?@/:'Card::Set::Right::Account#pending?@/:4Card::Set::Right::Account#authenticate_by_token@/:*Card::Set::Right::Account#confirm_ok?@/:9Card::Set::Right::Account#edit_password_success_args@/:/Card::Set::Right::Account#has_reset_token?@0:)Card::Set::Right::Account#ok_to_read@0:/Card::Set::Right::Account#changes_visible?@&0:1Card::Set::Right::Account#send_change_notice@:0:Card::Set::Self::Autoname@7:Card::Set::All::AllJs@+:Card::Set::All::AllCsv@@:Card::Set::Self::OnCreate@7:Card::Set::Right::Password@0:*Card::Set::Right::Password#ok_to_read@0:Card::Set::All::AllCss@U:Card::Set::Self::Structure@7:Card::Set::Self::OnDelete@7:Card::Set::Self::OnUpdate@7:Card::Set::Right::AddHelp@0:"Card::Set::Right::HtmlMessage@0:.Card::Set::Right::HtmlMessage#clean_html?@0:Card::Set::Self::ScriptAce@ 8: Card::Set::Right::Structure@0:Card::Set::Type::Pointer@*:'Card::Set::Type::Pointer#diff_args@*:(Card::Set::Type::Pointer#item_cards@*:(Card::Set::Type::Pointer#item_names@*:&Card::Set::Type::Pointer#item_ids@*:'Card::Set::Type::Pointer#item_type@*:$Card::Set::Type::Pointer#items=@*: Card::Set::Type::Pointer#<<@*:&Card::Set::Type::Pointer#add_item@*:'Card::Set::Type::Pointer#add_item!@+:'Card::Set::Type::Pointer#drop_item@+:(Card::Set::Type::Pointer#drop_item!@(+:)Card::Set::Type::Pointer#insert_item@8+:*Card::Set::Type::Pointer#insert_item!@J+:/Card::Set::Type::Pointer#options_rule_card@\+:*Card::Set::Type::Pointer#option_names@j+:*Card::Set::Type::Pointer#option_cards@x+: Card::Set::Self::StyleCards@8:#Card::Set::Type::EmailTemplate@T-:/Card::Set::Type::EmailTemplate#clean_html?@V-:+Card::Set::Type::EmailTemplate#deliver@l-:7Card::Set::Type::EmailTemplate#process_email_field@}-:9Card::Set::Type::EmailTemplate#process_message_field@-:0Card::Set::Type::EmailTemplate#email_config@-:#Card::Set::Right::FollowFields@&1:!Card::Set::Right::Discussion@;1:>Card::Set::Right::Discussion#show_comment_box_in_related?@=1: Card::Set::Type::LayoutType@-: Card::Set::Self::ScriptSlot@38: Card::Set::Type::SearchType@):+Card::Set::Type::SearchType#item_cards@):+Card::Set::Type::SearchType#item_names@*):*Card::Set::Type::SearchType#item_type@:):&Card::Set::Type::SearchType#count@I):&Card::Set::Type::SearchType#query@Z):*Card::Set::Type::SearchType#get_query@k):!Card::Set::Self::Accountable@H8: Card::Set::Type::JavaScript@-:,Card::Set::Type::JavaScript#clean_html?@-:*Card::Set::Type::JavaScript#diff_args@-:$Card::Set::Self::FollowDefaults@_8:"Card::Set::Self::AccountLinks@t8:Card::Set::All::RichHtml@j:#Card::Set::All::RichHtml::Menu@l:"Card::Set::Type::CoffeeScript@.:1Card::Set::Type::CoffeeScript#compile_coffee@.:.Card::Set::Type::CoffeeScript#clean_html?@0.:,Card::Set::Type::CoffeeScript#diff_args@C.:#Card::Set::All::RichHtml::Form@:#Card::Set::All::ContentHistory@@:+Card::Set::All::ContentHistory#content@B:,Card::Set::All::ContentHistory#content=@S:6Card::Set::All::ContentHistory#save_content_draft@c:2Card::Set::All::ContentHistory#last_change_on@s:6Card::Set::All::ContentHistory#selected_action_id@:7Card::Set::All::ContentHistory#selected_action_id=@:3Card::Set::All::ContentHistory#selected_action@:;Card::Set::All::ContentHistory#with_selected_action_id@:>Card::Set::All::ContentHistory#selected_content_action_id@:2Card::Set::All::ContentHistory#last_action_id@:/Card::Set::All::ContentHistory#last_action@:7Card::Set::All::ContentHistory#last_content_action@::Card::Set::All::ContentHistory#last_content_action_id@:.Card::Set::All::ContentHistory#last_actor@:,Card::Set::All::ContentHistory#last_act@:,Card::Set::All::ContentHistory#acted_at@$:3Card::Set::All::ContentHistory#previous_action@2:.Card::Set::All::ContentHistory#revised_at@B:+Card::Set::All::ContentHistory#creator@P:+Card::Set::All::ContentHistory#updater@^:/Card::Set::All::ContentHistory#clean_html?@l:.Card::Set::All::ContentHistory#draft_acts@:"Card::Set::Self::ScriptJquery@8:!Card::Set::Self::SmartmenuJs@8:"Card::Set::Right::WhenCreated@e1:&Card::Set::All::TrackedAttributes@:8Card::Set::All::TrackedAttributes#assign_attributes@:ECard::Set::All::TrackedAttributes#assign_set_specific_attributes@:@:(Card::Auth::@@simulating_setup_need@E:$Card::Auth::SETUP_COMPLETED_KEY@,E:+Card::Auth::DEFAULT_RECAPTCHA_SETTINGS@9E:Card::Auth.password_valid?@FE:&Card::Auth.set_current_from_token@\E:%Card::Auth.set_current_from_mark@nE:Card::Auth.find_by_token@}E:*Card::Auth.instant_account_activation@E:!Card::Auth.always_ok_usr_id?@E:Card::Diff#result@ʂ:Card::Diff#initialize@ׂ:Card::Diff#red?@:Card::Diff#green?@:#Card::Diff#lcs_opts_for_format@:Card::Stage@cv:Card::Stage::STAGES@ev:Card::Stage::STAGE_INDEX@sv:Card::Stage#stage_symbol@v:Card::Stage#stage_index@v:Card::Stage#stage_ok?@v:Card::Stage#before?@v:Card::Stage#after?@v:Card::Stage#in?@v:Card::Cache.reset_all@G:Card::Cache.reset_hard@G:Card::Cache.reset_soft@G:Card::Cache.reset_other@G:Card::Cache#hard@G:Card::Cache#soft@G:Card::Query#comment@h:Card::Query#unjoined@h:Card::Query#unjoined=@i: Card::Query#default_comment@i:Card::Query#all_joins@"i:,Card::Loader.update_machine_output_hack@K:&Card::Loader.update_script_output@L:%Card::Loader.update_style_output@L:Card::Format#nest_opts@iP:Card::Format#nest_opts=@vP:#Card::Format.extract_view_tags@P:$Card::Format#get_content_object@P:!Card::Success#process_target@U:%Card::Content#process_each_chunk@;W:$Card::Content.process_attribute@JW:Card::Content.find_tags@[W:'Card::Codename.each_codenamed_card@Y:$Card::Codename.check_duplicates@Y:Card#subcards@w:Card#expire_subcards@w:Card::Subcards@w: Card::Subcards#context_card@!w:!Card::Subcards#context_card=@.w:Card::Subcards#keys@Aw:Card::Subcards#keys=@Nw:Card::Subcards#initialize@aw:Card::Subcards#clear@uw:Card::Subcards#deep_clear@w:Card::Subcards#remove@w:Card::Subcards#add@w:%Card::Subcards#catch_up_to_stage@w:Card::Subcards#rename@w:Card::Subcards#<<@w:"Card::Subcards#method_missing@w:Card::Subcards#each_card@w:Card::Subcards#each@x:!Card::Subcards#each_with_key@ x:Card::Subcards#[]=@x:Card::Subcards#[]@*x:Card::Subcards#field@9x:Card::Subcards#card@Hx:Card::Subcards#add_child@Wx: Card::Subcards#remove_child@hx:Card::Subcards#add_field@wx: Card::Subcards#remove_field@x:Card::Subcards#present?@x:@q{#subcard_key@x:!@q{#fetch_subcard@x: @q{#prepend_plus@x:%@q{#field_name_to_key@x:)@q{#extract_subcard_args!@x:%@q{#new_by_attributes@x:+@q{#absolutize_subcard_name@x:@q{#new_by_card@y:Card#right_id=@0y:Card#left_id=@?y:Card#type_id=@Ny:Card#write_card_or_id@]y:Card#with_id_when_exists@ny;@}|:Array#to_pointer_content@|:Card::Diff::LCS@$:Card::Diff::LCS#initialize@&:Card::Diff::LCS#run@::Card::Diff::LCS#compare@M:8Card::Diff::LCS#separate_comparables_from_excludees@^::Card::Diff::LCS#check_exclude_and_disjunction_pattern@m:)Card::Diff::LCS#split_and_preprocess@|:+Card::Diff::LCS#split_to_list_of_words@:Card::Diff::LCS#preprocess@: Card::Diff::LCS#postprocess@:$Card::Diff::LCS::ChunkProcessor@:+Card::Diff::LCS::ChunkProcessor#result@:,Card::Diff::LCS::ChunkProcessor#summary@ǃ:-Card::Diff::LCS::ChunkProcessor#dels_cnt@ԃ:-Card::Diff::LCS::ChunkProcessor#adds_cnt@:/Card::Diff::LCS::ChunkProcessor#initialize@:(Card::Diff::LCS::ChunkProcessor#run@:4Card::Diff::LCS::ChunkProcessor#write_unchanged@:/Card::Diff::LCS::ChunkProcessor#write_dels@&:/Card::Diff::LCS::ChunkProcessor#write_adds@3:4Card::Diff::LCS::ChunkProcessor#write_excludees@@:6Card::Diff::LCS::ChunkProcessor#del_old_excludees@M:6Card::Diff::LCS::ChunkProcessor#add_new_excludees@Z:1Card::Diff::LCS::ChunkProcessor#process_word@g:4Card::Diff::LCS::ChunkProcessor#process_element@v:)Card::Diff::LCS::ChunkProcessor#plus@:*Card::Diff::LCS::ChunkProcessor#minus@:&Card::Diff::LCS::ExcludeeIterator@:1Card::Diff::LCS::ExcludeeIterator#initialize@:0Card::Diff::LCS::ExcludeeIterator#word_step@ӄ:+Card::Diff::LCS::ExcludeeIterator#next@:Card::Set::Event@<:Card::Set::Event#event@<:"Card::Set::Event#define_event@<:!Card::Set::Event#with_delay?@0<:(Card::Set::Event#process_stage_opts@D<:2Card::Set::Event#define_event_delaying_method@S<:)Card::Set::Event#define_event_method@d<:'Card::Set::Event#define_active_job@w<:)Card::Set::Event#set_event_callbacks@<:*Card::Migration#update_machine_output@Z: Card::Reference.mass_insert@]:!Card::Reference.map_referees@]:#Card::Reference.unmap_referees@]:-Card::Reference.unmap_if_referee_missing@]:.Card::Reference.delete_if_referer_missing@]:!Card::Reference.recreate_all@]:Card::Reference#referer@]:Card::Reference#referee@^:Card::Set::Trait@<:#Card::Set::Trait#card_accessor@<:!Card::Set::Trait#card_reader@<:!Card::Set::Trait#card_writer@<:$Card::Set::Trait#add_attributes@<: Card::Set::Trait#get_traits@=: Card::Set::Trait#add_traits@=:'Card::Set::Trait#define_trait_card@&=:)Card::Set::Trait#define_trait_reader@7=:)Card::Set::Trait#define_trait_writer@F=:"Card::ViewCache.verbose_fetch@i:/Card::ViewCache.increment_cached_views_cnt@j:%Card::ViewCache.cached_views_cnt@j:(Card::ViewCache.increment_frequency@j:Card::ViewCache.cache_key@.j:$Card::ViewCache.cacheable_view?@Aj:Card::Set::Format#format@:'Card::Set::Format#define_on_format@:*Card::Set::Format#register_set_format@:*Card::Set::Format#all_set_format_mod!@:"Card::Set::Format#each_format@!:)Card::Set::Format#applicable_format?@0:&Card::Set::Format::AbstractFormat@H:+Card::Set::Format::AbstractFormat#view@J:9Card::Set::Format::AbstractFormat#lookup_alias_block@]: Card::Query::Join#superjoin@_:!Card::Query::Join#superjoin=@_:Card::Query::Join#subjoins@_: Card::Query::Join#subjoins=@_:Card::Query::Join#left?@_:Card::Query::Join#in_left?@`:Card::Set::Loader@f=:Card::Set::Loader#extended@h=:#Card::Set::Loader#register_set@y=:%Card::Set::Loader#write_tmp_file@=:+Card::Set::Loader#process_base_modules@=:/Card::Set::Loader#process_base_module_list@=:*Card::Set::Loader#clean_empty_modules@=:3Card::Set::Loader#clean_empty_module_from_hash@=:Card::Format::Nest@P:!Card::Format::Nest#subformat@P:'Card::Format::Nest#field_subformat@P:"Card::Format::Nest#field_nest@P:&Card::Format::Nest#with_nest_mode@P:$Card::Format::Nest#prepare_nest@P:Card::Format::Nest#nest@P:(Card::Format::Nest#get_nest_content@Q:)Card::Format::Nest#fetch_nested_card@Q:%Card::Format::Nest#nest_new_args@,Q:!Card::Format::Nest#wrap_main@;Q:%Card::Format::Nest#nest_defaults@JQ:)Card::Format::Nest#get_nest_defaults@YQ:#Card::Format::Nest#expand_main@hQ:0Card::Format::Nest#legacy_main_opts_tweaks!@wQ:)Card::Format::Nest#view_in_edit_mode@Q:+Card::Format::Nest#view_in_closed_mode@Q:Card::Diff::Result@: Card::Diff::Result#complete@:!Card::Diff::Result#complete=@:Card::Diff::Result#summary@2: Card::Diff::Result#summary=@@: Card::Diff::Result#dels_cnt@S:!Card::Diff::Result#dels_cnt=@`: Card::Diff::Result#adds_cnt@s:!Card::Diff::Result#adds_cnt=@:"Card::Diff::Result#initialize@:)Card::Diff::Result#write_added_chunk@:+Card::Diff::Result#write_deleted_chunk@:-Card::Diff::Result#write_unchanged_chunk@ƅ:,Card::Diff::Result#write_excluded_chunk@Յ: Card::Diff::Result::Summary@:+Card::Diff::Result::Summary#initialize@:)Card::Diff::Result::Summary#rendered@:$Card::Diff::Result::Summary#add@:'Card::Diff::Result::Summary#delete@:%Card::Diff::Result::Summary#omit@%:*Card::Diff::Result::Summary#add_chunk@2:-Card::Diff::Result::Summary#render_chunk@C:1Card::Diff::Result::Summary#truncate_overlap@T:/Card::Diff::Result::Summary#cut_with_joint@a:3Card::Diff::Result::Summary#replace_with_joint@p:Card::SpecHelper#create!@o:Card::SpecHelper#in_stage@o:$Card::SpecHelper#add_test_event@o:'Card::SpecHelper#remove_test_event@o: Card::SpecHelper#test_event@p:&Card::SpecHelper#with_test_events@"p:Card::Format::Render@Q:Card::Format::Render#page@Q: Card::Format::Render#render@Q:%Card::Format::Render#view_method@Q:+Card::Format::Render#canonicalize_view@Q:+Card::Format::Render#default_item_view@Q:&Card::Format::Render#hidden_view?@ R:$Card::Format::Render#show_view?@!R:-Card::Format::Render#nest_arg_visibility@7R:/Card::Format::Render#parse_view_visibility@HR:-Card::Format::Render#default_render_args@WR:%Card::Format::Render#rescue_view@iR:&Card::Format::Render#current_view@zR:(Card::Format::Render#error_cardname@R:)Card::Format::Render#rendering_error@R:#Card::Format::Render#add_class@R:$Card::Format::Render#id_counter@R:#Card::Format::Render#unique_id@R:Card::Content::Chunk@jW:%Card::Content::Chunk::@@raw_list@lW:2Card::Content::Chunk::@@prefix_regexp_by_list@zW:'Card::Content::Chunk::@@prefix_map@W:(Card::Content::Chunk.register_class@W:'Card::Content::Chunk.register_list@W:.Card::Content::Chunk.find_class_by_prefix@W:+Card::Content::Chunk.get_prefix_regexp@W:#Card::Content::Chunk::Abstract@W:(Card::Content::Chunk::Abstract#text@W:1Card::Content::Chunk::Abstract#process_chunk@W:.Card::Content::Chunk::Abstract.full_match@W:+Card::Content::Chunk::Abstract.full_re@X:/Card::Content::Chunk::Abstract.context_ok?@X:2Card::Content::Chunk::Abstract#reference_code@(X:.Card::Content::Chunk::Abstract#initialize@5X:-Card::Content::Chunk::Abstract#interpret@KX:*Card::Content::Chunk::Abstract#format@^X:(Card::Content::Chunk::Abstract#card@kX:(Card::Content::Chunk::Abstract#to_s@xX:+Card::Content::Chunk::Abstract#inspect@X:+Card::Content::Chunk::Abstract#as_json@X:Card::Content::Parser@X:%Card::Content::Parser#initialize@X: Card::Content::Parser#parse@X:Card::StageDirector@y:$Card::StageDirector#prior_store@y:%Card::StageDirector#prior_store=@y:Card::StageDirector#act@y:Card::StageDirector#act=@y:Card::StageDirector#card@y:Card::StageDirector#card=@y:Card::StageDirector#stage@y:Card::StageDirector#stage=@y:Card::StageDirector#parent@z: Card::StageDirector#parent=@z:Card::StageDirector#main@"z:Card::StageDirector#main=@/z:%Card::StageDirector#subdirectors@Bz:&Card::StageDirector#subdirectors=@Oz: Card::StageDirector#running@bz:!Card::StageDirector#running?@oz:Card::StageDirector#main?@{z:#Card::StageDirector#initialize@z:!Card::StageDirector#register@z:#Card::StageDirector#unregister@z:Card::StageDirector#delete@z:+Card::StageDirector#prepare_for_phases@z:)Card::StageDirector#validation_phase@z:&Card::StageDirector#storage_phase@z:*Card::StageDirector#integration_phase@z:*Card::StageDirector#catch_up_to_stage@{:)Card::StageDirector#call_after_store@{:!Card::StageDirector#need_act@{:&Card::StageDirector#main_director@+{:Card::StageDirector#to_s@8{:)Card::StageDirector#run_single_stage@E{:,Card::StageDirector#run_stage_callbacks@V{:/Card::StageDirector#run_subdirector_stages@e{:Card::StageDirector#store@t{:,Card::StageDirector#store_with_subcards@{:-Card::StageDirector#store_prior_subcards@{:'Card::StageDirector#store_subcards@{:6Card::StageDirector#store_and_finalize_as_subcard@{:Card::StageSubdirector@{:&Card::StageSubdirector#initialize@{:"Card::StageSubdirector#delete@{:Card::Cache::Temporary@H:!Card::Cache::Temporary#store@H:&Card::Cache::Temporary#initialize@H: Card::Cache::Temporary#read@(H:!Card::Cache::Temporary#write@7H:!Card::Cache::Temporary#fetch@HH:"Card::Cache::Temporary#delete@YH: Card::Cache::Temporary#dump@hH:!Card::Cache::Temporary#reset@uH:"Card::Cache::Temporary#exist?@H:/Card::Query::Attributes#restrict_reference@qd:Card::Cache::Persistent@H:#Card::Cache::Persistent#prefix@H:$Card::Cache::Persistent#prefix=@H:*Card::Cache::Persistent.database_name@H:'Card::Cache::Persistent#initialize@H:"Card::Cache::Persistent#renew@H:"Card::Cache::Persistent#reset@H:"Card::Cache::Persistent#stamp@ I:&Card::Cache::Persistent#stamp_key@I:&Card::Cache::Persistent#new_stamp@#I:%Card::Cache::Persistent#full_key@0I:!Card::Cache::Persistent#read@?I:+Card::Cache::Persistent#write_variable@NI:"Card::Cache::Persistent#write@aI:"Card::Cache::Persistent#fetch@rI:#Card::Cache::Persistent#delete@I:'Card::Cache::Persistent#annihilate@I:#Card::Cache::Persistent#exist?@I:Card::SubdirectorArray@ |:4Card::SubdirectorArray.initialize_with_subcards@|:&Card::SubdirectorArray#initialize@|:Card::SubdirectorArray#add@2|:+Card::SubdirectorArray#delete_director@A|:"Card::SubdirectorArray#delete@N|:(Card::SubdirectorArray#add_director@]|:Card::Format::Permission@R:%Card::Format::Permission#ok_view@R:+Card::Format::Permission#approved_view@R:,Card::Format::Permission#permitted_view@ S:.Card::Format::Permission#view_for_unknown@S:!Card::Format::Permission#ok?@+S: Card#act@|:Card.new_director@|:Card::DirectorRegister@|:(Card::DirectorRegister.act_director@|:%Card::DirectorRegister.directors@|:!Card::DirectorRegister.clear@|:!Card::DirectorRegister.fetch@|:Card::DirectorRegister.add@|:"Card::DirectorRegister.delete@ }:'Card::DirectorRegister.deep_delete@}: Card::DirectorRegister.to_s@)}:Card::Act#card@p:Card::Act.delete_cardless@p:Card::Act.all_viewable@q:&Card::Query::SqlStatement#comment@e:)Card::Query::SqlStatement#full_field@e:-Card::Query::SqlStatement#join_on_clause@e:+Card::Query::SqlStatement#deeper_joins@e:(Card::Query::SqlStatement#on_clause@ f:Card::ActiveRecordHelper@Z:)Card::ActiveRecordHelper#create_card@Z:*Card::ActiveRecordHelper#create_card!@Z:)Card::ActiveRecordHelper#update_card@[:*Card::ActiveRecordHelper#update_card!@[:.Card::ActiveRecordHelper#create_or_update@%[:/Card::ActiveRecordHelper#create_or_update!@7[:3Card::ActiveRecordHelper#resolve_name_conflict@I[:Card::Change.field_index@s:#Card::Action.delete_changeless@r:Card::Action#value@r:Card::Action#change@r:Card::Action#changes@ s: Card::Action#previous_value@s:%Card::Action#content_diff_object@'s:!Card::Action#previous_change@7s:!Card::Action#interpret_field@Fs:!Card::Action#interpret_value@Us:Card::Setting#set_position@4:(Card::Machine.define_machine_events@ &:'Card::Machine.define_machine_views@&:0Card::Machine.set_default_machine_behaviour@+&:7Card::Machine.set_default_input_preparation_method@:&:4Card::Machine.set_default_output_storage_method@I&:6Card::Machine.set_default_input_collection_method@X&:Card::FollowOption::@@test@Z3:1Card::FollowOption::@@follower_candidate_ids@g3:,Card::MachineInput.define_delete_events@U':+Card::MachineInput.define_update_event@g':0Card::MachineInput.search_involved_machines@x':'Card::Set::All::Name::ClassMethods@:5Card::Set::All::Name::ClassMethods#uniquify_name@:)Card::Set::All::Name#contextual_name@:'Card::Set::All::Name#absolute_name@: Card::Set::All::Name#fields@:%Card::Set::All::Name#field_names@:%Card::Set::All::Name#child_names@:*Card::Set::All::Name#descendant_names@*:%Card::Set::All::Name#descendants@::4Card::Set::All::Name#execute_referencers_update@G:.Card::Set::All::Type#type_name_or_default@:4Card::Set::All::Type#get_type_id_from_structure@:5Card::Set::All::Utils::ClassMethods#all_file_ids@r:=Card::Set::All::Utils::ClassMethods#all_trashed_card_ids@:KCard::Set::All::Utils::ClassMethods#delete_tmp_files_of_cached_uploads@:=Card::Set::All::Utils::ClassMethods#report_unmerged_json@:>Card::Set::All::Utils::ClassMethods#older_than_five_days?@:?Card::Set::All::Fetch::ClassMethods#standard_fetch_results@ :3Card::Set::All::Fetch::ClassMethods#fetch_soft@ :4Card::Set::All::Fetch::ClassMethods#quick_fetch@ :@Card::Set::All::Fetch::ClassMethods#assign_or_initialize_by@ :4Card::Set::All::Fetch::ClassMethods#expire_hard@ :;Card::Set::All::Fetch::ClassMethods#cached_set_members@ :=Card::Set::All::Fetch::ClassMethods#validate_fetch_opts!@ :4Card::Set::All::Fetch::ClassMethods#parse_mark!@ :7Card::Set::All::Fetch::ClassMethods#fetch_existing@ ::Card::Set::All::Fetch::ClassMethods#retrieve_from_db?@# :6Card::Set::All::Fetch::ClassMethods#fetch_from_db@9 ::Card::Set::All::Fetch::ClassMethods#skip_type_lookup?@L :Card::Set::All::Permissions#applicable_permission_rule_id@]:9Card::Set::All::Permissions#require_permission_rule!@n:)Card::Set::All::Account#own_account?@:(Card::Set::All::Account#fetch_roles@:'Card::Set::Right::Email#own_email?@ $:'Card::Set::Right::Token::DURATIONS@F$:&Card::Set::Right::Token#validate!@T$:%Card::Set::Right::Token#expired?@c$:'Card::Set::Right::Token#permanent?@u$:"Card::Set::Right::Token#used!@$:!Card::Set::Right::Token#term@$:-Card::Set::Right::Token#term_from_string@$:.Card::Set::Right::Account#validate_token!@M0:.Card::Set::Right::Account#reset_password?@\0:1Card::Set::Right::Structure#structuree_names@0:3Card::Set::Right::Structure#update_structurees@0:5Card::Set::Right::Structure#structuree_statement@1:9Card::Set::All::ContentHistory#new_content_action_id@:7Card::Set::All::TrackedAttributes#extract_type_id!@:8Card::Set::Abstract::Attachment#file_ready_to_save?@":.Card::Set::Abstract::Attachment#unfilled?@":@Card::Set::Abstract::Attachment#action_id_of_cached_upload=@":?Card::Set::Abstract::Attachment#action_id_of_cached_upload@":.Card::Set::Abstract::Attachment#empty_ok=@#:.Card::Set::Abstract::Attachment#empty_ok?@#:1Card::Set::Abstract::Attachment#retrieve_dir@%#:/Card::Set::Abstract::Attachment#upload_dir@2#:3Card::Set::Abstract::Attachment#tmp_upload_dir@@#:,Card::Set::Abstract::Attachment#mod_dir@Q#:ICard::Set::Abstract::Attachment#clear_upload_cache_dir_for_new_cards@_#: